Computes the best pairwise local alignment using the Smith-Waterman algorithm.
An Align object that stores the alignment. The number of rows must be 2 and the sequences must have already been set.
Horizontal gapped sequence in alignment matrix.
Vertical gapped sequence in alignment matrix.
String of Fragment objects. The sequence with id
The scoring scheme to use for the alignment. Note that the user is responsible for ensuring that the scoring scheme is compatible with
Optional lower diagonal.
Optional upper diagonal.
The Waterman-Eggert algorithm (local alignment with declumping) is available through the LocalAlignmentEnumerator class.
When using Gaps and Align objects, only parts (i.e. one infix) of each sequence will be aligned. This will be presented to the user by setting the clipping begin and end position of the gaps (the rows in the case of Align objects). When using Fragment strings, these parts of the sequences will not appear in any fragment.
There exist multiple overloads for this function with two configuration dimensions.
First, you can select the type of the target storing the alignment. This can be either an Align object, two Gaps objects, or a string of Fragment objects. Align objects provide an interface to tabular alignments with the restriction of all rows having the same type. Using two Gaps objects has the advantage that you an align sequences with different types, for example DnaString and Dna5String. Using Fragment strings is useful for collecting many pairwise alignments, for example in the construction of Alignment Graphs for multiple-sequence alignments (MSA).
Second, you can optionally give a band for the alignment using
lowerDiag and upperDiag.
The center diagonal has index 0, the ith diagonal below has index -i, the ith above has index i.
The examples below show some common use cases.
Local alignment of two sequences using an Align object.
Dna5String seqV = "CGAAATT";
assignSource(row(align, 0), seqH);
assignSource(row(align, 0), seqV);
Score<int, Simple> scoringScheme(2, -1, -2);
int result = localAlignment(align, scoringScheme);
Local banded alignment of two sequences using two Gaps objects.
Gaps<Dna5String, ArrayGaps> gapsH(seqH);
DnaString seqV = "CGAAATT";
Gaps<Dna5String, AnchorGaps<> > gapsV(seqV);
Score<int, Simple> scoringScheme(5, -3, -1, -5);
int result = localAlignment(gapsH, gapsV, scoringScheme, -2, 2);
, , ,
SeqAn - Sequence Analysis Library - www.seqan.de