1.0.1 • Published 2 years ago

sequence-align v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

sequence-align

Implementation of the Needleman-Wunsch algorithm in Tyescript, based on SeqAlign.

How to use

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)