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

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