A reference genome is a string over the alphabet {A, C, G, T}. Read alignment is the core bioinformatics task of finding where a short sequencing read best matches inside that reference — the basis of tools like BLAST and BWA. This sim runs the simplest exhaustive form: an ungapped sliding-window scan that slides the read across every possible offset and scores each alignment by identity.
score(i) = (1/L) * sum_{j=0}^{L-1} [ read[j] == genome[i+j] ]
best_i = argmax_i score(i), i in [0, N-L]
Each base is drawn as a colored bead on the curled genome strand (A red, C green, G amber, T cyan). Small marker spheres above the currently-tested window turn green on a match and red on a mismatch, live, as the scan pointer sweeps through every offset i.
- Read length — changes L, the window size compared at every offset, and regenerates the read.
- Sequencing error rate — fraction of bases in the read randomly mutated away from the true genome subsequence, mimicking real sequencer error.
- Scan speed — how many genome positions per second the algorithm tests.
- New Genome / New Read — regenerate the reference sequence or draw a fresh read (with mutations) from a random location in it.
Real aligners add gaps and dynamic-programming scoring (Smith–Waterman, Needleman–Wunsch) or hash-based seeding (BLAST, minimizers) to make this search fast across billions of bases — but the identity-scoring core shown here is the same idea.