Skip to contents

The Jukes and Cantor 1969 (JC69) distance is calculated as \(-\frac{3}{4} \ln(1 - \frac{4}{3} p )\), where \(p\) is the sum of the probabilities of the alignment. See the Wikipedia for more details.

Usage

JC69_distance(m, tot = 1, adjust_p = FALSE)

Arguments

m

Two possible types of input are available:

  1. A matrix of counts or probabilities for bases of the target genome to be aligned to bases on the query genome;

  2. The mismatch count (a positive integer) or proportion (a number between 0.0 and 1.0).

tot

The total count of nucleotides, in case the parameter m is the count of mismatches.

adjust_p

A boolean flag. If TRUE, the distance is scaled between 0 and 0.75 to ensure the logarithm stays positive.

Value

Returns a numeric value representing the evolutionary distance between two genomes. The greater the value, the more genetically different the genomes are.

References

Jukes, T.H. & Cantor, C.R. (1969). "Evolution of protein molecules." In Mammalian Protein Metabolism (pp. 21–132). Academic Press.

Author

Zikun Yang

Priscila Biller

Examples

# Using a substitution matrix as input:
d <- JC69_distance(exampleSubstitutionMatrix)

# Using numerical values as input:
d <- JC69_distance(25, 100)