Protease/Types.pm

filter: Statementstmt 75.0% 12 / 16 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 69.5% 16 / 23 CC 2 SCAR 9.8
CC
2
Cov
67%
_str_to_prot_regex
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« ProteaseI.pm ↑ Summary Protease/Role/WithCache.pm »
1 package Bio::Protease::Types;
2 {
3 $Bio::Protease::Types::VERSION = '1.112980';
4 }
5  
6 # ABSTRACT: Specific types for Bio::Protease
7  
8 5 ▶use MooseX::Types::Moose qw(Str ArrayRef RegexpRef Any);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 5 ▶use MooseX::Types -declare => [qw(ProteaseName ProteaseRegex)];
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 5 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 subtype ProteaseName, as Str;
14  
15 subtype ProteaseRegex, as ArrayRef;
16  
17 coerce ProteaseRegex,
18 from Str, via { _str_to_prot_regex($_) },
19 from RegexpRef, via { [ $_ ] };
20  
21 coerce ProteaseName,
22 from Any, via { 'custom' };
23  
24 0 ▶sub _str_to_prot_regex {
Subroutine _str_to_prot_regex: not called CC=2 SCAR=17.9
25 0 my $specificity = shift;
26 0 my $specificity_of = Bio::Protease->Specificities;
27  
28 0 ▶ croak "Not a known specificity\n"
Branch: 1 branch
BranchTrueFalseTotal
unless $specificity ~~ \%$specificity_of 0 0 0
29 unless $specificity ~~ %$specificity_of;
30  
31 0 return $specificity_of->{$specificity};
32 }
33  
34 __PACKAGE__->meta->make_immutable;
35  
36  
37 __END__
« ProteaseI.pm ↑ Summary Protease/Role/WithCache.pm »