Does anyone know of any general-purpose semiglobal alignment tools? Something like BLAST for semiglobal alignments instead of local alignments.
A semiglobal alignment is like a global alignment, but penalty-free gaps are allowed at the beginning and end of the alignment. See Wikipedia for a bit more information on semiglobal alignments.
Edit: It has come to my attention that the term "semiglobal alignment" is an ambiguous; it is used to describe several different types of alignment. What I am looking for is a global alignment with no penalty for gaps at the sequence ends.
I want to use ends-free alignment to find all occurrences of a particular sequence in a full lane of Illumina readsI want to mask a short (42 bp) sequence from a lane of paired-end 100 nt Illumina reads. The sequence is expected to occur anywhere within any read with equal probability, including a partial overlap on either end, and if it appears in the middle of a read, it has to be the whole sequence. So I need to do an ends-free alignment of the short sequence against each read independently.
pairwiseAlignment in the Bioconductor package Biostrings does this out of the box:
From the manual:
type - type of alignment. One of "global", "local", "overlap", "global- local", and "local-global" where "global" = align whole strings with end gap penalties, "local" = align string fragments, "overlap" = align whole strings without end gap penalties, "global-local" = align whole strings with end gap penalties on pattern and without end gap penal- ties on subject "local-global" = align whole strings without end gap penalties on pattern and with end gap penalties on subject.
The document Pairwise Sequence Alignments is a tutorial about how to do alignments with R.
Check here where I modified Marcin Cieślik's (modification of my) code to do various alignments including "glocal"--a combination of global and local--that does what you want. it's a python/cython module.
you should be able to install with:
git clone git://github.com/brentp/align.git cd align sudo python setup.py install
and then use as:
>>> from align import aligner >>> aligner('WW','WEWWEW', method='glocal') ('WW', 'WW')
hope that helps.
What exactly do you want to do?