← Back to devlog

2026-07-04 — v21 reference alignment + variant/SNP calling

Work unit 2: paste or load a reference sequence; the viewer aligns the Sanger read to it entirely in the browser (no server, no upload), calls substitutions, indels, and ambiguous IUPAC positions with 1-based coordinates, shows them in a filterable review table, and lets you export a CSV or VCF-lite TSV. The privacy wedge — data never leaving the machine — is preserved end-to-end.

What changed

Specs grounding this unit

Tests

New test coverage for v21
FileCountWhat is asserted
tests/core/alignment.test.ts 43 IUPAC scoring exact values, reverseComplement, CIGAR parse/build, coordinate mapping (readPosToRefPos / refPosToReadPos), CIGAR length helpers, aligner placement + strand detection, known-mismatch variant positions from CIGAR walk.
tests/core/variants.test.ts 29 callVariants exact position + type + confidence + alt sequence; filterVariants all four modes; countByType; toVariantsCsv exact bytes; toVariantsVcf exact bytes; suppressed-variant exclusion.
tests/e2e/reference-alignment.e2e.test.ts 8 Panel visible after load; Align button disabled when empty; Align enabled after paste; status shows strand + ref-pos range; variant table appears; filter tab state transitions; CSV download header exact match; Clear resets panel and hides table.

Design decisions