line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bio::Tools::EUtilities::Summary::DocSum; |
2
|
|
|
|
|
|
|
$Bio::Tools::EUtilities::Summary::DocSum::VERSION = '1.77'; |
3
|
1
|
|
|
1
|
|
7
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
4
|
1
|
|
|
1
|
|
30
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
18
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
6
|
1
|
|
|
1
|
|
7
|
use base qw(Bio::Root::Root Bio::Tools::EUtilities::Summary::ItemContainerI); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
635
|
|
7
|
1
|
|
|
1
|
|
556
|
use Bio::Tools::EUtilities::Summary::Item; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
461
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Data object for document summary data from esummary. |
10
|
|
|
|
|
|
|
# AUTHOR: Chris Fields |
11
|
|
|
|
|
|
|
# OWNER: 2006-2013 Chris Fields |
12
|
|
|
|
|
|
|
# LICENSE: Perl_5 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new { |
17
|
7
|
|
|
7
|
1
|
112
|
my ($class, @args) = @_; |
18
|
7
|
|
|
|
|
37
|
my $self = $class->SUPER::new(@args); |
19
|
7
|
|
|
|
|
240
|
my ($type) = $self->_rearrange(['DATATYPE'],@args); |
20
|
7
|
|
50
|
|
|
188
|
$type ||= 'docsum'; |
21
|
7
|
|
|
|
|
33
|
$self->eutil('esummary'); |
22
|
7
|
|
|
|
|
27
|
$self->datatype($type); |
23
|
7
|
|
|
|
|
17
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub get_ids { |
28
|
2
|
|
|
2
|
1
|
8
|
my $self = shift; |
29
|
2
|
50
|
|
|
|
18
|
return wantarray ? $self->{'_id'} : [$self->{'_id'}]; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub get_id { |
34
|
9
|
|
|
9
|
1
|
2364
|
my $self = shift; |
35
|
9
|
|
|
|
|
30
|
return $self->{'_id'}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub rewind { |
48
|
0
|
|
|
0
|
1
|
0
|
my ($self, $request) = @_; |
49
|
0
|
0
|
0
|
|
|
0
|
if ($request && $request eq 'all') { |
50
|
0
|
|
|
|
|
0
|
map {$_->rewind('all') } $self->get_Items; |
|
0
|
|
|
|
|
0
|
|
51
|
|
|
|
|
|
|
} |
52
|
0
|
|
|
|
|
0
|
delete $self->{"_items_it"}; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# private EUtilDataI method |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub _add_data { |
58
|
7
|
|
|
7
|
|
17
|
my ($self, $data) = @_; |
59
|
7
|
50
|
|
|
|
19
|
if ($data->{Item}) { |
60
|
7
|
50
|
|
|
|
25
|
$self->{'_id'} = $data->{Id} if exists $data->{Id}; |
61
|
7
|
|
|
|
|
13
|
for my $sd (@{ $data->{Item} } ) { |
|
7
|
|
|
|
|
19
|
|
62
|
64
|
50
|
|
|
|
154
|
$sd->{Id} = $data->{Id} if exists $data->{Id}; |
63
|
64
|
|
|
|
|
175
|
my $subdoc = |
64
|
|
|
|
|
|
|
Bio::Tools::EUtilities::Summary::Item->new(-datatype => 'item', |
65
|
|
|
|
|
|
|
-verbose => $self->verbose); |
66
|
64
|
|
|
|
|
179
|
$subdoc->_add_data($sd); |
67
|
64
|
|
|
|
|
87
|
push @{ $self->{'_items'} }, $subdoc; |
|
64
|
|
|
|
|
171
|
|
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
} |
70
|
7
|
50
|
|
|
|
26
|
$self->{'_id'} = $data->{Id} if exists $data->{Id}; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub to_string { |
75
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
76
|
0
|
|
|
|
|
|
my $string = sprintf("%-20s%s\n",'UID', ':'.$self->get_id); |
77
|
0
|
|
|
|
|
|
while (my $item = $self->next_Item) { |
78
|
0
|
|
|
|
|
|
$string .= $item->to_string; |
79
|
|
|
|
|
|
|
} |
80
|
0
|
|
|
|
|
|
return $string; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
__END__ |