blib/lib/Tie/File/AnyData/Bio/Fasta.pm

filter: Statementstmt 90.3% 28 / 31 Branchbran 70.0% 7 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 87.2% 41 / 47 CC 7 SCAR 11.1
CC
7
Cov
85%
TIEARRAY
4.1
__ANON__
4.0
BEGIN
1.0
CRAP 3.0
↑ Summary
1 package Tie::File::AnyData::Bio::Fasta;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '0.01';
8  
9 3 ▶BEGIN{
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 require Tie::File::AnyData;
11 }
12  
13 sub TIEARRAY
14 4 ▶ {
Subroutine TIEARRAY: called CC=4 SCAR=14.2
15 4 my ($pack,$file,%opts) = @_;
16  
17 ## option recsep is not allowed
18 4 for my $key (keys %opts) {
19 0 ▶ if ($key =~ /\-?recsep/){
Branch: 1 branch
BranchTrueFalseTotal
if ($key =~ /\-?recsep/) 0 0 0
20 0 carp "Option recsep is not accepted by IO::Tie::File::AnyData\nThis will be overrided\n";
21 0 delete $opts{$key};
22 }
23 }
24  
25 690 ▶ my $coderef = sub {
Subroutine __ANON__: called CC=4 SCAR=13.9
26 690 my ($fh) = @_;
27 690 ▶ return undef if eof $fh;
Branch: 1 branch
BranchTrueFalseTotal
if eof $fh 78 612 690
28 612 local $/ = "\n>";
29 612 my $faseq = <$fh>;
30 612 ▶ if (eof $fh) {
Branch: 1 branch
BranchTrueFalseTotal
if (eof $fh) { } 8 604 612
31 8 local $/ = "\n";
32 8 chomp $faseq;
33 } else {
34 604 chomp $faseq;
35 }
36 612 ▶ $faseq = ">$faseq" if $faseq !~ /^>/;
Branch: 1 branch
BranchTrueFalseTotal
unless $faseq =~ /^>/ 607 5 612
37 612 return "$faseq\n";
38 4 };
39  
40 4 ▶ carp "Overriding code ref" if (defined $opts{'code'});
Branch: 1 branch
BranchTrueFalseTotal
if defined $opts{"code"} 0 4 4
41 4 local $/="\n";
42 4 Tie::File::AnyData::TIEARRAY("Tie::File::AnyData",$file,%opts, code => $coderef);
43 }
44  
45 3 1;
46  
47 __END__
↑ Summary