skbio.sequence.transition.k2p#
- skbio.sequence.transition.k2p(d, kappa, seqtype='DNA')[source]#
Calculate the K2P transition probability matrix for a given distance.
Added in version 0.7.4.
The Kimura 2-parameter (K2P, a.k.a. K80) model assumes separate rates for transitions \((A \leftrightarrow G, C \leftrightarrow T/U)\) and transversions (all other changes of substitutions), with a fixed transition/transversion rate ratio \(\kappa\).
The transition probabilities between nucleotide states for sequences separated by evolutionary distance \(d\) are given by:
\[\begin{split}\begin{aligned} &P_{no\, change} = \frac{1}{4} + \frac{1}{4} e^{\frac{-4d}{3}} + \frac{1}{2} e^{\frac{-2(\kappa + 1)d}{3}} \\ &P_{transition} = \frac{1}{4} + \frac{1}{4} e^{\frac{-4d}{3}} - \frac{1}{2} e^{\frac{-2(\kappa + 1)d}{3}} \\ &P_{transversion} = \frac{1}{4} - \frac{1}{4} e^{\frac{-4d}{3}} \end{aligned}\end{split}\]Where \(\kappa\) is ratio between transition and transversion rates.
- Parameters:
- dfloat
distance or distances between sequences.
- kappafloat
ratio between transition and transversion rates
- seqtypestr
String that holds type of the sequence. “DNA” (default) and “RNA” are valid options. Needed to assign proper nucleotide letters to SubstitutionMatrix dimensions.
- Returns:
- SubstitutionMatrix
Transition probability matrix. Rows are ancestral nucleotides, columns are descendant nucleotides.
Notes
The Kimura 2-parameter model (K2P or K80) was originally described in [1].
K2P is an extension of the JC69 model by modeling differential transition and transversion rates. Meanwhile, K2P can be considered as a special case of the F84 model by assuming equal base frequencies.
References
[1]Kimura, M. (1980). A simple method for estimating evolutionary rates of base substitutions through comparative studies of nucleotide sequences. Journal of Molecular Evolution, 16(2), 111-120.