FastParsers/Blast/Xml/BlastOutput.pm

filter: Statementstmt 79.5% 35 / 44 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.8% 11 / 19 Podpod 100% 10 / 10 totaltotal 76.7% 56 / 73 CC 1 SCAR 3.5
CC
1
Cov
80%
_build_mbstat
2.0
query_def
2.0
query_id
2.0
CRAP 1.4
« FastParsers/Blast/Xml/Hsp.pm ↑ Summary FastParsers/Hmmer/Standard.pm »
1 package Bio::FastParsers::Blast::Xml::BlastOutput;
2 # ABSTRACT: NCBI BLAST DTD-derived internal class
3 7 $Bio::FastParsers::Blast::Xml::BlastOutput::VERSION = '0.213510';
4 7 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 7 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 # AUTOGENERATED CODE! DO NOT MODIFY THIS FILE!
8  
9 7 ▶use XML::Bare qw(forcearray);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 7 ▶use aliased 'Bio::FastParsers::Blast::Xml::Iteration';
Subroutine BEGIN: called CC=1 SCAR=0.0
12 7 ▶use aliased 'Bio::FastParsers::Blast::Xml::Statistics';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 7 ▶use aliased 'Bio::FastParsers::Blast::Xml::Parameters';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15  
16 # private attributes
17  
18 7 has '_root' => (
19 is => 'ro',
20 isa => 'HashRef',
21 required => 1,
22 );
23  
24 7 has '_parent' => (
25 is => 'ro',
26 isa => 'Maybe[Object]',
27 required => 1,
28 );
29  
30  
31 # public array(s) of composed objects
32  
33  
34 7 has 'iterations' => (
35 traits => ['Array'],
36 is => 'ro',
37 isa => 'ArrayRef[Bio::FastParsers::Blast::Xml::Iteration]',
38 init_arg => undef,
39 lazy => 1,
40 builder => '_build_iterations',
41 handles => {
42 count_iterations => 'count',
43 all_iterations => 'elements',
44 get_iteration => 'get',
45 next_iteration => 'shift',
46 },
47 );
48  
49 ## no critic (ProhibitUnusedPrivateSubroutines)
50  
51 sub _build_iterations {
52 6 ▶ my $self = shift;
Subroutine _build_iterations: called CC=1 SCAR=0.0
53 7 return [ map { Iteration->new( _root => $_, _parent => $self ) } @{
54 6 forcearray $self->_root->{'BlastOutput_iterations'}->{'Iteration'}
55 } ];
56 }
57  
58 ## use critic
59  
60  
61  
62 # public composed object(s)
63  
64  
65 7 has 'mbstat' => (
66 is => 'ro',
67 isa => 'Bio::FastParsers::Blast::Xml::Statistics',
68 init_arg => undef,
69 lazy => 1,
70 builder => '_build_mbstat',
71 );
72  
73 ## no critic (ProhibitUnusedPrivateSubroutines)
74  
75 sub _build_mbstat {
76 0 ▶ my $self = shift;
Subroutine _build_mbstat: not called CC=1 SCAR=6.9
77 return Statistics->new(
78 0 _root => $self->_root->{'BlastOutput_mbstat'}->{'Statistics'},
79 _parent => $self
80 );
81 }
82  
83 # use critic
84  
85  
86 7 has 'param' => (
87 is => 'ro',
88 isa => 'Bio::FastParsers::Blast::Xml::Parameters',
89 init_arg => undef,
90 lazy => 1,
91 builder => '_build_param',
92 );
93  
94 ## no critic (ProhibitUnusedPrivateSubroutines)
95  
96 sub _build_param {
97 5 ▶ my $self = shift;
Subroutine _build_param: called CC=1 SCAR=0.0
98 return Parameters->new(
99 5 _root => $self->_root->{'BlastOutput_param'}->{'Parameters'},
100 _parent => $self
101 );
102 }
103  
104 # use critic
105  
106  
107 # public methods
108  
109  
110 sub db {
111 5 ▶ return shift->_root->{'BlastOutput_db'}->{'value'}
Subroutine db: called CC=1 SCAR=0.0
Pod documented
112 }
113  
114  
115 sub program {
116 5 ▶ return shift->_root->{'BlastOutput_program'}->{'value'}
Subroutine program: called CC=1 SCAR=0.0
Pod documented
117 }
118  
119  
120 sub query_def {
121 0 ▶ return shift->_root->{'BlastOutput_query-def'}->{'value'}
Subroutine query_def: not called CC=1 SCAR=6.9
Pod documented
122 }
123  
124  
125 sub query_id {
126 0 ▶ return shift->_root->{'BlastOutput_query-ID'}->{'value'}
Subroutine query_id: not called CC=1 SCAR=6.9
Pod documented
127 }
128  
129  
130 sub query_len {
131 0 ▶ return shift->_root->{'BlastOutput_query-len'}->{'value'}
Subroutine query_len: not called CC=1 SCAR=6.9
Pod documented
132 }
133  
134  
135 sub query_seq {
136 0 ▶ return shift->_root->{'BlastOutput_query-seq'}->{'value'}
Subroutine query_seq: not called CC=1 SCAR=6.9
Pod documented
137 }
138  
139  
140 sub reference {
141 0 ▶ return shift->_root->{'BlastOutput_reference'}->{'value'}
Subroutine reference: not called CC=1 SCAR=6.9
Pod documented
142 }
143  
144  
145 sub version {
146 0 ▶ return shift->_root->{'BlastOutput_version'}->{'value'}
Subroutine version: not called CC=1 SCAR=6.9
Pod documented
147 }
148  
149  
150 # public aliases
151  
152  
153 sub statistics {
154 return shift->mbstat
155 0 ▶}
Subroutine statistics: not called CC=1 SCAR=6.9
Pod documented
156  
157  
158 sub parameters {
159 return shift->param
160 10 ▶}
Subroutine parameters: called CC=1 SCAR=0.0
Pod documented
161  
162  
163 7 __PACKAGE__->meta->make_immutable;
164 7 1;
165  
166 __END__
167  
168 =pod
169  
170 =head1 NAME
171  
172 Bio::FastParsers::Blast::Xml::BlastOutput - NCBI BLAST DTD-derived internal class
173  
174 =head1 VERSION
175  
176 version 0.213510
177  
178 =head1 SYNOPSIS
179  
180 # see Bio::FastParsers::Blast::Xml
181  
182 =head1 DESCRIPTION
183  
184 This class implements the C<BlastOutput> level of the XML BLAST parser.
185  
186 =head1 ATTRIBUTES
187  
188 =head2 iterations
189  
190 ArrayRef of L<Bio::FastParsers::Blast::Xml::Iteration>
191  
192 =head2 mbstat
193  
194 L<Bio::FastParsers::Blast::Xml::Statistics> composed object
195  
196 =head2 param
197  
198 L<Bio::FastParsers::Blast::Xml::Parameters> composed object
199  
200 =head1 METHODS
201  
202 =head2 count_iterations
203  
204 Returns the number of Iterations of the BlastOutput.
205  
206 # $blast_output is a Bio::FastParsers::Blast::Xml::BlastOutput
207 my $count = $blast_output->count_iterations;
208  
209 This method does not accept any arguments.
210  
211 =head2 all_iterations
212  
213 Returns all the Iterations of the BlastOutput (not an array reference).
214  
215 # $blast_output is a Bio::FastParsers::Blast::Xml::BlastOutput
216 my @iterations = $blast_output->all_iterations;
217  
218 This method does not accept any arguments.
219  
220 =head2 get_iteration
221  
222 Returns one Iteration of the BlastOutput by its index. You can also use
223 negative index numbers, just as with Perl's core array handling. If the
224 specified Iteration does not exist, this method will return C<undef>.
225  
226 # $blast_output is a Bio::FastParsers::Blast::Xml::BlastOutput
227 my $iteration = $blast_output->get_iteration($index);
228 croak "Iteration $index not found!" unless defined $iteration;
229  
230 This method accepts just one argument (and not an array slice).
231  
232 =head2 next_iteration
233  
234 Shifts the first Iteration of the array off and returns it, shortening the
235 array by 1 and moving everything down. If there are no more Iterations in
236 the array, returns C<undef>.
237  
238 # $blast_output is a Bio::FastParsers::Blast::Xml::BlastOutput
239 while (my $iteration = $blast_output->next_iteration) {
240 # process $iteration
241 # ...
242 }
243  
244 This method does not accept any arguments.
245  
246 =head2 db
247  
248 Returns the value of the element C<<BlastOutput_db>>.
249  
250 # $blast_output is a Bio::FastParsers::Blast::Xml::BlastOutput
251 my $db = $blast_output->db;
252  
253 This method does not accept any arguments.
254  
255 =head2 program
256  
257 Returns the value of the element C<<BlastOutput_program>>.
258  
259 # $blast_output is a Bio::FastParsers::Blast::Xml::BlastOutput
260 my $program = $blast_output->program;
261  
262 This method does not accept any arguments.
263  
264 =head2 query_def
265  
266 Returns the value of the element C<<BlastOutput_query-def>>.
267  
268 # $blast_output is a Bio::FastParsers::Blast::Xml::BlastOutput
269 my $query_def = $blast_output->query_def;
270  
271 This method does not accept any arguments.
272  
273 =head2 query_id
274  
275 Returns the value of the element C<<BlastOutput_query-ID>>.
276  
277 # $blast_output is a Bio::FastParsers::Blast::Xml::BlastOutput
278 my $query_id = $blast_output->query_id;
279  
280 This method does not accept any arguments.
281  
282 =head2 query_len
283  
284 Returns the value of the element C<<BlastOutput_query-len>>.
285  
286 # $blast_output is a Bio::FastParsers::Blast::Xml::BlastOutput
287 my $query_len = $blast_output->query_len;
288  
289 This method does not accept any arguments.
290  
291 =head2 query_seq
292  
293 Returns the value of the element C<<BlastOutput_query-seq>>.
294  
295 # $blast_output is a Bio::FastParsers::Blast::Xml::BlastOutput
296 my $query_seq = $blast_output->query_seq;
297  
298 This method does not accept any arguments.
299  
300 =head2 reference
301  
302 Returns the value of the element C<<BlastOutput_reference>>.
303  
304 # $blast_output is a Bio::FastParsers::Blast::Xml::BlastOutput
305 my $reference = $blast_output->reference;
306  
307 This method does not accept any arguments.
308  
309 =head2 version
310  
311 Returns the value of the element C<<BlastOutput_version>>.
312  
313 # $blast_output is a Bio::FastParsers::Blast::Xml::BlastOutput
314 my $version = $blast_output->version;
315  
316 This method does not accept any arguments.
317  
318 =head1 ALIASES
319  
320 =head2 statistics
321  
322 Alias for C<mbstat> method. For API consistency.
323  
324 =head2 parameters
325  
326 Alias for C<param> method. For API consistency.
327  
328 =head1 AUTHOR
329  
330 Denis BAURAIN <denis.baurain@uliege.be>
331  
332 =head1 COPYRIGHT AND LICENSE
333  
334 This software is copyright (c) 2013 by University of Liege / Unit of Eukaryotic Phylogenomics / Denis BAURAIN.
335  
336 This is free software; you can redistribute it and/or modify it under
337 the same terms as the Perl 5 programming language system itself.
338  
339 =cut
« FastParsers/Blast/Xml/Hsp.pm ↑ Summary FastParsers/Hmmer/Standard.pm »