skbio.sequence.transition.hky85#

skbio.sequence.transition.hky85(d, freqs, kappa, seqtype='DNA', dtype='float32')[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

Evolutionary distance between sequences.

freqsarray_like of float of shape (4,)

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

kappafloat

Ratio between transition and transversion rates. Should be between 0 and 1.

seqtype{‘DNA’, ‘RNA’}, optional

Sequence type. Used to label matrix states as nucleotides (A, C, G, T/U). Default is “DNA”.

dtypestr or dtype, optional

Floating-point data type of the transition probability matrix. Options are “float32” (default) and “float64”.

Returns:
SubstitutionMatrix

Transition probability matrix. Rows are ancestral nucleotides, columns are descendant nucleotides.

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.