← Back to devlog

2026-07-04 — v17 multi-trace consensus & mismatch view

Unit B ships: the multi-trace workspace now aligns loaded traces by position, computes a deterministic consensus using a pinned IUPAC tie-code algorithm, and surfaces per-position agreement/mismatch highlighting alongside a mismatch-count summary. The consensus can be exported as a standard FASTA file.

What shipped

Algorithm (pinned)

At each position i (clamped to Math.min of all trace lengths):

  1. Count occurrences of each character (case-insensitive, uppercase-normalised).
  2. If all traces agree → consensus base = that character; not a mismatch.
  3. Otherwise → mismatch; resolve: find maxCount; collect tiedBases sorted A<C<G<T<other; if all canonical and the sorted join is in the IUPAC table → use that code; else if sole winner → use that base; else → N.

A note on gapped alignment: this v1 uses simple positional (ungapped) consensus. True gapped alignment (e.g. Needleman–Wunsch) is scoped as a follow-up if needed.

Verification added