This function compares two codons and returns the number of syn and non-syn sites according to Nei and Gojobori (1986).

compareCodons(codA, codB)

Arguments

codA

codon A [mandatory]

codB

codon B [mandatory]

Value

vector of syn and non-syn sites

References

Nei and Gojobori. (1986) Simple methods for estimating the numbers of synonymous and nonsynonymous nucleotide substitutions. Mol. Biol. Evol., 3(5), 418-426.

Ganeshan et al. (1997) Human immunodeficiency virus type 1 genetic evolution in children with different rates of development of disease. J. Virology. 71(1), 663-677.

Yang et al. (2000) Codon-substitution models for heterogeneous selection pressure at amino acid sites. Genetics. 155(1), 431-449.

See also

Author

Kristian K Ullrich

Examples

compareCodons("AAA","TTA")
#> [1] 0 2 0
compareCodons("AAA","TAT")
#> [1] 0 2 0
compareCodons("AAA","ATT")
#> [1] 0.5 1.5 0.0
compareCodons("AAA","TTT")
#> [1] 0.1666667 2.8333333 0.0000000
## load example sequence data
data("hiv", package="MSA2dist")
compareCodons(dnastring2codonmat(hiv)[1,1], dnastring2codonmat(hiv)[1,2])
#> [1] 0 1 0