line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bio::Tools::EUtilities::Summary; |
2
|
|
|
|
|
|
|
$Bio::Tools::EUtilities::Summary::VERSION = '1.77'; |
3
|
1
|
|
|
1
|
|
648
|
use utf8; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
32
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
19
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
6
|
1
|
|
|
1
|
|
587
|
use Bio::Tools::EUtilities::Summary::DocSum; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
55
|
|
7
|
1
|
|
|
1
|
|
8
|
use base qw(Bio::Tools::EUtilities Bio::Tools::EUtilities::EUtilDataI); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
392
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Class for handling data output (XML) from esummary. |
10
|
|
|
|
|
|
|
# AUTHOR: Chris Fields |
11
|
|
|
|
|
|
|
# OWNER: 2006-2013 Chris Fields |
12
|
|
|
|
|
|
|
# LICENSE: Perl_5 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# private EUtilDataI method |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _add_data { |
18
|
2
|
|
|
2
|
|
7
|
my ($self, $data) = @_; |
19
|
2
|
50
|
|
|
|
9
|
if (!exists $data->{DocSum}) { |
20
|
0
|
|
|
|
|
0
|
$self->warn('No returned docsums.'); |
21
|
0
|
|
|
|
|
0
|
return; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
2
|
|
|
|
|
4
|
my @docs; |
25
|
2
|
|
|
|
|
6
|
for my $docsum (@{ $data->{DocSum} }) { |
|
2
|
|
|
|
|
10
|
|
26
|
7
|
|
|
|
|
27
|
my $ds = Bio::Tools::EUtilities::Summary::DocSum->new(-datatype => 'docsum', |
27
|
|
|
|
|
|
|
-verbose => $self->verbose); |
28
|
7
|
|
|
|
|
25
|
$ds->_add_data($docsum); |
29
|
7
|
|
|
|
|
10
|
push @{ $self->{'_docsums'} }, $ds; |
|
7
|
|
|
|
|
44
|
|
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub to_string { |
35
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
36
|
0
|
|
0
|
|
|
|
my %data = ( |
37
|
|
|
|
|
|
|
'DB' => [1, join(', ',$self->get_databases) || ''], |
38
|
|
|
|
|
|
|
); |
39
|
0
|
|
|
|
|
|
my $string = $self->SUPER::to_string."\n"; |
40
|
0
|
|
|
|
|
|
for my $k (sort {$data{$a}->[0] <=> $data{$b}->[0]} keys %data) { |
|
0
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
$string .= sprintf("%-20s:%s\n\n",$k, $self->_text_wrap('',' 'x 20 .':', $data{$k}->[1])); |
42
|
|
|
|
|
|
|
} |
43
|
0
|
|
|
|
|
|
while (my $ds = $self->next_DocSum) { |
44
|
0
|
|
|
|
|
|
$string .= $ds->to_string."\n"; |
45
|
|
|
|
|
|
|
} |
46
|
0
|
|
|
|
|
|
return $string; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
__END__ |