Sequence Alignment Visualizer
Watch dynamic programming actually happen
Run Needleman–Wunsch and Smith–Waterman over two sequences, then hover any cell in the scoring matrix to see exactly how its value was derived and trace the optimal path.
The takeaway
BLAST is not magic. It is this matrix, filled in cell by cell — and once you have watched the traceback, homology search stops being a black box.
Orthologous fragments diverged by a single point substitution. Global alignment is right here: the two sequences are homologous end-to-end, so every position should be accounted for.
Allowed: A C G T U N
This is a lineargap model: a gap of length L costs L × penalty. Production tools (BLAST, EMBOSS) use affinegaps — an expensive open, a cheap extend — because one 5-base indel is far more likely than five separate 1-base indels.
Aligned output
full-length global alignmentDynamic-programming matrix
Every cell holds the best score of any alignment ending there. Hover a cell to see the three candidate moves it chose between. The amber ring is the traceback — the optimal path itself.
Global vs. local: why it matters
Needleman–Wunsch (global) assumes the two sequences are homologous along their entire length and forces every residue into the alignment. Use it to compare the same gene between two species.
Smith–Waterman (local) clamps negative scores to zero, so a bad region can never drag the alignment down — it just resets. That lets it find one conserved domain inside two otherwise unrelated proteins, or a short motif in a whole chromosome. This clamp-and-restart is the entire difference, and it is the reason local alignment is the heart of homology search.
This is the engine inside BLAST
Filling an n×m matrix costs O(nm). For a 300-residue query against a 100-billion-residue database that is far too slow, so BLAST first finds short exact word matches (seeds) and only then runs this exact Smith–Waterman extension around them. The heuristic finds candidates; the dynamic program you are looking at scores them.
Try protein mode. DNA gets away with flat match/mismatch scoring. Proteins do not — switch modes to see BLOSUM62 score a chemically conservative swap as a positive, not a penalty.