getAffineAlignObj: Creates affine alignment object

Description Usage Arguments Value Examples

Description

This function calculates three matrices for affine gap alignment using input similarity matrix and affine gap opening and gap closing penalties. An implementation of Needleman-Wunsch alignment and overlap alignment is also provided. All three matrices are clubbed together in an output S4 object.

Usage

1
getAffineAlignObj(s, go, ge, FreeEndGaps = TRUE)

Arguments

s

A numeric matrix

go

A numeric value

ge

A numeric value

FreeEndGaps

A logical scalar

Value

A S4 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
M = 10; MM = -2; go = 22; ge = 7
seq1 = "GCAT"
seq2 = "CAGTG"
s = matrix(NA, nrow = nchar(seq1), ncol= nchar(seq2))
for(i in 1:nrow(s)){
   for(j in 1: ncol(s)){
       if(substr(seq1, start = i, stop = i) == substr(seq2, start = j, stop = j)) s[i,j] <- M
       else s[i,j] <- MM
   }
}
alignObj <- getAffineAlignObj(s, go, ge, FreeEndGaps=FALSE)

shubham1637/DIAlignR documentation built on May 8, 2019, 8:12 a.m.