All Projects → lorenzocestaro → seqalign

lorenzocestaro / seqalign

Licence: MIT license
Collection of sequence alignment algorithms.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to seqalign

SneakySnake
SneakySnake🐍 is the first and the only pre-alignment filtering algorithm that works efficiently and fast on modern CPU, FPGA, and GPU architectures. It greatly (by more than two orders of magnitude) expedites sequence alignment calculation for both short and long reads. Described in the Bioinformatics (2020) by Alser et al. https://arxiv.org/abs…
Stars: ✭ 44 (+120%)
Mutual labels:  smith-waterman, needleman-wunsch, sequence-alignment
strutil
Golang metrics for calculating string similarity and other string utility functions
Stars: ✭ 114 (+470%)
Mutual labels:  smith-waterman, string-distance
minineedle
Needleman-Wunsch and Smith-Waterman algorithms in python
Stars: ✭ 27 (+35%)
Mutual labels:  smith-waterman, needleman-wunsch
beda
Beda is a golang library for detecting how similar a two string
Stars: ✭ 34 (+70%)
Mutual labels:  string-distance
Java String Similarity
Implementation of various string similarity and distance algorithms: Levenshtein, Jaro-winkler, n-Gram, Q-Gram, Jaccard index, Longest Common Subsequence edit distance, cosine similarity ...
Stars: ✭ 2,403 (+11915%)
Mutual labels:  string-distance
fuzzywuzzy
Fuzzy string matching for PHP
Stars: ✭ 60 (+200%)
Mutual labels:  string-distance
BioAlignments.jl
Sequence alignment tools
Stars: ✭ 49 (+145%)
Mutual labels:  sequence-alignment
bioseq-js
For live demo, see http://lh3lh3.users.sourceforge.net/bioseq.shtml
Stars: ✭ 34 (+70%)
Mutual labels:  sequence-alignment
diagonalsw
C/C++ implementation of the Smith-Waterman algorithm by using SIMD operations (e.g SSE4.1)
Stars: ✭ 21 (+5%)
Mutual labels:  smith-waterman
RDPTools
Collection of commonly used RDP Tools for easy building
Stars: ✭ 44 (+120%)
Mutual labels:  sequence-alignment
seqalign pathing
Rust implementation of sequence alignment / Levenshtein distance by A* acceleration of the DP algorithm
Stars: ✭ 17 (-15%)
Mutual labels:  sequence-alignment
levenshtein finder
Similar string search in Levenshtein distance
Stars: ✭ 19 (-5%)
Mutual labels:  string-distance
Quickenshtein
Making the quickest and most memory efficient implementation of Levenshtein Distance with SIMD and Threading support
Stars: ✭ 204 (+920%)
Mutual labels:  string-distance
stance
Learned string similarity for entity names using optimal transport.
Stars: ✭ 27 (+35%)
Mutual labels:  string-distance
MA
The Modular Aligner and The Modular SV Caller
Stars: ✭ 39 (+95%)
Mutual labels:  sequence-alignment
kalign
A fast multiple sequence alignment program.
Stars: ✭ 89 (+345%)
Mutual labels:  sequence-alignment
Biopython
Official git repository for Biopython (originally converted from CVS)
Stars: ✭ 2,936 (+14580%)
Mutual labels:  sequence-alignment
deepblast
Neural Networks for Protein Sequence Alignment
Stars: ✭ 29 (+45%)
Mutual labels:  sequence-alignment
stringosim
String similarity functions, String distance's, Jaccard, Levenshtein, Hamming, Jaro-Winkler, Q-grams, N-grams, LCS - Longest Common Subsequence, Cosine similarity...
Stars: ✭ 47 (+135%)
Mutual labels:  string-distance
affinegap
📐 A Cython implementation of the affine gap string distance
Stars: ✭ 57 (+185%)
Mutual labels:  string-distance

seqalign

Collection of sequence alignment algorithms.

Travis (.org) Code Climate coverage Code Climate maintainability npm

Table of contents

Getting started

Install the package from npm:

$ npm install --save seqalign

Import the package in your project:

const { NWaligner, SWaligner } = require('seqalign');

Aligners

SWaligner and NWaligner are factory fucntions, you can create many aligners with different parameters and re-use each one multiple times. An aligner is configurable with the following parameters (all of them are optional):

  • similarityScoreFunction: takes two characters (string) as input and returns a similarity score (integer).
  • gapScoreFunction:
    • Smith-Waterman: takes one positive integer as input (gap length) and returns a score (integer).
    • Needleman-Wunsch: takes no input and returns a constant score used for scoring insertions and deletions in the alignment.
  • gapSymbol: a custom character (string) used to represent gaps in the alignment.

All the listed parameters are accessible from each aligner instance in addition with the following non configurable parameters:

  • directions: enum object used to define direction codes for the traceback matrix.

Defaults

Here are the default values for the aligner options:

// Smith-Waterman.
const similarityScoreFunction = (char1, char2) => (char1 === char2 ? 2 : -1);
const gapScoreFunction = k => -k;

//Needleman-Wunsch.
const similarityScoreFunction = (char1, char2) => (char1 === char2 ? 1 : -2);
const gapScoreFunction = () => -1;

// Common defaults.
const gapSymbol = '-';

Usage

Instantiating SWaligner or NWaligner returns an aligner object which exposes an align method. align accepts the two strings to align as input:

// Smith-Waterman.
const { SWaligner } = require('seqalign');

const defaultAligner = SWaligner();
const customAligner = SWaligner({
  gapScoreFunction: x => x / 2,
  gapSymbol: '~',
})

const defaultResult = defaultAligner.align('insertion', 'deletion');
const customResult = customAligner.align('insertion', 'deletion');

console.log(defaultResult.alignment)
// > ertion
// > e-tion

console.log(customResult.alignment)
// > inse~~rtion
// > ~~~ele~tion
// Needleman-Wunsch.
const { NWaligner } = require('seqalign');

const defaultAligner = NWaligner();
const customAligner = NWaligner({
  inDelScore: -3,
  gapSymbol: '~',
})

const defaultResult = defaultAligner.align('insertion', 'deletion');
const customResult = customAligner.align('insertion', 'deletion');

console.log(defaultResult.alignment)
// > -inse--rtion
// > d---ele-tion

console.log(customResult.alignment)
// > insertion
// > dele~tion

Alignment result

The align method of the aligner instances returns an object with the following properties:

  • score <int>: alignment score.
  • originalSequences Array<str>: original input sequences.
  • alignedSequences Array<str>: aligned sequences.
  • scoringMatrix Array<Array<int>>: alignment scores matrix.
  • tracebackMatrix Array<Array<int>>: alignment traceback directions matrix.
  • coordinateWalk Array<Array<int>>: coordinate walk from the traceback matrix.
  • alignment <str>: printable visual alignment string.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].