Bio-Protease
view release on metacpan or search on metacpan
lib/Bio/Protease/Types.pm view on Meta::CPAN
package Bio::Protease::Types;
{
$Bio::Protease::Types::VERSION = '1.112980';
}
# ABSTRACT: Specific types for Bio::Protease
use MooseX::Types::Moose qw(Str ArrayRef RegexpRef Any);
use MooseX::Types -declare => [qw(ProteaseName ProteaseRegex)];
use namespace::autoclean;
use Carp qw(croak);
subtype ProteaseName, as Str;
subtype ProteaseRegex, as ArrayRef;
coerce ProteaseRegex,
from Str, via { _str_to_prot_regex($_) },
from RegexpRef, via { [ $_ ] };
coerce ProteaseName,
from Any, via { 'custom' };
sub _str_to_prot_regex {
my $specificity = shift;
my $specificity_of = Bio::Protease->Specificities;
croak "Not a known specificity\n"
unless $specificity ~~ %$specificity_of;
return $specificity_of->{$specificity};
}
__PACKAGE__->meta->make_immutable;
__END__
=pod
=head1 NAME
Bio::Protease::Types - Specific types for Bio::Protease
=head1 VERSION
version 1.112980
=head1 DESCRIPTION
This module defines specific types and type coercions to be used by
L<Bio::Protease>. It should not be used by end users or consumer of the
Bio::ProteaseI role.
=head1 AUTHOR
Bruno Vecchi <vecchi.b gmail.com>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Bruno Vecchi.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 1.200 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )