Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
00d2ae98
Commit
00d2ae98
authored
13 years ago
by
Kieron Taylor
Browse files
Options
Downloads
Patches
Plain Diff
Added success/failure state for printing features versus empty lists.
parent
c63c6d32
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Utils/IO/Serializer.pm
+15
-2
15 additions, 2 deletions
modules/Bio/EnsEMBL/Utils/IO/Serializer.pm
with
15 additions
and
2 deletions
modules/Bio/EnsEMBL/Utils/IO/Serializer.pm
+
15
−
2
View file @
00d2ae98
...
...
@@ -49,6 +49,7 @@ sub new {
my
$class
=
shift
;
my
$self
=
{
'
filehandle
'
=>
shift
,
'
achieved_something
'
=>
0
,
};
bless
$self
,
$class
;
if
(
!
defined
(
$self
->
{'
filehandle
'}))
{
...
...
@@ -88,6 +89,7 @@ sub print_feature_list {
my
$self
=
shift
;
my
$feature_list
=
shift
;
if
(
ref
(
$feature_list
)
eq
'
ARRAY
')
{
if
(
scalar
(
@$feature_list
)
>
0
)
{
$self
->
{'
achieved_something
'}
=
1
;}
foreach
my
$feature
(
@
{
$feature_list
})
{
$self
->
print_feature
(
$feature
);
}
...
...
@@ -108,7 +110,7 @@ sub print_feature_Iterator {
my
$self
=
shift
;
my
$iterator
=
shift
;
if
(
$iterator
->
can
('
has_next
'))
{
$iterator
->
each
(
sub
{
$self
->
print_feature
(
$_
)});
$iterator
->
each
(
sub
{
$self
->
print_feature
(
$_
)
;
$self
->
{'
achieved_something
'}
=
1
;
});
}
else
{
throw
("
Supplied iterator does not look like Bio::EnsEMBL::Utils::Iterator
");
...
...
@@ -153,8 +155,19 @@ sub print_sequence {
my
$self
=
shift
;
my
$slice
=
shift
;
my
$fh
=
$self
->
{'
filehandle
'};
Bio::EnsEMBL::Utils::
SeqDumper
->
dump_fasta
(
$slice
,
$fh
);
Bio::EnsEMBL::Utils::
SeqDumper
->
dump_fasta
(
$slice
,
$fh
);
$self
->
{'
achieved_something
'}
=
1
;
}
=head2 printed_something
Description: Check if serializer has printed any useful data. Not accurate with FASTA
due to non-reporting dumper.
=cut
#TODO: Find a way for SeqDumper to indicate whether it printed anything or just the headers.
sub
printed_something
{
my
$self
=
shift
;
if
(
$self
->
{'
achieved_something
'})
{
return
1
;}
else
{
return
0
;}
}
1
;
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment