traceBack: Function to trace back

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/traceBack.R

Description

Function computes an optimal global or local alignment based on a trace back matrix as provided by function stringDist or stringSim.

Usage

1
traceBack(D, global = TRUE)

Arguments

D

object of class "stringDist"

global

logical, global or local alignment

Details

Computes one possible optimal global or local alignment based on the trace back matrix saved in an object of class "stringDist" or "stringSim".

Value

matrix: pairwise global/local alignment

Note

The function is mainly for teaching purposes.

For distances between strings and string alignments see Bioconductor package Biostrings.

Author(s)

Matthias Kohl [email protected]

References

R. Merkl and S. Waack (2009). Bioinformatik Interaktiv. Wiley.

See Also

stringDist

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
x <- "GACGGATTATG"
y <- "GATCGGAATAG"

## Levenshtein distance
d <- stringDist(x, y)
## optimal global alignment
traceBack(d)

## Optimal global alignment score
d <- stringSim(x, y)
## optimal global alignment
traceBack(d)

## Optimal local alignment score
d <- stringSim(x, y, global = FALSE)
## optimal local alignment
traceBack(d, global = FALSE)

stamats/MKmisc documentation built on Nov. 10, 2018, 11:24 a.m.