lib/Bio/MUST/Core/GeneticCode.pm

filter: Statementstmt 100% 28 / 28 Branchbran n/a Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 7 / 7 Podpod 100% 1 / 1 totaltotal 92.6% 38 / 41 CC 2 SCAR 2.2
CC
2
Cov
97%
translate
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« lib/Bio/MUST/Core/Taxonomy/MooseNCBI.pm ↑ Summary lib/Bio/MUST/Core.pm »
1 package Bio::MUST::Core::GeneticCode;
2 # ABSTRACT: Genetic code for conceptual translation
3 18 $Bio::MUST::Core::GeneticCode::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 Bio::MUST::Core::Constants qw(:gaps);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 18 ▶use aliased 'Bio::MUST::Core::Seq';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13  
14 18 has 'ncbi_id' => (
15 is => 'ro',
16 isa => 'Str',
17 required => 1,
18 );
19  
20 # _code private hash for translation
21 18 has '_code' => (
22 traits => ['Hash'],
23 is => 'ro',
24 isa => 'HashRef[Str]',
25 required => 1,
26 handles => {
27 aa_for => 'get',
28 amino_acid_for => 'get',
29 },
30 );
31  
32  
33  
34 5 ▶sub translate { ## no critic (RequireArgUnpacking)
Subroutine translate: called CC=2 SCAR=7.0
Pod documented
35 5 my $self = shift;
36 5 my $seq = shift;
37  
38 return Seq->new(
39 seq_id => $seq->full_id, # clone seq_id
40 seq => join q{}, map {
41 1491 ▶ $self->aa_for(uc $_) // $FRAMESHIFT
Condition66%2/3
$self->aa_for(uc $_) // $Bio::MUST::Core::GeneticCode::FRAMESHIFT
l!l&&r!l&&!r
148290
MC/DC0%0/2
$self->aa_for(uc $_) // $Bio::MUST::Core::GeneticCode::FRAMESHIFT
$self->aa_for(uc $_) $Bio::MUST::Core::GeneticCode::FRAMESHIFT
Truth table66%2/3
A // B
A= $self->aa_for(uc $_)B= $Bio::MUST::Core::GeneticCode::FRAMESHIFT
ABresult
1X1
011
000
42 5 } @{ $seq->codons(@_) }
43 ); # specify frame through currying
44 }
45  
46 18 __PACKAGE__->meta->make_immutable;
47 18 1;
48  
49 __END__
« lib/Bio/MUST/Core/Taxonomy/MooseNCBI.pm ↑ Summary lib/Bio/MUST/Core.pm »