Home▸AI & Machine Learning▸DNA Sequence Aligner: Smith-Waterman Affine-Gap Score Matrix, Traceback and Variant Calling (2D)

DNA Sequence Aligner: Smith-Waterman Affine-Gap Score Matrix, Traceback and Variant Calling (2D)

The same Smith-Waterman affine-gap aligner and pileup caller in 2D: the score matrix as a heat map filled anti-diagonal by anti-diagonal with the traceback path in colour and Blender-rendered base tiles on the axes, the traced alignment as text (match, mismatch, deletion, insertion) and the pileup of all reads with the true variants and the calls marked.

AI & Machine Learning2DAdvanced60 FPS📱 Mobile-adapted🟠 Blender⇄ 3D version
DNA Sequence Aligner: Smith-Waterman Affine-Gap Score Matrix, Traceback and Variant Calling (2D) ↗ Open standalone

Finding where a short piece of DNA belongs on a reference is the first step of variant calling. The Smith-Waterman algorithm does it exactly: it fills a matrix of best local scores, one cell per pair of read and reference bases, rewarding matches, penalising mismatches and charging an affine cost for gaps, and then traces back from the best cell to read off the optimal alignment. A single insertion or deletion is cheaper than many separate gaps, so the cost of opening a gap is larger than the cost of extending it.

One read cannot tell a sequencing error from a real variant, so the page aligns many reads and builds a pileup: a column is called only when enough reads agree on the same difference. Change the scoring, the error rate, the coverage and the thresholds to see when real variants are found, missed or imitated by noise. Educational model of the algorithm, not a diagnostic tool.

⚙ Under the hood

The same Smith-Waterman affine-gap aligner and pileup caller in 2D: the score matrix as a heat map filled anti-diagonal by anti-diagonal with the traceback path in colour and Blender-rendered base tiles on the axes, the traced alignment as text (match, mismatch, deletion, insertion) and the pileup of all reads with the true variants and the calls marked.

Smith-WatermanSequence alignmentAffine gapVariant callingBioinformaticsGenomicsDynamic programmingDNA

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)