line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bio::Tools::EUtilities::Link::LinkSet; |
2
|
|
|
|
|
|
|
$Bio::Tools::EUtilities::Link::LinkSet::VERSION = '1.76'; |
3
|
7
|
|
|
7
|
|
40
|
use utf8; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
30
|
|
4
|
7
|
|
|
7
|
|
169
|
use strict; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
99
|
|
5
|
7
|
|
|
7
|
|
27
|
use warnings; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
146
|
|
6
|
7
|
|
|
7
|
|
27
|
use base qw(Bio::Root::Root Bio::Tools::EUtilities::HistoryI); |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
3104
|
|
7
|
7
|
|
|
7
|
|
2745
|
use Bio::Tools::EUtilities::Link::UrlLink; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
177
|
|
8
|
7
|
|
|
7
|
|
2892
|
use Bio::Tools::EUtilities::Info::LinkInfo; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
12872
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: Class for EUtils LinkSets. |
11
|
|
|
|
|
|
|
# AUTHOR: Chris Fields |
12
|
|
|
|
|
|
|
# OWNER: 2006-2013 Chris Fields |
13
|
|
|
|
|
|
|
# LICENSE: Perl_5 |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new { |
17
|
50
|
|
|
50
|
1
|
619
|
my ($class,@args) = @_; |
18
|
50
|
|
|
|
|
200
|
my $self = $class->SUPER::new(@args); |
19
|
50
|
|
|
|
|
1215
|
my ($type) = $self->_rearrange([qw(DATATYPE)],@args); |
20
|
50
|
|
50
|
|
|
1228
|
$type ||= 'linkset'; |
21
|
50
|
|
|
|
|
191
|
$self->eutil('elink'); |
22
|
50
|
|
|
|
|
142
|
$self->datatype($type); |
23
|
50
|
|
|
|
|
111
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub get_ids { |
28
|
102
|
|
|
102
|
1
|
984
|
my $self = shift; |
29
|
102
|
100
|
|
|
|
206
|
unless ($self->{'_sorted_id'}) { |
30
|
50
|
|
|
|
|
120
|
@{$self->{'_sorted_id'}} = |
31
|
|
|
|
|
|
|
sort { |
32
|
|
|
|
|
|
|
$self->{'_id'}->{$a}->[0] <=> |
33
|
31
|
|
|
|
|
53
|
$self->{'_id'}->{$b}->[0] |
34
|
50
|
|
|
|
|
64
|
} keys %{$self->{'_id'}}; |
|
50
|
|
|
|
|
138
|
|
35
|
|
|
|
|
|
|
} |
36
|
102
|
|
|
|
|
128
|
return @{$self->{'_sorted_id'}}; |
|
102
|
|
|
|
|
366
|
|
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub get_database { |
41
|
0
|
|
|
0
|
1
|
0
|
return ($_[0]->get_databases)[0]; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub get_db { |
46
|
0
|
|
|
0
|
1
|
0
|
return shift->get_database; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub get_dbto { |
51
|
0
|
|
|
0
|
1
|
0
|
return shift->get_database; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub get_databases { |
56
|
167
|
|
|
167
|
1
|
7645
|
my $self = shift; |
57
|
167
|
|
|
|
|
205
|
my %tmp; |
58
|
328
|
|
|
|
|
485
|
my @dbs = sort map {$_->get_database} |
59
|
167
|
|
|
|
|
280
|
grep {!$tmp{$_->get_database}++} ($self->get_LinkInfo); |
|
488
|
|
|
|
|
817
|
|
60
|
167
|
100
|
66
|
|
|
561
|
unshift @dbs, $self->{'_dbto'} if $self->{'_dbto'} && !$tmp{$self->{'_dbto'}}++; |
61
|
167
|
|
|
|
|
573
|
return @dbs; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub get_dbs { |
66
|
0
|
|
|
0
|
1
|
0
|
return shift->get_databases; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
26
|
|
|
26
|
1
|
109
|
sub get_dbfrom { return shift->{'_dbfrom'} } |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub get_link_names { |
74
|
26
|
|
|
26
|
1
|
73
|
my ($self) = shift; |
75
|
26
|
|
|
|
|
48
|
my %tmps; |
76
|
|
|
|
|
|
|
my @lns; |
77
|
26
|
100
|
|
|
|
78
|
if ($self->{'_linkname'}) { |
78
|
10
|
|
|
|
|
19
|
push @lns, $self->{'_linkname'}; |
79
|
10
|
|
|
|
|
28
|
$tmps{$self->{'_linkname'}}++; |
80
|
|
|
|
|
|
|
} |
81
|
26
|
|
|
|
|
71
|
push @lns, map {$_->get_link_name} $self->get_LinkInfo; |
|
54
|
|
|
|
|
105
|
|
82
|
26
|
|
|
|
|
146
|
return @lns; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub get_link_name { |
87
|
0
|
|
|
0
|
1
|
0
|
return ($_[0]->get_link_names)[0]; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub get_submitted_ids { |
92
|
26
|
|
|
26
|
1
|
55
|
my $self = shift; |
93
|
26
|
|
|
|
|
84
|
my $datatype = $self->datatype; |
94
|
26
|
100
|
100
|
|
|
130
|
if ($datatype eq 'idcheck' || $datatype eq 'urllink') { |
|
|
50
|
|
|
|
|
|
95
|
16
|
|
|
|
|
40
|
return $self->get_ids; |
96
|
|
|
|
|
|
|
} elsif ($self->{'_submitted_ids'}) { |
97
|
10
|
|
|
|
|
16
|
return @{$self->{'_submitted_ids'}}; |
|
10
|
|
|
|
|
56
|
|
98
|
|
|
|
|
|
|
} else { |
99
|
0
|
|
|
|
|
0
|
return (); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub has_scores { |
105
|
28
|
|
|
28
|
1
|
56
|
my $self = shift; |
106
|
28
|
100
|
|
|
|
128
|
return exists $self->{'_has_scores'} ? 1 : 0; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub get_scores { |
111
|
2
|
|
|
2
|
1
|
4
|
my $self = shift; |
112
|
|
|
|
|
|
|
# do we want to cache this or generate only when needed? Likely won't be |
113
|
|
|
|
|
|
|
# called more than once... |
114
|
2
|
50
|
|
|
|
5
|
return unless $self->has_scores; |
115
|
2
|
|
|
|
|
3
|
my %scores = map {$_ => $self->{'_id'}->{$_}->[1]} keys %{$self->{'_id'}}; |
|
12
|
|
|
|
|
25
|
|
|
2
|
|
|
|
|
6
|
|
116
|
2
|
|
|
|
|
13
|
return %scores; |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub get_score_by_id { |
121
|
0
|
|
|
0
|
1
|
0
|
my ($self, $id) = @_; |
122
|
0
|
0
|
0
|
|
|
0
|
($id && exists $self->{'_id'}->{$id}) ? return $self->{'_id'}->{$id}->[1] : |
123
|
|
|
|
|
|
|
return; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
sub has_linkout { |
128
|
26
|
|
|
26
|
1
|
56
|
my $self = shift; |
129
|
26
|
100
|
|
|
|
75
|
if (exists $self->{'_haslinkout'}) { |
130
|
4
|
100
|
|
|
|
16
|
return $self->{'_haslinkout'} eq 'Y' ? 1 : 0; |
131
|
|
|
|
|
|
|
} else { |
132
|
22
|
100
|
|
|
|
54
|
return (grep {$_ eq 'LinkOut'} $self->get_databases) ? 1 : 0; |
|
46
|
|
|
|
|
132
|
|
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
sub has_neighbor { |
138
|
26
|
|
|
26
|
1
|
54
|
my $self = shift; |
139
|
26
|
100
|
|
|
|
70
|
if (exists $self->{'_hasneighbor'}) { |
140
|
4
|
50
|
|
|
|
20
|
return $self->{'_hasneighbor'} eq 'Y' ? 1 : 0; |
141
|
|
|
|
|
|
|
} else { |
142
|
22
|
|
|
|
|
97
|
return 0; |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
sub next_UrlLink { |
148
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
149
|
0
|
0
|
|
|
|
0
|
unless ($self->{"_urllinks_it"}) { |
150
|
0
|
|
|
|
|
0
|
my @ul = $self->get_UrlLinks; |
151
|
0
|
|
|
0
|
|
0
|
$self->{"_urllinks_it"} = sub {return shift @ul} |
152
|
0
|
|
|
|
|
0
|
} |
153
|
0
|
|
|
|
|
0
|
$self->{'_urllinks_it'}->(); |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
sub get_UrlLinks { |
158
|
26
|
|
|
26
|
1
|
10278
|
my $self = shift; |
159
|
26
|
100
|
|
|
|
96
|
return ref $self->{'_urllinks'} ? @{ $self->{'_urllinks'} } : return; |
|
2
|
|
|
|
|
7
|
|
160
|
|
|
|
|
|
|
} |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
sub next_LinkInfo { |
164
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
165
|
0
|
0
|
|
|
|
0
|
unless ($self->{"_linkinfo_it"}) { |
166
|
0
|
|
|
|
|
0
|
my @li = $self->get_LinkInfo; |
167
|
0
|
|
|
0
|
|
0
|
$self->{"_linkinfo_it"} = sub {return shift @li} |
168
|
0
|
|
|
|
|
0
|
} |
169
|
0
|
|
|
|
|
0
|
$self->{'_linkinfo_it'}->(); |
170
|
|
|
|
|
|
|
} |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
sub get_LinkInfo { |
174
|
219
|
|
|
219
|
1
|
6717
|
my $self = shift; |
175
|
219
|
100
|
|
|
|
564
|
return ref $self->{'_linkinfo'} ? @{ $self->{'_linkinfo'} } : return (); |
|
42
|
|
|
|
|
100
|
|
176
|
|
|
|
|
|
|
} |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
{ |
180
|
|
|
|
|
|
|
my %VALID_DATA = ('linkinfo' => 'linkinfo', |
181
|
|
|
|
|
|
|
'linkinfos' => 'linkinfo', |
182
|
|
|
|
|
|
|
'urllinks' => 'urllinks'); |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
sub rewind { |
185
|
0
|
|
|
0
|
1
|
0
|
my ($self, $arg) = @_; |
186
|
0
|
|
0
|
|
|
0
|
$arg ||= 'all'; |
187
|
0
|
0
|
|
|
|
0
|
if (exists $VALID_DATA{$arg}) { |
|
|
0
|
|
|
|
|
|
188
|
0
|
|
|
|
|
0
|
delete $self->{'_'.$arg.'_it'}; |
189
|
|
|
|
|
|
|
} elsif ($arg eq 'all') { |
190
|
0
|
|
|
|
|
0
|
delete $self->{'_'.$_.'_it'} for values %VALID_DATA; |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
} |
193
|
|
|
|
|
|
|
} |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
# private methods and handlers |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
{ |
198
|
|
|
|
|
|
|
my %DATA_HANDLER = ( |
199
|
|
|
|
|
|
|
'IdList' => \&_add_submitted_ids, |
200
|
|
|
|
|
|
|
'Id' => \&_add_retrieved_ids, |
201
|
|
|
|
|
|
|
'LinkInfo' => \&_add_linkinfo, |
202
|
|
|
|
|
|
|
'Link' => \&_add_retrieved_ids, |
203
|
|
|
|
|
|
|
'ObjUrl' => \&_add_objurls, |
204
|
|
|
|
|
|
|
); |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
sub _add_data { |
207
|
50
|
|
|
50
|
|
81
|
my ($self, $data) = @_; |
208
|
50
|
|
|
|
|
89
|
for my $key (qw(IdList Link Id ObjUrl LinkInfo)) { |
209
|
250
|
100
|
|
|
|
454
|
next if !exists $data->{$key}; |
210
|
58
|
|
|
|
|
83
|
my $handler = $DATA_HANDLER{$key}; |
211
|
58
|
|
|
|
|
131
|
$self->$handler($data); |
212
|
58
|
|
|
|
|
177
|
delete $data->{$key}; |
213
|
|
|
|
|
|
|
} |
214
|
|
|
|
|
|
|
# map the rest |
215
|
50
|
100
|
100
|
|
|
132
|
if ($self->datatype eq 'idcheck' && exists $data->{content}) { |
216
|
16
|
|
|
|
|
29
|
%{$self->{'_id'} } = ($data->{content} => [1]); |
|
16
|
|
|
|
|
53
|
|
217
|
|
|
|
|
|
|
delete $data->{content} |
218
|
16
|
|
|
|
|
30
|
} |
219
|
50
|
|
|
|
|
117
|
map {$self->{'_'.lc $_} = $data->{$_}} keys %$data; |
|
120
|
|
|
|
|
349
|
|
220
|
|
|
|
|
|
|
} |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
sub _add_submitted_ids { |
225
|
18
|
|
|
18
|
|
31
|
my ($self, $data) = @_; |
226
|
18
|
50
|
|
|
|
36
|
if (exists $data->{IdList}->{Id}) { |
227
|
18
|
|
|
|
|
25
|
@{$self->{'_submitted_ids'}} = @{$data->{IdList}->{Id}} ; |
|
18
|
|
|
|
|
44
|
|
|
18
|
|
|
|
|
32
|
|
228
|
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
} |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
sub _add_retrieved_ids { |
232
|
26
|
|
|
26
|
|
43
|
my ($self, $data) = @_; |
233
|
|
|
|
|
|
|
# map all IDs to deal with possible scores |
234
|
|
|
|
|
|
|
# ID => {'count' = POSITION, 'score' => SCORE} |
235
|
26
|
100
|
|
|
|
65
|
if (exists $data->{Link}) { |
|
|
50
|
|
|
|
|
|
236
|
10
|
|
|
|
|
11
|
my $ct = 0; |
237
|
10
|
|
|
|
|
11
|
for my $link (@{$data->{Link}}) { |
|
10
|
|
|
|
|
18
|
|
238
|
26
|
100
|
|
|
|
52
|
if (exists $link->{Score}) { |
239
|
12
|
|
|
|
|
13
|
$self->{'_has_scores'}++; |
240
|
12
|
|
|
|
|
29
|
$self->{'_id'}->{$link->{Id}->[0]} = [ $ct++,$link->{Score}]; |
241
|
|
|
|
|
|
|
} else { |
242
|
14
|
|
|
|
|
39
|
$self->{'_id'}->{$link->{Id}->[0]} = [ $ct++ ]; |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
} |
245
|
|
|
|
|
|
|
} |
246
|
|
|
|
|
|
|
elsif (exists $data->{Id}) { # urls |
247
|
16
|
|
|
|
|
59
|
%{$self->{'_id'} } = ($data->{Id}->[0] => [1]); |
|
16
|
|
|
|
|
45
|
|
248
|
|
|
|
|
|
|
} |
249
|
|
|
|
|
|
|
} |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
sub _add_objurls { |
252
|
6
|
|
|
6
|
|
9
|
my ($self, $data) = @_; |
253
|
6
|
|
|
|
|
7
|
for my $urldata (@{$data->{ObjUrl}}) { |
|
6
|
|
|
|
|
12
|
|
254
|
6
|
50
|
|
|
|
14
|
$urldata->{dbfrom} = $data->{DbFrom} if exists $data->{DbFrom}; |
255
|
6
|
|
|
|
|
14
|
my $obj = Bio::Tools::EUtilities::Link::UrlLink->new(-eutil => 'elink', |
256
|
|
|
|
|
|
|
-datatype => 'urldata', |
257
|
|
|
|
|
|
|
-verbose => $self->verbose |
258
|
|
|
|
|
|
|
); |
259
|
6
|
|
|
|
|
164
|
$obj->_add_data($urldata); |
260
|
6
|
|
|
|
|
10
|
push @{$self->{'_urllinks'}}, $obj; |
|
6
|
|
|
|
|
17
|
|
261
|
|
|
|
|
|
|
} |
262
|
|
|
|
|
|
|
} |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
sub _add_linkinfo { |
265
|
8
|
|
|
8
|
|
14
|
my ($self, $data) = @_; |
266
|
8
|
|
|
|
|
10
|
for my $linkinfo (@{$data->{LinkInfo}}) { |
|
8
|
|
|
|
|
18
|
|
267
|
116
|
50
|
|
|
|
235
|
$linkinfo->{dbfrom} = $data->{DbFrom} if exists $data->{DbFrom}; |
268
|
116
|
|
|
|
|
219
|
my $obj = Bio::Tools::EUtilities::Info::LinkInfo->new(-eutil => 'elink', |
269
|
|
|
|
|
|
|
-datatype => 'linkinfo', |
270
|
|
|
|
|
|
|
-verbose => $self->verbose |
271
|
|
|
|
|
|
|
); |
272
|
116
|
|
|
|
|
264
|
$obj->_add_data($linkinfo); |
273
|
116
|
|
|
|
|
175
|
push @{$self->{'_linkinfo'}}, $obj; |
|
116
|
|
|
|
|
234
|
|
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
} |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
sub to_string { |
279
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
280
|
0
|
|
0
|
|
|
|
my $level = shift || 0; |
281
|
0
|
|
|
|
|
|
my $pad = 20 - $level; |
282
|
|
|
|
|
|
|
# order method name |
283
|
0
|
|
|
|
|
|
my %tags = (1 => ['get_databases' => 'DB'], |
284
|
|
|
|
|
|
|
2 => ['get_ids' => 'ID'], |
285
|
|
|
|
|
|
|
3 => ['get_link_names' => 'Link Names'], |
286
|
|
|
|
|
|
|
5 => ['get_submitted_ids' => 'Submitted IDs'], |
287
|
|
|
|
|
|
|
6 => ['has_scores' => 'Scores?'], |
288
|
|
|
|
|
|
|
7 => ['has_linkout' => 'LinkOut?'], |
289
|
|
|
|
|
|
|
8 => ['has_neighbor' => 'DB Neighbors?'], |
290
|
|
|
|
|
|
|
9 => ['get_webenv' => 'WebEnv'], |
291
|
|
|
|
|
|
|
10 => ['get_query_key' => 'Key'], |
292
|
|
|
|
|
|
|
); |
293
|
0
|
|
|
|
|
|
my $string; |
294
|
0
|
|
|
|
|
|
for my $tag (sort {$a <=> $b} keys %tags) { |
|
0
|
|
|
|
|
|
|
295
|
0
|
|
|
|
|
|
my ($m, $nm) = (@{$tags{$tag}}[0..1]); |
|
0
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
# using this awkward little construct to deal with both lists and scalars |
297
|
0
|
|
|
|
|
|
my @content = grep {defined $_} $self->$m(); |
|
0
|
|
|
|
|
|
|
298
|
0
|
0
|
|
|
|
|
next unless @content; |
299
|
0
|
|
|
|
|
|
$string .= $self->_text_wrap( |
300
|
|
|
|
|
|
|
sprintf("%-*s%-*s:",$level, '',$pad, $nm,), |
301
|
|
|
|
|
|
|
' ' x ($pad).':', |
302
|
|
|
|
|
|
|
join(', ',@content))."\n"; |
303
|
|
|
|
|
|
|
} |
304
|
0
|
|
|
|
|
|
while (my $li = $self->next_LinkInfo) { |
305
|
0
|
|
|
|
|
|
$string .= $li->to_string(4); |
306
|
|
|
|
|
|
|
} |
307
|
0
|
|
|
|
|
|
while (my $ui = $self->next_UrlLink) { |
308
|
0
|
|
|
|
|
|
$string .= $ui->to_string(4); |
309
|
|
|
|
|
|
|
} |
310
|
0
|
0
|
|
|
|
|
if ($self->has_scores) { |
311
|
0
|
|
|
|
|
|
$string .= "Scores:\n"; |
312
|
0
|
|
|
|
|
|
my %scores = $self->get_scores; |
313
|
0
|
|
|
|
|
|
$string .= sprintf("%-*s%-*s%s\n", |
314
|
|
|
|
|
|
|
$level + 4, '', |
315
|
|
|
|
|
|
|
$pad - 4, 'ID', 'Score' |
316
|
|
|
|
|
|
|
); |
317
|
0
|
|
|
|
|
|
for my $id ($self->get_ids) { |
318
|
|
|
|
|
|
|
$string .= sprintf("%-*s%-*s%s\n", |
319
|
|
|
|
|
|
|
$level + 4, '', |
320
|
0
|
|
|
|
|
|
$pad - 4, $id, $scores{$id} |
321
|
|
|
|
|
|
|
); |
322
|
|
|
|
|
|
|
} |
323
|
|
|
|
|
|
|
} |
324
|
0
|
|
|
|
|
|
$string .= "\n"; |
325
|
0
|
|
|
|
|
|
return $string; |
326
|
|
|
|
|
|
|
} |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
1; |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
__END__ |