| dist.alignment {seqinr} | R Documentation |
These functions compute a matrix of pairwise distances from aligned sequences using similarity (Fitch matrix, for protein sequences only) or identity matrix (for protein and DNA sequences). The resulting matrix contains the squared root of the pairwise distances. For example, if identity between 2 sequences is 80 the squared root of (1.0 - 0.8) i.e. 0.4472136.
dist.alignment(x, matrix = c("similarity", "identity"))
x |
an object of class alignment, as returned by
read.alignment for instance |
matrix |
the matrix distance to be used, partial matching allowed |
The distance matrix, object of class dist, computed by using the
specified distance measure.
D. Charif and J.R. Lobry
The reference for the similarity matrix is :
Fitch, W.M. (1966) Mutation values for the interconversion of amino acid pair.
J. Mol. Biol., 16:9-16.
citation("seqinr")
myseqs <- read.alignment(file = system.file("sequences/test.mase",
package = "seqinr"), format = "mase")
dist.alignment(myseqs, matrix = "identity" )
as.matrix(dist.alignment(myseqs, matrix = "identity" ))