Implementation of the Needleman-Wunsch algorithm in Tyescript, based on SeqAlign.
Install
npm install sequence-align
Example usage:
import { Aligner, SeqNode, AlignType } from 'sequence-align'
const aligner = new Aligner<string>(AlignType.Global)
const nodes1: Sequence<string> = [
new SeqNode('n1', [40]),
new SeqNode('n2', [45]),
new SeqNode('n3', [50]),
new SeqNode('n4', [55])
]
const nodes2: Sequence<string> = [
new SeqNode('n1', [40]),
new SeqNode('n3', [50]),
new SeqNode('n4', [55])
]
aligner.align(nodes1, nodes2, {
gapOpen: -2,
gapExt: -1
})
const result = aligner.retrieveAlignments()
console.log(result)