pairwiseDist {alakazam} | R Documentation |
pairwiseDist
calculates all pairwise distance between a set of sequences.
pairwiseDist(seq, dist_mat = getDNAMatrix())
seq |
character vector containing a DNA sequences. |
dist_mat |
Character distance matrix. Defaults to a Hamming distance
matrix returned by getDNAMatrix. If gap
characters, |
A matrix of numerical distance between each entry in seq
.
If seq
is a named vector, row and columns names will be added
accordingly.
Amino acid distance matrix may be built with getAAMatrix. Uses seqDist for calculating distances between pairs. See pairwiseEqual for generating an equivalence matrix.
# Gaps will be treated as Ns with a gap=0 distance matrix
pairwiseDist(c(A="ATGGC", B="ATGGG", C="ATGGG", D="AT--C"),
dist_mat=getDNAMatrix(gap=0))
# Gaps will be treated as universally non-matching characters with gap=1
pairwiseDist(c(A="ATGGC", B="ATGGG", C="ATGGG", D="AT--C"),
dist_mat=getDNAMatrix(gap=1))
# Gaps of any length will be treated as single mismatches with a gap=-1 distance matrix
pairwiseDist(c(A="ATGGC", B="ATGGG", C="ATGGG", D="AT--C"),
dist_mat=getDNAMatrix(gap=-1))