Transition probability models (skbio.sequence.transition)#

This module provides functions for calculating transition probability matrices (TPMs, a.k.a. substitution probability matrices) under different substitution models for a specified evolutionary distance (expected number of substitutions per site, which is often represented as branch length in a phylogenetic tree).

A TPM gives the probability that each ancestral state (rows) is observed as each descendant state (columns) after the specified evolutionary distance. For continuous-time Markov models, the TPM is obtained from the instantaneous rate matrix, \(Q\), as \(P(t) = e^{Qt}\). Each row of the matrix sums to one.

Models differ in the assumptions they make about instantaneous substitution rates and equilibrium state frequencies, resulting in different sets of model parameters.

Transition probability matrices#

jc69

Calculate the JC69 transition probability matrix for a given distance.

k2p

Calculate the K2P transition probability matrix for a given distance.

f81

Calculate the F81 transition probability matrix for a given distance.

hky85

Calculate the HKY85 transition probability matrix for a given distance.

tn93

Calculate the TN93 transition probability matrix for a given distance.