Documentation

Service

Table of Contents

Classes

AlignmentInputGuard
Two sequences of different molecules (a DNA against an RNA, whose T and U would score as a mismatch, or a nucleic acid against a protein) and a scoring made for another molecule (PAM250 on DNA) both produced a score with no error. They are refused here, for the three aligners alike.
NeedlemanWunschAligner
The classic Needleman-Wunsch algorithm : a (firstLength+1) x (secondLength+1) matrix is filled so that cell (i, j) holds the best score of aligning the first i symbols of the first sequence against the first j symbols of the second one, then the alignment itself is recovered by walking that matrix back from its bottom-right corner to (0, 0). Only a linear (per-gap-symbol) gap penalty is supported ; an affine, opening-versus-extension penalty would need a second matrix and is not implemented here.
NucleotideAmbiguityScoring
Scores two nucleotides by the bases each may stand for. Two definite bases are a match or a mismatch ; when one of them is an ambiguity code (R, Y, S, W, K, M, B, D, H, V, N, X), the pair is a mismatch only if the two sets of bases share nothing (R against Y : A/G against C/T), and otherwise scores the intermediate "ambiguous" value, 0 by default - a read that says N neither confirms nor refutes the base facing it, where SimpleMatchMismatchScoring gives N against N a full match and R against A a full mismatch. U is read as T, so DNA and RNA score alike. Case insensitive.
Pam250Scoring
Scores a pair of amino acid symbols using the PAM250 substitution matrix already exposed by bioapi for other parts of this library (see Api\Pam250MatrixDigitApi), rather than a flat match/mismatch rule. The matrix is fetched and flattened once, in the constructor, and is exhaustive for every ordered pair of the twenty standard amino acids ; it has no entry for any other symbol AminoAcidSequence tolerates - the ambiguous B, Z, J and X, selenocysteine U, pyrrolysine O and the stop "*" - which score() reports as an error rather than guessing a value.
SemiGlobalAligner
The third classic pairwise alignment shape, between NeedlemanWunschAligner (global : every gap, including leading and trailing ones, is penalized) and SmithWatermanAligner (local : a whole sub-region can be abandoned mid-alignment). Here, the matrix borders start at zero exactly like Smith-Waterman's, so leading gaps are free, but unlike Smith-Waterman the recurrence itself is never floored at zero : once the alignment leaves the border it is never allowed to bail out mid-way, only to finish at either the last row or the last column, which is what makes trailing gaps free too without ever discarding an interior stretch the way local alignment would. The alignment is recovered by walking back from the best-scoring cell among the last row and the last column (never from an interior cell, since only those two represent "one of the two sequences has been fully consumed"), until reaching either i = 0 or j = 0 - whichever comes first - leaving the other sequence's unconsumed prefix as a free leading gap that contributes nothing to the score and is not part of the reported alignment.
SimpleMatchMismatchScoring
Awards a fixed score for identical symbols and another fixed score for anything else, case insensitive. Suitable for DNA and RNA, and usable as a crude default for amino acids when no substitution matrix is available.
SmithWatermanAligner
The classic Smith-Waterman algorithm : like NeedlemanWunschAligner's matrix, except every cell is floored at zero (a bad-scoring region is simply abandoned instead of dragging the running total negative), the borders start at zero rather than an accumulated gap cost, and the alignment is recovered by walking back from the single highest-scoring cell in the whole matrix - not from the bottom-right corner - stopping as soon as a cell of value zero is reached, rather than at (0, 0).
On this page

Search results