line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tie::File::AnyData::Bio::Fasta; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
65826
|
use strict; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
90
|
|
4
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
63
|
|
5
|
2
|
|
|
2
|
|
10
|
use Carp; |
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
244
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN{ |
10
|
2
|
|
|
2
|
|
2054
|
require Tie::File::AnyData; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub TIEARRAY |
14
|
|
|
|
|
|
|
{ |
15
|
4
|
|
|
4
|
|
38574
|
my ($pack,$file,%opts) = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
## option recsep is not allowed |
18
|
4
|
|
|
|
|
19
|
for my $key (keys %opts) { |
19
|
0
|
0
|
|
|
|
0
|
if ($key =~ /\-?recsep/){ |
20
|
0
|
|
|
|
|
0
|
carp "Option recsep is not accepted by IO::Tie::File::AnyData\nThis will be overrided\n"; |
21
|
0
|
|
|
|
|
0
|
delete $opts{$key}; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $coderef = sub { |
26
|
690
|
|
|
690
|
|
638471
|
my ($fh) = @_; |
27
|
690
|
100
|
|
|
|
4369
|
return undef if eof $fh; |
28
|
612
|
|
|
|
|
1910
|
local $/ = "\n>"; |
29
|
612
|
|
|
|
|
2372
|
my $faseq = <$fh>; |
30
|
612
|
100
|
|
|
|
1098
|
if (eof $fh) { |
31
|
8
|
|
|
|
|
29
|
local $/ = "\n"; |
32
|
8
|
|
|
|
|
24
|
chomp $faseq; |
33
|
|
|
|
|
|
|
} else { |
34
|
604
|
|
|
|
|
797
|
chomp $faseq; |
35
|
|
|
|
|
|
|
} |
36
|
612
|
100
|
|
|
|
8405
|
$faseq = ">$faseq" if $faseq !~ /^>/; |
37
|
612
|
|
|
|
|
3069
|
return "$faseq\n"; |
38
|
4
|
|
|
|
|
29
|
}; |
39
|
|
|
|
|
|
|
|
40
|
4
|
50
|
|
|
|
60
|
carp "Overriding code ref" if (defined $opts{'code'}); |
41
|
4
|
|
|
|
|
21
|
local $/="\n"; |
42
|
4
|
|
|
|
|
20
|
Tie::File::AnyData::TIEARRAY("Tie::File::AnyData",$file,%opts, code => $coderef); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
__END__ |