Smith-Waterman local aligner
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin minor updates Oct 29, 2015
swalign fixed xrange to range, StringIO to io.StringIO Jul 18, 2018
.gitignore updated repo - added doc for global align Dec 11, 2012
CHANGES.txt updated to v0.3 Nov 21, 2012
LICENSE minor updates Oct 29, 2015 initial commit Oct 30, 2012 docs Nov 19, 2013 version bump Apr 27, 2017


This package implements a Smith-Waterman style local alignment algorithm. You can align a query sequence to a reference. The scoring functions can be based on a matrix, or simple identity. Weights can be adjusted for match/mismatch and gaps, with gap extention penalties. Additionally, the gap penalty can be subject to a decay to prioritize long gaps.

The input files are FASTA format sequences, or strings of sequences.

Here is some skeleton code to get you started:

import swalign
# choose your own values here… 2 and -1 are common.
match = 2
mismatch = -1
scoring = swalign.NucleotideScoringMatrix(match, mismatch)

sw = swalign.LocalAlignment(scoring)  # you can also choose gap penalties, etc...
alignment = sw.align('ACACACTA','AGCACACA')

For other uses, see the script in bin/swalign.