| 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
| |||||||||||
| 29 | unless $specificity ~~ %$specificity_of; | ||||||||||
| 30 | |||||||||||
| 31 | 0 | return $specificity_of->{$specificity}; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | __PACKAGE__->meta->make_immutable; | ||||||||||
| 35 | |||||||||||
| 36 | |||||||||||
| 37 | __END__ | ||||||||||