Algorithms that look easy until you run them
Interactive walkthroughs from CS173A. Step through each algorithm, then practice on fresh random problems that are checked against code.
MEME
Find the motif shared by a set of sequences when you do not know where the sites are.
The tricky part: every start position gets a fractional weight, not a hard pick.
Viterbi
Find the single most probable path of hidden states for an observed sequence.
The tricky part: each cell keeps the best prefix per state, and the answer appears only after backtracking.
Forward
Compute how probable a sequence is under a model by adding up every path.
The tricky part: it is the same trellis as Viterbi, but sums replace max and nothing is discarded.
Sequence alignment
Fill a score table to find the best global or local alignment of two sequences.
The tricky part: what each cell remembers, and where traceback starts and stops in the local version.
Backward and forward-backward
Look from the right end, then combine with forward to get the probability of each state at each position.
The tricky part: the emission in the recurrence is the next base, and posterior decoding can disagree with Viterbi.
RNA folding: Nussinov and CYK
Count base pairs with an interval table, then see the same idea as a stochastic grammar.
The tricky part: pairing the ends is only one option, and a saved split means tracing both pieces.
Flashcards
Key numbers from the slides and the rules for every algorithm.
Flip, mark Got it or Again, and drill the ones you miss.