Hamming distance after Needlman-Wunsch alignment.

Description

This function performs a Needleman-Wunsch alignment between two sequences, and then counts the number of mismatches and indels in that alignment. End gaps are not included in this count.

Usage

1
nwhamming(s1, s2, ...)

Arguments

s1

(Required). character(1). The first sequence to align. A/C/G/T only.

s2

(Required). character(1). The second sequence to align. A/C/G/T only.

...

(Optional). Further arguments to pass on to nwalign.

Value

integer(1). The total number of mismatches and gaps, excluding gaps at the beginning and end of the alignment.

Examples

1
2
3
4
 sq1 <- "CTAATACATGCAAGTCGAGCGAGTCTGCCTTGAAGATCGGAGTGCTTGCACTCTGTGAAACAAGATA"
 sq2 <- "TTAACACATGCAAGTCGAACGGAAAGGCCAGTGCTTGCACTGGTACTCGAGTGGCGAACGGGTGAGT"
nwhamming(sq1, sq2)
nwhamming(sq1, sq2, band=16)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.