← Back to devlog

2026-07-04 — v23 primer design + Tm + in-silico PCR

Work unit 4: the Primer panel lets you enter a forward and a reverse primer, instantly see Tm / GC% / hairpin risk / self-dimer scores computed with the SantaLucia 1998 nearest-neighbor parameters, search the loaded sequence for binding sites (mismatch-tolerant, strict 3′ end), and predict PCR amplicons — all in-browser, nothing uploaded. This closes the Sanger-review → primer-design → PCR-validation loop without a context switch to another tool.

What changed

Spec grounding

Tests

New test coverage for v23
FileCountWhat is asserted
tests/core/primers.test.ts 53 computeGC: exact values for ACGT / poly-A / poly-G / 20-mer / IUPAC S / empty / case-insensitive.
computeTm: numeric + not-NaN; ordering (longer > shorter, high GC > high AT); range check for a known 18-mer; salt effect.
computeHairpinTm: null for short sequence; non-null for self-complementary 15-mer; no crash for random 20-mer.
computeSelfDimerScore: 0 for all-A vs all-T RC; ≥ 2 for ACGT palindrome; ≥ 3 for ATATAT; ≥ 3 for 3′ self-complement tail.
computePrimerFlags: no flags for ideal primer; each flag trigger tested individually (short, low/high GC, low Tm, hairpin, self-dimer, 3′ homopolymer, 3′ no-clamp).
findPrimerBindingSites: exact 1-based forward site position; forward-strand exact match; reverse-strand RC match; zero-tolerance rejection; 1-mismatch tolerance; 3′ mismatch rejection; primer longer than template.
predictAmplicons: one amplicon with exact size and sequence; mismatch passthrough; zero amplicons when rev upstream of fwd; ascending- size sort; circular wrap-around; no circular when disabled; maxSize filter; empty forward/reverse arrays.
ampliconToFasta: header contains both names, size, and coordinates; sequence present; trailing newline; circular-wrap tag; 80-char line wrap.
tests/e2e/primer.e2e.test.ts 8 Panel visible after trace load; live Tm/GC stats appear on input; Run button disabled/enabled correctly; binding sites section appears after Run; status reports site and amplicon counts; FASTA download header starts with >amplicon [ (when amplicons found); primer name reflected in UI; results cleared after new trace load.

Design decisions