CAP-JS Sequence Assembly

Assemble one or more consensus contigs from short DNA fragments that may repeat, differ, or come from either strand.

Overlap–layout–consensus assembly in the browser, modelled on CAP3 (Huang & Madan, Genome Research 9:868, 1999). Fragments are seeded by shared k-mers, aligned pairwise with a banded affine-gap algorithm, laid out greedily, and finally stacked into a column-wise multiple alignment from which the consensus is called.

Fragments that repeat. Two reads that share only an interspersed repeat align across the repeat and then diverge, leaving a large unmatched overhang on both sides. Rejecting overlaps by overhang — not by length or identity alone — is what stops repeated regions from collapsing into a single contig. Every rejection is listed in the report, so an ambiguous join is visible rather than silent.

Fragments that differ. Divergence has two causes and the consensus caller separates them: an isolated disagreement is sequencing error and is out-voted, while a minority base seen in several independent reads is real polymorphism and is written into the consensus as an IUPAC ambiguity codeR (A/G), Y (C/T), S, W, K, M, and B/D/H/V/N for three or more alleles.

Upload local FASTA file — plain FASTA, multi-FASTA, or sequences
Optional PHRED quality values, one FASTA record per fragment, matched by name (or by order). Whitespace-separated integers, one value per base. Supplying them lets the consensus weight each vote by its base quality and lets poor read ends be clipped automatically.
Download:
Overlap detection
Shortest alignment accepted as evidence of a join.
Lower it for noisy reads, raise it to keep paralogues apart.
The repeat filter. Raise it only if true joins are being rejected.
Smaller k finds more overlaps in noisy data, and is slower.
0 = off. Needs the Quality tab.
Consensus and polymorphism
0 = off. Ramps a base's vote down near a read end.
A column becomes an IUPAC code only when all three thresholds are met. At a 1–2 % error rate, seeing the same wrong base in ≥2 reads at the same column is already improbable; requiring a quarter of the column makes it negligible, while a true 50/50 heterozygote is caught comfortably. Insertions and deletions have no IUPAC letter, so they are listed in the report as indel variants instead.
Performance
Pairwise alignment dominates the runtime and is the only stage that parallelises cleanly, so it — and only it — is spread across Web Workers. Everything else runs on the page in short slices, so the tab stays responsive either way. Small jobs stay single-threaded because the hand-off would cost more than it saves, and a page opened directly from disk (file://), where Workers cannot start, falls back automatically. The assembly is identical either way.
Need details? Input formats, every parameter, the repeat filter and the polymorphism rule are documented in Help: Sequence Assembly · Help: Troubleshooting
Next steps: check a contig against a database, align contigs in MSA, or design primers on the consensus in Primer Design.
Method after CAP3 / PCAP by Xiaoqiu Huang · independent in-browser JavaScript implementation for teaching and exploratory analysis; nothing is uploaded.