Minimap2 Algorithm Visualizer

Minimizer Sampling & Collinear Chaining

Interactive exploration of high-throughput sequence alignment indexing using (w, k)-minimizers and 2D dynamic programming collinear chaining — the algorithmic core powering Minimap2.

Presets:
Minimizer Parameters (w, k)
Window Size (w)3
k-mer Length (k)3

In each sliding window of w consecutive k-mers, the k-mer with the lowest hash value is chosen as the minimizer anchor.

Ready (0/0)
Target Minimizers:Teal = sampled minimizers, Green = collinear chain anchors
Query Minimizers:Teal = sampled minimizers, Green = collinear chain anchors
2D Anchor Dot-Plot & DP Chain GraphHover dot for anchor info
Minimap2 Chaining Formula

For anchor a_i = (x_i, y_i), the DP recurrence finds the predecessor anchor a_j maximizing:

S[i] = k + max(0, max_j [ S[j] + min(Δx, Δy, k) - α(gap) ])

where gap = |Δx - Δy|, penalizing insertions/deletions while rewarding contiguous collinear diagonals.

Why Minimizers Matter for Long Reads

Instead of indexing every single k-mer, (w, k)-minimizers sample roughly ≈ 2 / (w + 1) fraction of positions. This reduces memory and computation by 10–30× while retaining robust coverage across error-prone long reads.

Collinear DP Chaining

Unlike heuristic seed-and-extend approaches, 2D dynamic programming evaluates global spatial consistency across all anchor pairs $(x_i, y_i)$, finding the optimal alignment path in polynomial time.

Base-Level Alignment Extension

Once the optimal chain of anchors is identified, Minimap2 performs piecewise Suzuki-Kasahara dynamic programming (SSE/AVX accelerated) only between adjacent anchors in the chain.