SequenceSimilarity {SynExtend} | R Documentation

## Return a numeric value that represents the similarity between two aligned sequences as determined by a provided subsitution matrix.

### Description

Takes in a `DNAStringSet` or `AAStringSet` representing a pairwise alignment and a subsitution matrix such as those present in `PFASUM`, and return a numeric value representing sequence similarity as defined by the substitution matrix.

### Usage

    SequenceSimilarity(Seqs,
                       SubMat,
                       penalizeGapLetter = TRUE,
                       includeTerminalGaps = TRUE,
                       allowNegative = TRUE)

### Arguments

`Seqs` | A `DNAStringSet` or `AAStringSet` of length 2.
`SubMat` | A named matrix representing a substitution matrix. If left “NULL” and “Seqs” is a `AAStringSet`, the 40th “PFASUM” matrix is used. If left “NULL” and “Seqs” is a `DNAStringSet`, a matrix with only the diagonal filled with “1”'s is used.
`penalizeGapLetter` | A logical indicating whether or not to penalize Gap-Letter matches. Defaults to “TRUE”.
`includeTerminalGaps` | A logical indicating whether or not to penalize terminal matches. Defaults to “TRUE”.
`allowNegative` | A logical indicating whether or not allow negative scores. Defaults to “TRUE”. If “FALSE” scores that are returned as less than zero are converted to zero.

### Details

Takes in a `DNAStringSet` or `AAStringSet` representing a pairwise alignment and a subsitution matrix such as those present in `PFASUM`, and return a numeric value representing sequence similarity as defined by the substitution matrix.

### Value

Returns a single numeric.

### Author(s)

Erik Wright ESWRIGHT@pitt.edu Nicholas Cooley npc19@pitt.edu

### See Also

`AlignSeqs`, `AlignProfiles`, `AlignTranslation`, `DistanceMatrix`

### Examples

    db <- system.file("extdata", "Bacteria_175seqs.sqlite", package="DECIPHER")
    dna <- SearchDB(db, remove="all")
    alignedDNA <- AlignSeqs(dna[1:2])

    DNAPlaceholder <- diag(15)
    dimnames(DNAPlaceholder) <- list(DNA_ALPHABET[1:15],
                                     DNA_ALPHABET[1:15])

    SequenceSimilarity(Seqs = alignedDNA,
                       SubMat = DNAPlaceholder,
                       includeTerminalGaps = TRUE,
                       penalizeGapLetter = TRUE,
                       allowNegative = TRUE)

[Package SynExtend version 1.6.0 Index]