lib/Bio/MUST/Core/SeqId/Filter.pm

filter: Statementstmt 100% 31 / 31 Branchbran 66.6% 4 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 95.5% 43 / 45 CC 4 SCAR 8.0
CC
4
Cov
95%
is_allowed
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
« lib/Bio/MUST/Core/Roles/Commentable.pm ↑ Summary lib/Bio/MUST/Core/Roles/Taxable.pm »
1 package Bio::MUST::Core::SeqId::Filter;
2 # ABSTRACT: Helper class for filtering seqs according to SeqId components
3 18 $Bio::MUST::Core::SeqId::Filter::VERSION = '0.252040';
4 18 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 18 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 18 ▶use autodie;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 18 ▶use feature qw(say);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 18 ▶use Smart::Comments '###';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 18 ▶use Bio::MUST::Core::Types;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 18 with 'Bio::MUST::Core::Roles::Filterable';
14  
15  
16 18 has 'component' => (
17 is => 'ro',
18 isa => 'Str',
19 required => 1,
20 );
21  
22  
23  
24 303600 ▶sub is_allowed {
Subroutine is_allowed: called CC=4 SCAR=14.0
Pod documented
25 303600 my $self = shift;
26 303600 my $seq_id = shift;
27  
28 # fetch the right SeqId component (e.g., family)
29 # Note: the trick here is to take a reference then dereference it at once
30 303600 my $component = $seq_id->${\ $self->component };
31 303600 ▶ return undef unless $component; ## no critic (ProhibitExplicitReturnUndef)
Branch: 1 branch
BranchTrueFalseTotal
unless $component 0 303600 303600
32  
33 303600 ▶ return 0 unless $self->is_wanted( $component);
Branch: 1 branch
BranchTrueFalseTotal
unless $self->is_wanted($component) 151800 151800 303600
34 151800 ▶ return 0 if $self->is_unwanted($component);
Branch: 1 branch
BranchTrueFalseTotal
if $self->is_unwanted($component) 0 151800 151800
35 151800 return 1;
36 }
37  
38 18 __PACKAGE__->meta->make_immutable;
39 18 1;
40  
41 __END__
« lib/Bio/MUST/Core/Roles/Commentable.pm ↑ Summary lib/Bio/MUST/Core/Roles/Taxable.pm »