Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
9fb9e782
Commit
9fb9e782
authored
Nov 25, 2011
by
Kieron Taylor
😠
Browse files
Better behaviour for zero length lists of features
parent
e4efcb15
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
modules/Bio/EnsEMBL/Utils/IO/ReportSerializer.pm
modules/Bio/EnsEMBL/Utils/IO/ReportSerializer.pm
+6
-1
modules/Bio/EnsEMBL/Utils/IO/Serializer.pm
modules/Bio/EnsEMBL/Utils/IO/Serializer.pm
+1
-0
No files found.
modules/Bio/EnsEMBL/Utils/IO/ReportSerializer.pm
View file @
9fb9e782
...
...
@@ -58,6 +58,7 @@ my %feature_conversion = ( 'Bio::EnsEMBL::Gene' => 'Gene',
'
Bio::EnsEMBL::Variation::VariationFeature
'
=>
'
Variation
',
'
Bio::EnsEMBL::Funcgen::RegulatoryFeature
'
=>
'
Regulatory Feature
',
'
Bio::EnsEMBL::Compara::ConstrainedElement
'
=>
'
Constrained Element
',
'
Feature
'
=>
'
Feature
',
);
# Hash for selecting the correct attributes of unseen features for crude summary. This hash is
...
...
@@ -106,13 +107,16 @@ sub print_feature {
sub
print_feature_list
{
my
$self
=
shift
;
my
$feature_list
=
shift
;
if
(
scalar
(
@$feature_list
)
>
0
)
{
$self
->
{'
achieved_something
'}
=
1
;}
#from superclass
my
$fh
=
$self
->
{'
filehandle
'};
my
$example_feature
=
$feature_list
->
[
0
];
my
$feature_type
=
ref
(
$example_feature
);
my
$feature_count
=
0
;
unless
(
defined
$feature_type
)
{
$feature_type
=
"
Feature
"};
print
$fh
"
There are
",
scalar
(
@$feature_list
),"
",
$feature_conversion
{
$feature_type
},(
scalar
(
@$feature_list
)
!=
1
)
?
"
s
":"","
in this region
\n
";
if
(
scalar
(
@$feature_list
)
>
0
)
{
print
$fh
"
There are
",
scalar
(
@$feature_list
),"
",
$feature_conversion
{
$feature_type
},(
scalar
(
@$feature_list
)
!=
1
)
?
"
s
":"","
in this region
\n
";
}
if
(
scalar
(
@$feature_list
)
>
100
)
{
print
$fh
"
Too many to display, results truncated to the first 100
\n
";}
print
$fh
"
\n
";
foreach
my
$feature
(
@$feature_list
)
{
...
...
@@ -167,6 +171,7 @@ sub print_feature_iterator {
my
$feature
=
$feature_iterator
->
next
;
$self
->
print_feature
(
$feature
);
}
$self
->
{'
achieved_something
'}
=
1
;
}
=head2 print_main_header
...
...
modules/Bio/EnsEMBL/Utils/IO/Serializer.pm
View file @
9fb9e782
...
...
@@ -162,6 +162,7 @@ sub print_sequence {
=head2 printed_something
Description: Check if serializer has printed any useful data. Not accurate with FASTA
due to non-reporting dumper.
Returntype : Boolean
=cut
#TODO: Find a way for SeqDumper to indicate whether it printed anything or just the headers.
sub
printed_something
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment