skbio.sequence.transition.hky85#

skbio.sequence.transition.hky85(d, freqs, kappa, seqtype='DNA')[source]#

Calculate the HKY85 transition probability matrix for a given distance.

Added in version 0.7.4.

The Hasegawa, Kishino, and Yano 1985 (HKY85) allows differential base frequencies (\(\pi\)) and assumes fixed ratio \(\kappa\) between rates of transitions (substitutions between two purines or between two pyrimidines) and transversions (substitutions between a purine and a pyrimidine). Transition probability for a nucleotide for sequences with a distance \(d\) between them can be calculated like:

\[P_{ij} = e^{\frac{-(\kappa + 1)d}{2b}}\delta_{ij} + e^{-\frac{d}{b}}\left (1 - e^{\frac{-(\kappa - 1)d}{2b}}\right ) \frac{\pi_j\epsilon_{ij}}{\sum_k \epsilon_{jk}\pi_k} + \left (1 - e^{-\frac{d}{b}}\right )\pi_j\]

Where \(i,j \in \{A, C, G, T/U\}\), \(i\) is ancestral nucleotide, \(j\) is descendant nucleotide, \(\delta_{ij}\) is Kronecker delta function and is 1 if \(i=j\) and 0 otherwise, epsilon_{ij} is purine/pyrimidine indicator function and is 1 if \(i\) and \(j\) in the same nucloetide class and is 0 otherwise. The normalization constant \(b\) is defined as:

\[b = 1 - \pi_A^2 - \pi_C^2 - \pi_G^2 - \pi_T^2\]
Parameters:
dfloat

distance or distances between sequences.

freqsarray_like of float of shape (4,)

Relative frequencies of nucleobases A, C, G, and T/U, respectively. Should sum to 1.

kappa

Transition/transversion rate ratio. Should be \(0 < \kappa \leq 1\).

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.

See also

f81

Notes

The HKY85 model was described in [1]. The transition probability formulas were described in [2].

It is a generalization of F81 that incorporates transition/transversion bias via \(\kappa\). When \(\kappa = 1\), the model reduces to a model without transition/transversion bias and becomes equivalent to F81 under standard normalization.

References

[1]

Hasegawa, M., Kishino, H., & Yano, T. A. (1985). Dating of the human-ape splitting by a molecular clock of mitochondrial DNA. Journal of molecular evolution, 22(2), 160-174.

[2]

Felsenstein, J. (2004). Inferring Phylogenies. 2003. Sinauer Associates, Sunderland, Massachusetts.