nw.sg: Semi-global Needleman-Wunsch.

Description Usage Arguments Value Examples

Description

Simple function using Rcpp to compute semi-global Needleman-Wunsch score. The first sequence is short, the second long.

Usage

1
2
3
nw.sg(short, long, S, g)
nws.sg(short, long, S, g)
qnw.sg(short, long)

Arguments

short

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

long

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

S

a scoring matrix (nw.sq) reshaped as vector or a short vector (nws.sq) 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.

j

Endpoint of short sequence in long sequence.

Examples

1
2
3
4
5
short <- char2int("ACTCCTCTAAGAG")
long <- char2int("ACTATATCGGCGCACCCTATAAGAGCACGCGAGA")
nw.sg(short[[1]], long[[1]], c(1,-1,-1,-1,-1,1,-1,-1,-1,-1,1,-1,-1,-1,-1,1), -1)
nws.sg(short[[1]], long[[1]], c(1,-1), -1)
qnw.sg(short[[1]], long[[1]])

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