smith_waterman_misaligned {text.alignment}R Documentation

Extract misaligned elements

Description

Extract misaligned elements from the Smith-Waterman alignment, namely

Usage

smith_waterman_misaligned(x, type = c("a", "b"))

Arguments

x

an object of class smith_waterman as returned by smith_waterman

type

either 'a' or 'b' indicating to return elements misaligned from a or from b

Value

a list of character vectors of misaligned elements

Examples

sw <- smith_waterman("ab test xy", "cd tesst ab", type = "characters")
sw
misses <- smith_waterman_misaligned(sw, type = "a")
str(misses)
misses <- smith_waterman_misaligned(sw, type = "b")
str(misses)

a <- system.file(package = "text.alignment", "extdata", "example1.txt")
a <- readLines(a)
a <- paste(a, collapse = "\n")
b <- system.file(package = "text.alignment", "extdata", "example2.txt")
b <- readLines(b)
b <- paste(b, collapse = "\n")
sw <- smith_waterman(a, b, type = "characters")
smith_waterman_misaligned(sw, type = "a")
smith_waterman_misaligned(sw, type = "b")

[Package text.alignment version 0.1.4 Index]