Skip to contents

The Kimura's 2-parameter (K80) distance distinguishes between transitions and transversions. It is calculated as \(-\frac{1}{2} \ln\left(\left(1 - 2p - q\right) \times \sqrt{1 - 2q}\right)\), where \(p\) is the probability of transition and \(q\) is the probability of transversion. See the Wikipedia for more details.

Usage

K80_distance(m)

Arguments

m

A matrix of counts or probabilities for bases of the target genome to be aligned to bases on the query genome. As a convenience it can also receive a list produced by the readTrainFile() function, containing this matrix.

Value

Returns a numeric value show the evolutionary distance between two genomes. the larger the value, the more different the two genomes are.

References

Kimura, M. (1980). "A simple method for estimating evolutionary rates of base substitutions through comparative studies of nucleotide sequences." Journal of Molecular Evolution, 16, 111–120. DOI: 10.1007/BF01731581

Author

Zikun Yang

Examples

K80_distance(exampleSubstitutionMatrix)
#> [1] 0.2789688