blib/lib/Bio/Gonzales/Feat/IO.pm untested

filter: Statementstmt 0.0% 0 / 38 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 52 CC 3 SCAR 15.5
CC
3
Cov
0%
gffiterate
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.7
1 package Bio::Gonzales::Feat::IO;
2  
3 use warnings;
4 use strict;
5 use Carp;
6  
7 use 5.010;
8 use Bio::Gonzales::Util::File qw/open_on_demand/;
9 use Bio::Gonzales::Util qw/flatten/;
10 use Bio::Gonzales::Feat::IO::GFF3;
11  
12 use base 'Exporter';
13 our ( @EXPORT, @EXPORT_OK, %EXPORT_TAGS );
14 our $VERSION = '0.058'; # VERSION
15  
16 @EXPORT = qw();
17 %EXPORT_TAGS = ();
18 @EXPORT_OK = qw(gffiterate);
19  
20 sub gffiterate {
21 my ($src) = @_;
22  
23 my ( $fh, $fh_was_open ) = open_on_demand( $src, '<' );
24  
25 my $gff = Bio::Gonzales::Feat::IO::GFF3->new($fh);
26  
27 return sub {
28 my $feat = $gff->next_feat;
29  
30 unless ( defined($feat) ) {
31 $fh->close unless ($fh_was_open);
32 return;
33 }
34 return $feat;
35 };
36 }
37  
38 1;