Skip to content

Python interface for seq-align C library (with additional no_{start,end}_penalty_{a,b} config)

License

Notifications You must be signed in to change notification settings

Yaakov-Belch/pyseq-align

 
 

Repository files navigation

pyseq-align

Python interface for the seq-align C library, written by Isaac Turner (@noporpoise).

Fork by Yaakov Belch:

I expanded no_start_gap_penalty and no_end_gap_penalty to: no_start_gap_penalty, no_start_gap_penalty_a, no_start_gap_penalty_b, no_end_gap_penalty, no_end_gap_penalty_a, no_end_gap_penalty_b.

The feature no_start_gap_penalty_a seems not to work, but no_start_gap_penalty_b works. The code is 100% symmetric for all these cases, but investigate seq-align/src/alignment.c where the comments say: // Think carefully about which way round these are

The algorithm may not be symmetric.

Installation

pip install pyseq-align

To install directly from GitHub,

git clone https://github.com/Lioscro/pyseq-align.git --recursive
cd pyseq-align
pip install .

Usage

Two alignment algorithms are provided: Needleman-Wunsch and Smith-Waterman.

from pyseq_align import NeedlemanWunsch

nw = NeedlemanWunsch()
al = nw.align('ACGT', 'ACGTC')
print(al.result_a)  # ACGT-
print(al.result_b)  # ACGTC
print(al.score)
from pyseq_align import SmithWaterman

sw = SmithWaterman()
als = sw.align('ACGT', 'ACGTC')  # unlike above, this is a list of Alignment's
for al in als:
    print(al.result_a, al.pos_a)  # ACGT, 0
    print(al.result_b, al.pos_b)  # ACGT, 0
    print(al.score)

About

Python interface for seq-align C library (with additional no_{start,end}_penalty_{a,b} config)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Cython 72.2%
  • Python 25.2%
  • Makefile 2.6%