Learn R Programming

alakazam (version 0.2.2)

getSeqMatrix: Calculate pairwise distances between sequences

Description

getSeqMatrix calculates all pairwise distance between a set of sequences.

Usage

getSeqMatrix(seq, dist_mat = getDNAMatrix(gap = -1))

Arguments

seq
character vector containing a DNA sequences.
dist_mat
Character distance matrix. Defaults to a Hamming distance matrix returned by getDNAMatrix. If gap characters, c("-", "."), are assigned a value of -1 in dist_mat then conti

Value

  • A matrix of numerical distance between each entry in seq. If seq is a named vector, row and columns names will be added accordingly.

See Also

Uses getSeqDistance for calculating distances between pairs. Nucleotide distance matrix may be built with getDNAMatrix. Amino acid distance matrix may be built with getAAMatrix.

Examples

Run this code
# Gaps will be treated as Ns with a gap=0 distance matrix
getSeqMatrix(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
getSeqMatrix(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
getSeqMatrix(c(A="ATGGC", B="ATGGG", C="ATGGG", D="AT--C"), 
             dist_mat=getDNAMatrix(gap=-1))

Run the code above in your browser using DataLab