| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Bio::Phylo::Parsers::Table; |
|
2
|
1
|
|
|
1
|
|
61252
|
use strict; |
|
|
1
|
|
|
|
|
16
|
|
|
|
1
|
|
|
|
|
42
|
|
|
3
|
1
|
|
|
1
|
|
9
|
use base 'Bio::Phylo::Parsers::Abstract'; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
445
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Bio::Phylo::Parsers::Table - Parser used by Bio::Phylo::IO, no serviceable parts inside |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
This module is used to import data and taxa from plain text files or strings. |
|
12
|
|
|
|
|
|
|
The following additional argument must be used in the call |
|
13
|
|
|
|
|
|
|
to L: |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
-type => (one of [DNA|RNA|STANDARD|PROTEIN|NUCLEOTIDE|CONTINUOUS]) |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
In addition, these arguments may be used to indicate line separators (default |
|
18
|
|
|
|
|
|
|
is "\n") and field separators (default is "\t"): |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
-fieldsep => '\t', |
|
21
|
|
|
|
|
|
|
-linesep => '\n' |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub _parse { |
|
26
|
2
|
|
|
2
|
|
5
|
my $self = shift; |
|
27
|
2
|
|
|
|
|
11
|
my $fh = $self->_handle; |
|
28
|
2
|
|
|
|
|
8
|
my $fac = $self->_factory; |
|
29
|
2
|
|
|
|
|
9
|
my $type = $self->_args->{'-type'}; |
|
30
|
2
|
|
100
|
|
|
7
|
local $/ = $self->_args->{'-linesep'} || "\n"; |
|
31
|
2
|
|
100
|
|
|
6
|
my $sep = $self->_args->{'-fieldsep'} || "\t"; |
|
32
|
2
|
|
|
|
|
36
|
my $regex = qr/$sep/; |
|
33
|
2
|
|
|
|
|
16
|
my $matrix = $fac->create_matrix( '-type' => $type ); |
|
34
|
2
|
|
|
|
|
12
|
while (<$fh>) { |
|
35
|
14
|
|
|
|
|
29
|
chomp; |
|
36
|
14
|
|
|
|
|
81
|
my ( $name, @char ) = split $regex, $_; |
|
37
|
14
|
|
|
|
|
86
|
$matrix->insert( |
|
38
|
|
|
|
|
|
|
$fac->create_datum( |
|
39
|
|
|
|
|
|
|
'-type' => $type, |
|
40
|
|
|
|
|
|
|
'-name' => $name, |
|
41
|
|
|
|
|
|
|
'-char' => \@char, |
|
42
|
|
|
|
|
|
|
) |
|
43
|
|
|
|
|
|
|
); |
|
44
|
|
|
|
|
|
|
} |
|
45
|
2
|
|
|
|
|
20
|
return $matrix; |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# podinherit_insert_token |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
There is a mailing list at L |
|
53
|
|
|
|
|
|
|
for any user or developer questions and discussions. |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=over |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=item L |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
The table parser is called by the L object. |
|
60
|
|
|
|
|
|
|
Look there to learn how to parse tab- (or otherwise) delimited matrices. |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=item L |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Also see the manual: L and L |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=back |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 CITATION |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
If you use Bio::Phylo in published research, please cite it: |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
B, B, B, B |
|
73
|
|
|
|
|
|
|
and B, 2011. Bio::Phylo - phyloinformatic analysis using Perl. |
|
74
|
|
|
|
|
|
|
I B<12>:63. |
|
75
|
|
|
|
|
|
|
L |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |