FastParsers/Blast/Xml.pm

filter: Statementstmt 100% 28 / 28 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 97.3% 37 / 38 CC 3 SCAR 5.6
CC
3
Cov
97%
_build_blast_output
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« FastParsers/Hmmer/Standard/Target.pm ↑ Summary FastParsers/Blast/Xml/Statistics.pm »
1 package Bio::FastParsers::Blast::Xml;
2 # ABSTRACT: Front-end class for XML BLAST parser
3 # CONTRIBUTOR: Aymeric NAOME <aymeric.naome@gmail.com>
4 7 $Bio::FastParsers::Blast::Xml::VERSION = '0.221230';
5 7 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 7 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 7 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 7 ▶use XML::Bare;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 7 extends 'Bio::FastParsers::Base';
12  
13 7 ▶use aliased 'Bio::FastParsers::Blast::Xml::BlastOutput';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 # TODO: check behavior with single iterations, hits or hsps
16  
17 # public attributes (some inherited)
18  
19  
20  
21 7 has 'blast_output' => (
22 is => 'ro',
23 isa => 'Maybe[Bio::FastParsers::Blast::Xml::BlastOutput]',
24 init_arg => undef,
25 lazy => 1,
26 builder => '_build_blast_output',
27 );
28  
29 ## no critic (ProhibitUnusedPrivateSubroutines)
30  
31 7 ▶sub _build_blast_output {
Subroutine _build_blast_output: called CC=3 SCAR=11.0
32 7 my $self = shift;
33  
34 7 my $file = $self->file;
35 7 ▶ my $xb = XML::Bare->new( file => $file )
Branch: 1 branch
BranchTrueFalseTotal
my $xb = "XML::Bare"->new("file", $file) or croak("Can't open '${file}' for reading: $!") 7 0 7
36 or croak "Can't open '$file' for reading: $!";
37  
38 7 my $bo = $xb->parse->{'BlastOutput'};
39 7 ▶ unless ($bo) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($bo) 1 6 7
40 1 carp "Warning: '$file' unexpectedly empty; returning no BlastOutput!";
41 1 return;
42 }
43  
44 6 return BlastOutput->new( _root => $bo, _parent => undef);
45 }
46  
47 ## use critic
48  
49  
50 7 __PACKAGE__->meta->make_immutable;
51 7 1;
52  
53 __END__
« FastParsers/Hmmer/Standard/Target.pm ↑ Summary FastParsers/Blast/Xml/Statistics.pm »