lib/Bio/MUST/Apps/OmpaPa/Hmmer.pm

filter: Statementstmt 100% 35 / 35 Branchbran 100% 6 / 6 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 94.3% 50 / 53 CC 5 SCAR 9.8
CC
5
Cov
98%
collect_hits
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« lib/Bio/MUST/Apps/OmpaPa/Parameters.pm ↑ Summary script/ompa-pa.pl »
1 package Bio::MUST::Apps::OmpaPa::Hmmer;
2 # ABSTRACT: internal class for tabular HMMER parser
3 # CONTRIBUTOR: Amandine BERTRAND <amandine.bertrand@doct.uliege.be>
4 1 $Bio::MUST::Apps::OmpaPa::Hmmer::VERSION = '0.260260';
5 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use autodie;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use feature qw(say);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use Smart::Comments '###';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use List::AllUtils qw(mesh);
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 extends 'Bio::FastParsers::Hmmer::DomTable';
17 1 with 'Bio::MUST::Apps::OmpaPa::Roles::Parsable';
18  
19  
20 4 ▶sub collect_hits {
Subroutine collect_hits: called CC=5 SCAR=16.1
Pod undocumented
21 4 my $self = shift;
22  
23 4 my @hits;
24  
25 # parse HMMER report
26 HIT:
27 4 ▶ while (my $hit = $self->next_hit) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $hit = $self->next_hit) 749 3 752
28  
29 # honor --max-hits limit
30 749 ▶ if (@hits >= $self->max_hits) {
Branch: 1 branch
BranchTrueFalseTotal
if (@hits >= $self->max_hits) 1 748 749
31 1 carp 'Reached --max-hits limit; truncating report!';
32 1 last HIT;
33 }
34  
35 748 ▶ if ($hit->rank == 1) {
Branch: 1 branch
BranchTrueFalseTotal
if ($hit->rank == 1) 736 12 748
36  
37 # collect useful hit attributes
38 736 ▶ push @hits, {
Condition50%1/2
$hit->target_description // "none"
l!l
0736
MC/DC0%0/1
$hit->target_description // "none"
$hit->target_description
Truth table50%1/2
A
A= $hit->target_description
Aresult
11
00
39 'acc' => $hit->target_name,
40 'dsc' => $hit->target_description // 'none',
41 'exp' => $hit->evalue,
42 'bit' => $hit->score,
43 'qlen' => $hit->qlen,
44 'len' => $hit->tlen,
45 'hmm_from' => $hit->hmm_from,
46 'hmm_to' => $hit->hmm_to,
47 };
48 }
49 }
50  
51 4 return \@hits;
52 }
53  
54 1 __PACKAGE__->meta->make_immutable;
55 1 1;
56  
57 __END__
« lib/Bio/MUST/Apps/OmpaPa/Parameters.pm ↑ Summary script/ompa-pa.pl »