line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bio::FastParsers::Blast::Xml::Iteration; |
2
|
|
|
|
|
|
|
# ABSTRACT: NCBI BLAST DTD-derived internal class |
3
|
|
|
|
|
|
|
$Bio::FastParsers::Blast::Xml::Iteration::VERSION = '0.201110'; |
4
|
7
|
|
|
7
|
|
4423
|
use Moose; |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
163
|
|
5
|
7
|
|
|
7
|
|
46443
|
use namespace::autoclean; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
50
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# AUTOGENERATED CODE! DO NOT MODIFY THIS FILE! |
8
|
|
|
|
|
|
|
|
9
|
7
|
|
|
7
|
|
638
|
use XML::Bare qw(forcearray); |
|
7
|
|
|
|
|
19
|
|
|
7
|
|
|
|
|
403
|
|
10
|
|
|
|
|
|
|
|
11
|
7
|
|
|
7
|
|
47
|
use aliased 'Bio::FastParsers::Blast::Xml::Hit'; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
91
|
|
12
|
7
|
|
|
7
|
|
846
|
use aliased 'Bio::FastParsers::Blast::Xml::Statistics'; |
|
7
|
|
|
|
|
19
|
|
|
7
|
|
|
|
|
42
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# private attributes |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has '_root' => ( |
18
|
|
|
|
|
|
|
is => 'ro', |
19
|
|
|
|
|
|
|
isa => 'HashRef', |
20
|
|
|
|
|
|
|
required => 1, |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# public array(s) of composed objects |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
has 'hits' => ( |
28
|
|
|
|
|
|
|
traits => ['Array'], |
29
|
|
|
|
|
|
|
is => 'ro', |
30
|
|
|
|
|
|
|
isa => 'ArrayRef[Bio::FastParsers::Blast::Xml::Hit]', |
31
|
|
|
|
|
|
|
init_arg => undef, |
32
|
|
|
|
|
|
|
lazy => 1, |
33
|
|
|
|
|
|
|
builder => '_build_hits', |
34
|
|
|
|
|
|
|
handles => { |
35
|
|
|
|
|
|
|
count_hits => 'count', |
36
|
|
|
|
|
|
|
all_hits => 'elements', |
37
|
|
|
|
|
|
|
get_hit => 'get', |
38
|
|
|
|
|
|
|
next_hit => 'shift', |
39
|
|
|
|
|
|
|
}, |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
## no critic (ProhibitUnusedPrivateSubroutines) |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub _build_hits { |
45
|
6
|
|
|
6
|
|
14
|
my $self = shift; |
46
|
44
|
|
|
|
|
1490
|
return [ map { Hit->new( _root => $_ ) } @{ |
47
|
6
|
|
|
|
|
13
|
forcearray $self->_root->{'Iteration_hits'}->{'Hit'} |
|
6
|
|
|
|
|
210
|
|
48
|
|
|
|
|
|
|
} ]; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
## use critic |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# public composed object(s) |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
has 'stat' => ( |
59
|
|
|
|
|
|
|
is => 'ro', |
60
|
|
|
|
|
|
|
isa => 'Bio::FastParsers::Blast::Xml::Statistics', |
61
|
|
|
|
|
|
|
init_arg => undef, |
62
|
|
|
|
|
|
|
lazy => 1, |
63
|
|
|
|
|
|
|
builder => '_build_stat', |
64
|
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
## no critic (ProhibitUnusedPrivateSubroutines) |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub _build_stat { |
69
|
0
|
|
|
0
|
|
|
my $self = shift; |
70
|
|
|
|
|
|
|
return Statistics->new( |
71
|
0
|
|
|
|
|
|
_root => $self->_root->{'Iteration_stat'}->{'Statistics'} |
72
|
|
|
|
|
|
|
); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
# use critic |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# public methods |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub iter_num { |
82
|
0
|
|
|
0
|
1
|
|
return shift->_root->{'Iteration_iter-num'}->{'value'} |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub message { |
87
|
0
|
|
|
0
|
1
|
|
return shift->_root->{'Iteration_message'}->{'value'} |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub query_def { |
92
|
0
|
|
|
0
|
1
|
|
return shift->_root->{'Iteration_query-def'}->{'value'} |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub query_id { |
97
|
0
|
|
|
0
|
1
|
|
return shift->_root->{'Iteration_query-ID'}->{'value'} |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub query_len { |
102
|
0
|
|
|
0
|
1
|
|
return shift->_root->{'Iteration_query-len'}->{'value'} |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
# public aliases |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub statistics { |
110
|
|
|
|
|
|
|
return shift->stat |
111
|
0
|
|
|
0
|
1
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub num { |
115
|
|
|
|
|
|
|
return shift->iter_num |
116
|
0
|
|
|
0
|
1
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
120
|
|
|
|
|
|
|
1; |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
__END__ |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=pod |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 NAME |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
Bio::FastParsers::Blast::Xml::Iteration - NCBI BLAST DTD-derived internal class |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head1 VERSION |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
version 0.201110 |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head1 SYNOPSIS |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
# see Bio::FastParsers::Blast::Xml |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head1 DESCRIPTION |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
This class implements the C<Iteration> level of the XML BLAST parser. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head2 hits |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
ArrayRef of L<Bio::FastParsers::Blast::Xml::Hit> |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=head2 stat |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
L<Bio::FastParsers::Blast::Xml::Statistics> composed object |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head1 METHODS |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head2 count_hits |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
Returns the number of Hits of the Iteration. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
# $iteration is a Bio::FastParsers::Blast::Xml::Iteration |
159
|
|
|
|
|
|
|
my $count = $iteration->count_hits; |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
This method does not accept any arguments. |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=head2 all_hits |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
Returns all the Hits of the Iteration (not an array reference). |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
# $iteration is a Bio::FastParsers::Blast::Xml::Iteration |
168
|
|
|
|
|
|
|
my @hits = $iteration->all_hits; |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
This method does not accept any arguments. |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=head2 get_hit |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
Returns one Hit of the Iteration by its index. You can also use |
175
|
|
|
|
|
|
|
negative index numbers, just as with Perl's core array handling. If the |
176
|
|
|
|
|
|
|
specified Hit does not exist, this method will return C<undef>. |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
# $iteration is a Bio::FastParsers::Blast::Xml::Iteration |
179
|
|
|
|
|
|
|
my $hit = $iteration->get_hit($index); |
180
|
|
|
|
|
|
|
croak "Hit $index not found!" unless defined $hit; |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
This method accepts just one argument (and not an array slice). |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=head2 next_hit |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
Shifts the first Hit of the array off and returns it, shortening the |
187
|
|
|
|
|
|
|
array by 1 and moving everything down. If there are no more Hits in |
188
|
|
|
|
|
|
|
the array, returns C<undef>. |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
# $iteration is a Bio::FastParsers::Blast::Xml::Iteration |
191
|
|
|
|
|
|
|
while (my $hit = $iteration->next_hit) { |
192
|
|
|
|
|
|
|
# process $hit |
193
|
|
|
|
|
|
|
# ... |
194
|
|
|
|
|
|
|
} |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
This method does not accept any arguments. |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=head2 iter_num |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
Returns the value of the element C<<Iteration_iter-num>>. |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
# $iteration is a Bio::FastParsers::Blast::Xml::Iteration |
203
|
|
|
|
|
|
|
my $iter_num = $iteration->iter_num; |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
This method does not accept any arguments. |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
=head2 message |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
Returns the value of the element C<<Iteration_message>>. |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
# $iteration is a Bio::FastParsers::Blast::Xml::Iteration |
212
|
|
|
|
|
|
|
my $message = $iteration->message; |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
This method does not accept any arguments. |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=head2 query_def |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
Returns the value of the element C<<Iteration_query-def>>. |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
# $iteration is a Bio::FastParsers::Blast::Xml::Iteration |
221
|
|
|
|
|
|
|
my $query_def = $iteration->query_def; |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
This method does not accept any arguments. |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=head2 query_id |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
Returns the value of the element C<<Iteration_query-ID>>. |
228
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
# $iteration is a Bio::FastParsers::Blast::Xml::Iteration |
230
|
|
|
|
|
|
|
my $query_id = $iteration->query_id; |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
This method does not accept any arguments. |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=head2 query_len |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
Returns the value of the element C<<Iteration_query-len>>. |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
# $iteration is a Bio::FastParsers::Blast::Xml::Iteration |
239
|
|
|
|
|
|
|
my $query_len = $iteration->query_len; |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
This method does not accept any arguments. |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
=head1 ALIASES |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
=head2 statistics |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
Alias for C<stat> method. For API consistency. |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
=head2 num |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
Alias for C<iter_num> method. For API consistency. |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
=head1 AUTHOR |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
Denis BAURAIN <denis.baurain@uliege.be> |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
This software is copyright (c) 2013 by University of Liege / Unit of Eukaryotic Phylogenomics / Denis BAURAIN. |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
262
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=cut |