nw: Needleman-Wunsch.

Description Usage Arguments Value Examples

Description

Simple function using Rcpp to compute Needleman-Wunsch score.

Usage

1
2
3
nw(seq1, seq2, S, g)
nws(seq1, seq2, S, g)
qnw(seq1, seq2)

Arguments

seq1

an integer vector coding "ACGT" as c(0,1,2,3).

seq2

an integer vector coding "ACGT" as c(0,1,2,3).

S

a scoring matrix (nw) reshaped as vector or a short vector (nws) based on the scoring matrix (quicker) (see examples).

g

an integer vector holding the gap penalty.

Value

D

Score value of pairwise comparison.

L

Length of pairwise alignment.

Examples

1
2
3
4
5
seq1 <- char2int("ACTCCTCTAAGAG")
seq2 <- char2int("ACCCTATAAGAGC")
nw(seq1[[1]], seq2[[1]], c(1,-1,-1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,-1,-1,1), -1)
nws(seq1[[1]], seq2[[1]], c(1,-1), -1)
qnw(seq1[[1]], seq2[[1]])

needleman.wunsch documentation built on May 2, 2019, 4:43 p.m.