Phylo/Models/Substitution/Dna/K80.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 33 CC 3 SCAR 18.4
CC
3
Cov
0%
get_rate
12.0
get_nst
2.0
BEGIN
2.0
CRAP 6.3
1 package Bio::Phylo::Models::Substitution::Dna::K80;
2 use strict;
3 use warnings;
4 use base 'Bio::Phylo::Models::Substitution::Dna::JC69';
5 my %purines = ( 'A' => 1, 'G' => 1 );
6  
7 =head1 NAME
8  
9 Bio::Phylo::Models::Substitution::Dna::K80 - Kimura 2-parameter
10  
11 =head1 DESCRIPTION
12  
13 See L<Bio::Phylo::Models::Substitution::Dna>
14  
15 =head1 METHODS
16  
17 =over
18  
19 =item get_nst
20  
21 Getter for number of transition rate parameters.
22  
23 Type : method
24 Title : get_nst
25 Usage : $model->get_nst;
26 Function: Getter for number of transition rate parameters.
27 Returns : scalar
28 Args : None.
29  
30 =cut
31  
32 sub get_nst { 2 }
33  
34 =item get_rate
35  
36 Getter for substitution rate. If bases are given as arguments,
37 returns corresponding rate. If no arguments given, returns rate matrix or
38 overall rate, dependent on model.
39  
40 Type : method
41 Title : get_rate
42 Usage : $model->get_rate('A', 'C');
43 Function: Getter for transition rate between nucleotides.
44 Returns : scalar or array
45 Args : Optional:
46 base1: scalar
47 base2: scalar
48  
49 =cut
50  
51 # subst rate
52 sub get_rate {
53 my $self = shift;
54 if ( scalar @_ == 2 ) {
55 my ( $src, $trgt ) = ( uc $_[0], uc $_[1] );
56  
57 # transversion
58 if ( $purines{$src} xor $purines{$trgt} ) {
59 return $self->get_kappa;
60 }
61  
62 # transition
63 else {
64 return 1;
65 }
66 }
67 }
68  
69 =back
70  
71 =head1 SEE ALSO
72  
73 There is a mailing list at L<https://groups.google.com/forum/#!forum/bio-phylo>
74 for any user or developer questions and discussions.
75  
76 =over
77  
78 =item L<Bio::Phylo::Manual>
79  
80 Also see the manual: L<Bio::Phylo::Manual> and L<http://rutgervos.blogspot.com>.
81  
82 =back
83  
84 =head1 CITATION
85  
86 If you use Bio::Phylo in published research, please cite it:
87  
88 B<Rutger A Vos>, B<Jason Caravas>, B<Klaas Hartmann>, B<Mark A Jensen>
89 and B<Chase Miller>, 2011. Bio::Phylo - phyloinformatic analysis using Perl.
90 I<BMC Bioinformatics> B<12>:63.
91 L<http://dx.doi.org/10.1186/1471-2105-12-63>
92  
93 =cut
94  
95 1;