smith_waterman_misaligned {text.alignment} | R Documentation |
Extract misaligned elements
Description
Extract misaligned elements from the Smith-Waterman alignment, namely
before_alignment: Sections in a or b which were occurring before the alignment
wrong_alignment: Sections in a or b which were mismatched in the alignment
after_alignment: Sections in a or b which were occurring after the alignment
Usage
smith_waterman_misaligned(x, type = c("a", "b"))
Arguments
x |
an object of class |
type |
either 'a' or 'b' indicating to return elements misaligned from |
Value
a list of character vectors of misaligned elements
before_alignment: Sections in a or b which were occurring before the alignment
wrong_alignment: Sections in a or b which were mismatched in the alignment
after_alignment: Sections in a or b which were occurring after the alignment
combined: The combination of
before_alignment
,wrong_alignment
andafter_alignment
partial: Logical, where TRUE indicates that there is at least a partial alignment and FALSE indicating no alignment between
a
andb
was done (alignment score of 0)
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")