Skip to content
Tech Interview Prep
Technical interview guide

Genome Assembly & Sequencing Technologies

How raw sequencing reads become a genome: short-read vs. long-read platforms, de Bruijn graph assembly, and what coverage actually buys you.

Minutes to read
3
Practice MCQs
25
Interview Q&A
25
Edition
v4
Editorial status
Reviewed

Scope: Foundational Lander-Waterman and de Bruijn graph models; SPAdes, Canu, Flye, hifiasm, QUAST and BUSCO source publications; current Illumina, PacBio, Oxford Nanopore and NCBI guidance reviewed 2026-09-04.

Interview Q&A

Treat each question like a live interview question: answer out loud first (structure, assumptions, tradeoffs), then open the model answer to spot gaps and rehearse a tighter follow-up.

Curated: · Written: · Reviewed:

25 questions

Q&A-3

Choose between raw long reads and HiFi reads.

Answer

Assumption: "raw long reads" means ONT simplex basecalled reads (PacBio CLR is the older analogue); "HiFi" means PacBio circular-consensus reads.

Core recommendation. Default to HiFi. Choose raw long reads only when a repeat or structural variant is longer than a HiFi molecule can span, or when you need the longest possible molecules and will pay for polishing.

HiFi reads run ~15 kb at ≥99.9% (Q30) accuracy on Sequel II and Revio. ONT simplex reads are longer (N50 typically 10–30 kb, 100 kb+ with the ultra-long protocol) but at ~95% (Q13) on R9.4.1 and ~99% (Q20) on R10.4.1 with Dorado. The trade is not length versus accuracy in the abstract; it is whether one molecule must span the repeat, or whether you need base-level accuracy without a polishing step.

Why the numbers land where they do. HiFi is circular consensus: a ~15–20 kb SMRTbell insert is read around the circle several times, each pass at ~85–90% raw accuracy, and the consensus of n passes drives error down roughly as 1/√n for independent errors. That is why HiFi reads sit near 15 kb: a longer insert gets fewer passes inside the polymerase read time, so length and accuracy trade against each other. ONT raw is single-pass, so its error is the raw per-base error, dominated by homopolymer indels and context-specific substitutions that consensus does not average away.

criterionHiFiraw ONT simplex
read length~15 kb meanN50 10–30 kb; 100 kb+ ultra-long
per-read accuracy≥99.9% (Q30)~95% (Q13) R9.4.1; ~99% (Q20) R10.4.1 + Dorado
dominant errornear-random, few indelshomopolymer indels, context-specific
polishing needednoyes for base-level (Medaka/HERRO, or short-read Pilon)
spans a 50 kb repeatnoyes

Arithmetic. 30× of a 3.1 Gb genome is 93 Gb. At 15 kb mean that is 6.2M HiFi reads. A 15 kb HiFi read at Q30 carries ~15 expected errors; a 15 kb ONT raw read at 95% carries ~750. Same length, ~50× the errors: you close that with consensus or polishing, not by choosing longer reads.

Failure modes and how to catch them.

  • Homopolymer indels in ONT raw reads. Detect by aligning to a truth set (GIAB HG002) and plotting indel length; a spike at homopolymers ≥6 bp is the signature. Cost: frameshifts in coding exons.
  • HiFi length ceiling. Detect by read-spanning fraction, what fraction of the repeat sits inside one read, not by N50. If nothing spans it, add ultra-long ONT (the Verkko pattern: HiFi + ultra-long).
  • Yield shortfall from degraded input. HiFi needs multiple passes per molecule; short fragments give fewer passes and lower accuracy. Check the CCS pass-count distribution; median passes below ~3 and accuracy falls off.
  • Basecaller drift. ONT error profiles change between Dorado versions; re-basecalling a control moves variant calls. Pin the basecaller version and re-run a control.
  • Read N50 ≠ assembly correctness. Check Merqury k-mer completeness/QV or a truth set, not N50.

When raw long reads win. A segmental duplication or tandem array longer than ~20 kb: no HiFi read spans it, so you need ultra-long ONT and a hybrid assembly. Also when cost per base dominates and you already have accurate short reads to polish with (Pilon/NextPolish), but budget the polishing compute and the residual indel bias.

Tools: hifiasm (HiFi assembly), Flye (ONT), minimap2, Medaka/HERRO, Merqury.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-4

Set and audit an assembly coverage target.

Answer

Core answer

Set the target as a nominal depth, not a base count. Derive it from the read technology and the assembly's purpose. For a 500 Mb diploid plant genome with 2×150 bp Illumina, target 60×. That is 500 Mb × 60 = 30 Gb of filtered bases, or 30e9 / 300 = 100M read pairs. Audit three things separately: the k-mer spectrum, the mapped-depth distribution, and completeness. Nominal depth is a mean; a mean hides the tails.

Worked example: setting and auditing 60×

Arithmetic:

  • Genome size estimate: 500 Mb (from k-mer spectrum, cross-checked with flow cytometry).
  • Target depth: 60×.
  • Filtered bases needed: 500e6 × 60 = 30e9 bp.
  • Read pairs: 30e9 / (2 × 150) = 100e6 pairs.

Audit pipeline (run after sequencing):

Shell
# 1. Estimate genome size and error rate from k-mers
jellyfish count -C -m 21 -s 5G -t 16 -o reads.jf <(zcat reads_1.fq.gz) <(zcat reads_2.fq.gz)
jellyfish histo -t 16 reads.jf > reads.histo
genomescope.R -i reads.histo -o genomescope_out -k 21 -p 2

# 2. Align, mark duplicates, compute depth
bwa mem -t 16 ref.fa reads_1.fq.gz reads_2.fq.gz \
  | samtools sort -n -@ 16 -o aln.namesort.bam
samtools fixmate -m -@ 16 aln.namesort.bam aln.fixmate.bam
samtools sort -@ 16 -o aln.coordsort.bam aln.fixmate.bam
samtools markdup -@ 16 aln.coordsort.bam aln.markdup.bam
samtools depth -a -b nuclear.bed aln.markdup.bam > depth.txt

# 3. Summarise depth
awk '{sum+=$3; n++; if($3==0) z++; if($3<10) l++; if($3>120) h++} END {print "mean", sum/n, "0x", z/n, "<10x", l/n, ">2x", h/n}' depth.txt

Expected results at a true 60× (hypothetical numbers for a clean library):

MetricExpectedRed flag
GenomeScope genome size500 Mb ±10%>10% disagreement with flow cytometry
k-mer peakshet ~30×, hom ~60×extra peaks at 2× or 3×
Duplicate rate (markdup)<20%>20%
Nuclear mean depth~60×mean inflated by organelle
Fraction <10×<5%fat left tail
Fraction 0×<1%coverage holes
Organelle depth200–2000×>5× nuclear mean
BUSCO complete>95%>10% missing

Why nominal depth, and where it breaks

Nominal depth = filtered bases / estimated haploid genome size. The estimate is the weak link: use 400 Mb when the genome is 500 Mb and you think you have 75× when you have 60×. Estimate genome size from the k-mer spectrum (Jellyfish or KMC counts, GenomeScope fit) and cross-check against flow cytometry or a close relative. If the two disagree by more than ~10%, fix the estimate before you set the target.

The audit

  1. k-mer spectrum. GenomeScope fits a model to the k-mer histogram. For a diploid at 60×, expect a heterozygous peak near 30× and a homozygous peak near 60×. One clean peak means haploid or inbred; extra peaks at 2× or 3× the main peak mean collapsed repeats or contamination. The same fit returns the genome-size estimate and error rate.

  2. Mapped depth. Align with BWA-MEM, mark duplicates (samtools markdup), then samtools depth. Build the per-base depth histogram. At a true 60× mean, the fraction of the nuclear genome below 10× should be small; a fat left tail means GC bias or a coverage hole. Report the fraction at 0×, <10×, and >2× mean separately.

  3. Organelle and duplicate skew. Mitochondrial and chloroplast contigs routinely sit at 200–2000×. Averaging over all contigs lets them inflate the mean. Map reads to organelle references, subtract those bases, recompute nuclear depth. PCR duplicates do the same thing: markdup reports the duplicate rate, and >20% means the library is over-amplified and effective depth is below nominal.

  4. Completeness. BUSCO against the relevant lineage (e.g. embryophyta_odb10) gives % complete single-copy, duplicated, fragmented, missing. Merqury gives k-mer-based completeness and QV. These say whether the target was met at the loci that matter.

Trade-offs

More coverage buys fewer gaps and better consensus, with diminishing returns: past ~60× for Illumina short reads, extra bases land on already-covered loci and contiguity is limited by repeats, not depth. Going 60× → 120× roughly doubles cost and compute for a small completeness gain. The alternative (long reads (PacBio HiFi, ONT)) reaches similar completeness at 20–30× because reads span repeats, but costs more per base and carries higher per-read error. The deciding criterion is what limits the assembly: if it is repeat structure, spend on read length; if it is base accuracy in unique regions, spend on depth.

Failure modes and detection

  • Wrong genome size: k-mer estimate disagrees with flow cytometry by >10%; GenomeScope fit residual is high.
  • Contamination: extra k-mer peaks; BlobTools GC/coverage plot shows a second cluster.
  • Organelle skew: contigs at >5× the nuclear mean; detect by mapping to organelle references.
  • Duplicate reads: markdup duplicate rate >20%; effective depth below nominal.
  • Uneven coverage: depth histogram has a fat left tail; fraction of genome <10× is high.
  • High mean mistaken for completeness: mean is 60× but BUSCO missing is 15%. The target was met on average and missed at loci.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-7

Construct a small de Bruijn assembly graph.

Answer

First minute. The question is underspecified, so I'd pin three things before drawing anything: the reads, k, and the node-edge convention. Take two error-free reads from one haploid genome, R1 = AATGCA and R2 = ATGCAT, k = 3, node = (k−1)-mer, edge = k-mer directed prefix→suffix. That's small enough to draw by hand and check.

k-mers. R1 gives AAT, ATG, TGC, GCA. R2 gives ATG, TGC, GCA, CAT.

The graph (distinct k-mers). Five nodes, five edges:

edgefromto
AATAAAT
ATGATTG
TGCTGGC
GCAGCCA
CATCAAT

Degrees:

nodeinoutout−in
AA01+1
AT21−1
TG110
GC110
CA110

AT has in-degree 2, AAT and CAT both land on it, so it is the −1 node, not a balanced one. Exactly one +1 node (AA) and one −1 node (AT), so an Eulerian path exists, and here it is forced: AA→AT→TG→GC→CA→AT, edges AAT, ATG, TGC, GCA, CAT. Spell it: first edge AAT, then the last base of each next edge: AAT + G + C + A + T = AATGCAT. The graph merged the two reads on their 5-base overlap. That is the assembly.

Multiplicity, and why it's a real decision. Count each read's k-mers separately: ATG, TGC, GCA each appear twice. Degrees now:

nodeinoutout−in
AA01+1
AT220
TG220
GC220
CA12−1

The signature changed: it is now AA +1, CA −1, not AA +1, AT −1. An Eulerian path still exists but is forced through the doubled middle edges: AAT, ATG, TGC, GCA, CAT, ATG, TGC, GCA → AATGCATGCA, 10 bases. The extra 3 bases are read overlap, not genome repeat. So dedup when overlap is the only source of multiplicity; keep it when coverage says the repeat is real. Getting that wrong is the difference between a 7-base contig and a 10-base one.

Reverse complements. revcomp(ATG) = CAT. Canonicalise (keep min of k-mer and revcomp) before adding edges and CAT collapses onto ATG: the CA→AT edge vanishes, AT→TG gains multiplicity 2. Degrees become AA +1, AT +1, TG −1, CA −1: four imbalanced nodes, so no Eulerian path. Detection: count nodes with out−in ≠ 0; a correct de Bruijn graph has exactly two (or zero for a cycle).

Failure modes, each with a detector.

  • Off-by-one k: every edge label must equal prefix + last base of suffix. Check it on the edge list; a mismatch means k is wrong.
  • Error branch: one sequencing error adds a multiplicity-1 edge ending in a tip shorter than k. Detect by a node with in 0 or out 0 that isn't the start/end, then prune.
  • Memory: k-mer instances scale with coverage. At 30× over a 3.1 Gbp genome that's ~9×10^10 k-mer instances before dedup: the hash table, not the graph, is what blows up. Watch RSS against the table's load factor.

When not to use this. For a handful of reads, overlap-layout-consensus is simpler and gives you the overlap directly. de Bruijn wins when coverage is high enough that k-mer counting is cheaper than all-pairs overlap, which is why it's the default for short reads and the wrong tool for a few long ones.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-8

Select k-mer sizes for short-read assembly.

Answer

The 90-second answer

Assume Illumina paired-end, 150 bp reads, ~50× haploid coverage, and a genome whose repeat spectrum you have looked at. Pick odd k, keep k below read length with margin for errors, and choose from a multi-k sweep by repeat resolution and coverage uniformity, not by the largest N50.

Odd, because an even-length k-mer can equal its own reverse complement, which puts a self-loop in the de Bruijn graph and makes the path ambiguous. Below read length, because a k-mer needs L−k+1 bases of support: at k=127 with 150 bp reads you have 24 bases of slack, so one error in that window destroys the k-mer.

Why the numbers move the way they do

Each read of length L contributes L−k+1 k-mers, so k-mer coverage = read coverage × (L−k+1)/L. At 50× and k=55: 50 × 96/150 = 32×. At k=127: 50 × 24/150 = 8×. That is the fragmentation mechanism: the same read depth gives four times less k-mer depth at high k, so low-coverage regions drop below the threshold where the graph stays connected.

A single wrong base corrupts k k-mers. The fraction of error-free k-mers is roughly (1−e)^k. At Q30 (e=0.001): k=55 → 95%, k=127 → 88%. At Q20 (e=0.01): k=55 → 58%, k=127 → 28%. Error k-mers form tips and bubbles; assemblers trim them by k-mer coverage, but at high k too few clean k-mers remain to bridge the gap.

A repeat of length R is resolved only if k > R. Repeats shorter than k collapse into one graph path: that is the misassembly. Repeats longer than k (Alu ~300 bp, LINE ~6 kb) branch, and no short-read k resolves them; contigs simply end at the repeat.

Multi-k is the default because no single k wins everywhere. SPAdes defaults to 21,33,55, adds 77 under --isolate, and extends toward 127 when reads are long enough. MEGAHIT sweeps 21→141 in steps of 12 (21,33,45,…,141), feeding each assembly's contigs back as pseudo-reads for the next k. Velvet takes one k, so you run it several times and compare.

Failure modes and how you catch them

symptomcausedetection
contig coverage ~2× the haploid mean, discordant read pairsk below the repeat length, repeats collapsedmap reads back with BWA-MEM or bowtie2; look for doubled-coverage blocks and insert-size outliers
many short contigs, N50 falls as k risesk too high for the coverage or error ratek-mer coverage histogram; plot contig count and N50 against k
tips and bubbles, inflated grapherror k-mersk-mer spectrum shows the error hump near 1×
peak RSS blows past the node's RAMdistinct k-mer count grows with kwatch peak RSS; MEGAHIT's succinct de Bruijn graph stays near a few bytes per distinct k-mer, which is why it scales to large metagenomes where SPAdes' graph does not

Validate with QUAST (NGA50, misassembly count) and BUSCO (gene completeness), not N50 alone: N50 rewards collapsing repeats, so tuning on it is benchmark overfitting.

What would change the decision

Low coverage (<20×) or a high error rate caps k lower, because the k-mer depth arithmetic above leaves no margin. A repeat-rich genome pushes k up, but you accept fragmentation and scaffold with long reads if you have them. If long reads are available at all, the k choice matters far less: use them to span what no short-read k can.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-2

Assemble a small genome from paired short reads.

Answer

I'd start by clarifying the genome size and repeat content, because that decides whether short reads alone can finish it. Assume a 5 Mb bacterial genome, paired-end Illumina 2x150 bp reads, and 50–100x coverage. The core answer is: use a de Bruijn graph assembler like SPAdes or SKESA, choose k-mer sizes that balance repeat resolution and graph complexity, use paired-end information to scaffold, and leave gaps where repeats exceed the insert size rather than forcing joins.

First, QC. Trim adapters and low-quality bases with fastp or Trimmomatic, and keep pairs together. Check for overrepresented sequences and GC bias. Then estimate the k-mer spectrum: for a 5 Mb genome at 50x, you have about 250 million k-mers. The histogram shows a peak at 50x for unique k-mers; errors appear as a low-frequency tail. The area under the peak estimates genome size, and the peak position gives coverage. This tells you if you have enough data and if there's contamination.

Next, choose k. Small k (21) resolves errors but collapses repeats; large k (77) resolves repeats but fragments the graph. SPAdes runs multiple k values (21, 33, 55, 77) and picks the best. The assembler builds a de Bruijn graph where nodes are k-mers and edges are overlaps. Repeats longer than k create branching nodes. Paired-end reads link nodes within the insert size (e.g., 300–500 bp). If a repeat is longer than the insert size, no pair spans it, so the graph remains unresolved.

After assembly, scaffold with paired-end reads to order contigs and estimate gap sizes. Tools like SSPACE or the assembler's built-in scaffolder do this. Then fill gaps with GapFiller using reads. Validate with BUSCO for completeness and CheckM for contamination. For a 5 Mb bacterial genome, a good draft has N50 in the hundreds of kb; complete closure requires spanning repeats.

Trade-offs: if the genome has repeats longer than the insert size (e.g., rRNA operons, IS elements), short reads will collapse them. Alternatives are long-read sequencing (PacBio HiFi, Nanopore) or mate-pair libraries with 3–10 kb inserts. Criteria: if you need a complete genome for outbreak analysis or plasmid reconstruction, use long reads or hybrid assembly (Unicycler). If a draft is sufficient for gene prediction, short reads are cheaper and faster.

Failure modes: repeat collapse (two copies merged), GC dropout (low coverage in high-GC regions), adapter contamination, PCR duplicates, wrong pair orientation, contamination. Detect with coverage plots, unexpected contig multiplicity, and tools like CheckM.

Worked trace: a 1 kb repeat flanked by unique sequences. With 300 bp inserts, no read pair spans the repeat, so the assembler produces two contigs ending at the repeat. With 3 kb mate pairs, a pair links the flanks, allowing the repeat to be resolved. That's why insert size matters.

ParameterTypical value for 5 Mb bacterial genome
Read length2x150 bp
Coverage50–100x
k-mer sizes21, 33, 55, 77
AssemblerSPAdes, SKESA
Expected N50100 kb – 1 Mb (draft); 5 Mb (complete)

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-6

Explain repeat handling in an OLC assembler.

Answer

Core answer (first 60–120 seconds)

Assume long reads: PacBio HiFi at 15–20 kb and >99.9% accuracy, or ONT ultra-long above 100 kb, and an OLC assembler such as Canu, or a string-graph assembler like hifiasm. The question repeat handling has to answer is: when two reads overlap, is that overlap a true genomic adjacency, or two reads from different copies of a repeat that happen to align? OLC decides with four signals, strongest first.

  1. Does the read span the repeat? If read length exceeds repeat length, the read carries unique sequence on both flanks and the overlap is anchored. HiFi reads span Alu (~300 bp) and LINE-1 (~6 kb); they do not span segmental duplications (10–100 kb) or satellite arrays.
  2. Unique flank anchors. An overlap is trusted when it extends into non-repetitive sequence at both ends.
  3. Coverage. A repeat unitig carries copy-number × haploid coverage.
  4. Mate-pair or Hi-C links whose insert size exceeds the repeat length jump across it.

Then transitive reduction (Myers, The fragment assembly string graph, 2005) removes edges implied by longer paths, and the surviving graph is traversed.

Mechanism: why repeat overlaps look real

The overlap detector seeds on k-mers and extends by alignment. Two reads from different Alu copies align at roughly 85–95% identity over 300 bp: above any threshold that still keeps true overlaps. The aligner cannot know the two copies sit megabases apart, so the graph gains an edge that is not a genomic adjacency.

Transitive reduction only helps when the repeat edge is implied by a longer path. If A–B overlaps 5 kb, B–C overlaps 5 kb, and A–C overlaps 2 kb, the A–C edge is removed. If A–C overlaps 8 kb, a repeat longer than the flanking overlaps, it survives, and that surviving edge is what drives misassembly.

Repeat length versus read length

Repeat vs readWhat the assembler seesOutcome
Repeat < read (Alu 300 bp, HiFi 15 kb)Read spans repeat, unique flanks both sidesResolved; overlap anchored
Repeat ≈ read (LINE-1 6 kb, ONT 10 kb)Some reads span, some do notPartially resolved; coverage and mate pairs decide
Repeat > read (segmental dup 50 kb, HiFi 15 kb)No read spans; graph tanglesCollapse or forced traversal; misassembly risk

Trade-offs

Raising the identity cutoff: 99% for HiFi versus Canu's default errorRate of 0.144, about 86% identity, for CLR: filters repeat overlaps but also drops true overlaps in high-error or low-complexity regions, fragmenting contigs. Requiring unique flank anchors on both sides is stricter and safer but fails at contig ends and in repeat-dense genomes. Aggressive filtering wins when you would rather have a fragmented correct assembly than a collapsed wrong one; it loses when repeats are the only sequence linking conserved unique regions.

Failure modes and how they are detected

  • Collapsed repeat: two copies merged into one unitig. Detect: coverage near 2× haploid on that unitig, or mate-pair insert sizes violated.
  • Forced traversal: the assembler picks one copy arbitrarily at a repeat branch. Detect: alignment breakpoint, or disagreement with a reference or optical map.
  • Chimeric read: two fragments ligated, creating a false overlap. Detect: alignment breakpoint with no k-mer support.
  • Haplotype mixing: homologous chromosomes collapsed. Detect: elevated heterozygosity, or 2× coverage on a region expected to be haploid.

Arithmetic

Haploid coverage 30×. A unique unitig shows ~30×. A three-copy repeat unitig shows ~90×. If two copies collapse, the merged unitig shows ~60× and the graph holds one node where there should be two: coverage flags it, but only after the collapse has already happened.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-11

Set conservative graph-cleaning rules.

Answer

What I'd say first (60–120 s). Assumptions: a de Bruijn or pangenome graph from Illumina 2×150 at k=31, long reads optional for linkage, diploid unless told otherwise. Goal: remove sequencing error, keep real variation. The core rule is that there is no global coverage threshold. "Prune everything below 5×" is the most common way to lose real alleles, because coverage is not uniform: rRNA operons, plasmids and recent duplications sit at different copy numbers from the chromosome. Every decision is local: compare a branch to the coverage of the backbone it attaches to.

The four rules.

  1. Local coverage. Take the median coverage over a 2 kb window on the flanking backbone. For an internal branch, prune only if it is below 0.2× that median. A 5× plasmid in a 50× chromosome survives, because the window on the plasmid backbone has median 5× and the threshold there is 1×; a global 10× cutoff deletes the whole plasmid.
  2. Tips. Prune a dead-end tip only when it is shorter than k (31 bp), too short for any read to span it, and below the 0.2× threshold. A 200 bp tip at 3× stays: it is long enough to be spanned, so it needs linkage evidence, not a coverage call.
  3. Bubbles. Collapse a two-branch bubble only when both branches are >99% identical over their full length and the shorter is under one read length (150 bp). Anything longer or less identical is kept as a candidate allele.
  4. Linkage overrides coverage. ≥2 read pairs spanning the junction keeps a branch at any coverage. Two independent pairs is the threshold I'd defend; one is a mapping artifact.

Worked example. Backbone window, 20 sampled positions at 100 bp spacing: 48, 52, 50, 47, 51, 49, 53, 50, 46, 50, 52, 48, 50, 51, 49, 50, 47, 52, 50, 49. Sorted, the 10th and 11th values are both 50, so median = 50× and threshold = 0.2 × 50 = 10×.

def classify(b, local_median, k=31, read_len=150):
    thr = 0.2 * local_median
    if b.spanning_pairs >= 2:
        return "keep"                      # linkage overrides coverage
    if b.is_tip:
        return "prune" if (b.length < k and b.cov < thr) else "keep"
    if b.is_bubble and b.identity > 0.99 and b.length < read_len:
        return "collapse"
    return "prune" if b.cov < thr else "keep"

Trace at local_median = 50 (thr = 10):

BranchKindLengthCovSpanning pairsDecision
Atip242×0prune (24 < 31 and 2 < 10)
Btip2003×0keep (200 ≥ 31, tip rule doesn't fire)
Cbubble120, 99.6% id45×0collapse
Dbubble400, 97% id22×0keep (identity fails, 22 ≥ 10)
Einternal3004×3keep (linkage)
Finternal1506×0prune (6 < 10)

Ploidy sanity check. In a diploid, a real het sits at 0.4–0.6× local depth: 20–30× in a 50× region. A branch at 0.05× (2.5×) is error; one at 0.5× (25×) is a het you must not touch. In a haploid or metagenome that ratio means nothing: fall back to linkage.

Trade-off. Aggressive cleaning gives a smaller, faster graph for read mapping; conservative cleaning keeps rare plasmids and alleles but grows the graph and slows alignment. Clinical variant calling: stay conservative. Read-mapping speed: you can tighten 0.2× to 0.1×.

Failure modes and detection. Allele loss: re-call variants with bcftools on the raw reads against the cleaned graph and diff the het sites; a het that vanishes is allele loss. Repeat collapse: a collapsed repeat shows ~2× inflated coverage on the merged node; check node depth against the local median. Rare plasmid removal: look for circular contigs in the raw graph that are absent after cleaning. Irreversible filtering: always emit the pre-clean GFA, the post-clean GFA, and a removal log naming every node, its local coverage and the rule that removed it; without the log you cannot audit or undo a bad clean.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-15

Distinguish allelic and error bubbles.

Answer

Assume a diploid sample, a graph built from HiFi reads at roughly 30x, and a bubble: two paths leave a node and rejoin downstream. The question is whether that bubble is a heterozygous allele or a sequencing error.

The deciding signal is coverage balance across the two branches, measured against the flanking unique sequence. A heterozygous bubble splits the diploid coverage between its two paths: each branch carries about half of the flanking coverage, and the two branches sum back to it. At 30x flanking, expect roughly 15x and 15x. An error bubble puts nearly all coverage on one branch and a handful of reads on the other, something like 29x and 1x. So the test is whether the minor branch carries about half the flanking coverage or a small fraction of it.

Why it behaves that way: both haplotypes are present in the reads at equal molarity, so both paths get traversed by half the reads. A sequencing error is a one-off event in a single read; only reads that happen to carry that error traverse the erroneous path, so its coverage tracks the error rate, not ploidy. HiFi reads run about 99.9% accurate, so a single-base error path is supported by a tiny minority of reads.

Second signal: phasing. Long reads spanning the bubble should commit to one branch or the other. If read one supports branch A and read two supports branch B, and neither read supports both, the branches sit on separate haplotypes, which is allelic. If the minor branch is only ever seen on reads that also carry the major branch's flanking sequence, it is an error.

Third: branch length and divergence. A SNP bubble is 1 bp of divergence, a short indel a few bp. Bubbles longer than roughly 100 bp are more likely repeat copies or structural variants than a point allele.

casebranch Abranch Bflankingverdict
allelic15x14x30xkeep both
error29x1x30xdrop minor branch
repeat30x30x30xresolve by read threading

Trade-offs: aggressive purging with purge_dups removes haplotigs and gives a cleaner primary assembly, but risks deleting a real allele when coverage is uneven. Retaining both branches preserves heterozygosity but inflates assembly size and can double gene copies. purge_dups derives its cutoffs from the read-depth histogram rather than fixed defaults, so inspect that histogram before trusting the split. Bandage to eyeball the bubble, Merqury to check QV and completeness after purging.

Failure modes and how to catch them:

  • Purging a true allele: assembly size drops below expectation and Merqury completeness falls. Detect by comparing k-mer completeness before and after purging.
  • Retaining both haplotypes as duplication: assembly is near twice the expected size with both copies present. Detect by coverage, since the redundant copy sits at about half depth.
  • Repeat misclassification: a collapsed repeat looks like a bubble with equal coverage on both branches. Detect by branch length and by checking whether the two branches map to different genomic locations.
  • Aneuploidy or a mixed individual: coverage ratios deviate from 1:1 in a way that is neither a clean allele nor an error. Detect from the genome-wide coverage distribution, where a trisomy gives roughly 2:1 and contamination broadens the coverage peak.

Decide on the coverage histogram across the whole assembly, not on one bubble.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-5

Distinguish error branches from biological variation.

Answer

I’d clarify the data first: short-read de Bruijn graph, long-read string graph, or a variant call set? The distinction is the same in each, but the thresholds move. Assuming a 30x Illumina 150 bp library and a de Bruijn graph, I separate error branches from biological variation by asking whether the branch is explained by the error model or by the sample’s ploidy and ancestry. Error branches are low-support, low-coverage, short, and unstable across k and samples. Biological variation is supported by reads, matches ploidy, and is stable across k and replicates.

The decisive mechanism is the k-mer spectrum. A sequencing error creates a k-mer that is not in the genome, so its multiplicity is low, usually 1–2. A true sequence k-mer has multiplicity near sequencing coverage. For k=21 and per-base error rate 0.001, the chance a 21-mer contains an error is 1 − 0.999^21 ≈ 2.1%. At 30x, true k-mers sit near count 30. A diploid heterozygous branch sits near 15x; a homozygous branch near 30x. So a branch at count 1–2 is an error candidate; a bubble with two paths each at 15x is a heterozygous allele. Tools: KMC or Jellyfish for k-mer counts, GenomeScope for the spectrum model, Merqury for assembly support, SPAdes/Flye/hifiasm for the graph, Bandage to inspect tips and bubbles.

signalerror branchbiological variationoperational test
k-mer count1–2near coverage, or half for hethistogram peak; filter count < 3
topologytip shorter than read length or kbubble with two paths longer than readinspect graph; check path length
read supportfew reads, often one strandmultiple reads, both strandsrequire ≥3 reads and strand balance
ploidyviolates expected allele balancefits 0.2–0.8 het or 0.9–1.0 homcompare to sample ploidy
replicatesabsent in independent librarypresent across replicatescheck second library or long reads

At variant level, GATK hard filters use the same logic: QD < 2, FS > 60, MQ < 40, SOR > 3 for SNPs; QD < 2, FS > 200, SOR > 10 for indels. Those test whether the evidence fits error rather than biology.

The trade-off is conservative versus aggressive removal. Conservative: keep low-support branches, retain the graph and decisions, and let later evidence decide. Aggressive: remove all low-coverage branches. Aggressive is right for a high-coverage bacterial isolate with no rare-allele interest; conservative is right for clinical, metagenomic, low-coverage, or long-read data where a rare allele or organism can look like an error.

Failure modes and detection: deleting a rare allele. Check the removed branch in an independent sample or long reads; cost is a lost clinically relevant allele. Preserving systematic error: check strand bias, position bias, homopolymer context; cost is a false variant. Coverage bias: plot coverage against GC; cost is missing regions. Mixed sample: allele balance shows multiple peaks; cost is wrong ploidy. Aggressive cutoff: compare assemblies across thresholds; cost is fragmentation. Homopolymer artifact: realign reads in homopolymers; cost is false indels. Assuming all bubbles are errors: phase the two paths; cost is collapsing heterozygosity.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-9

Assess repeat resolvability before assembly.

Answer

Core answer (first 90 seconds). Before assembly I triage every repeat class against two axes: can my data span it, and can my data tell the copies apart?

Span. A read resolves a repeat only if it covers the repeat plus a unique anchor on each side: required read length = R + 2A, with R the repeat length and A the anchor needed to place the read uniquely (50–100 bp is usually enough). For Illumina 2×150 with 350–550 bp inserts the fragment is the unit, so R + 2A ≤ ~500 bp: repeats under roughly 300 bp with unique flanks. Longer repeats, and any tandem array whose unit exceeds the read length, are invisible to short reads alone.

Identity. Copies above ~99% identity produce multi-mapping reads (MAPQ 0) and the assembler has no basis to choose between them. The rule I apply is that read accuracy must sit well below the per-copy divergence. HiFi at Q30 (99.9%) cannot separate copies that are 99.9% identical across 15 kb: ~15 true differences against ~15 sequencing errors. Copies at ≤99% identity (≈150 differences per 15 kb) are separable.

Worked example. A 12 kb segmental duplication, two copies per haplotype, 99.5% identity, unique 2 kb flanks. A read must cover 12 + 2×2 = 16 kb to span it and anchor on both sides. Treat HiFi reads as a fixed 15 kb (the N50) for the arithmetic: no read spans 16 kb, so the repeat is not resolvable at that length. The flanks anchor, the copy-to-copy join does not. Drop the repeat to 8 kb (span 12 kb) and the fraction of reads that span is (15 − 12)/15 = 20%; at 30× coverage that is ~6× spanning, enough to place both copies and phase them. At 99.5% identity the copies differ at ~60 positions across 12 kb, against ~15 errors in a Q30 15 kb read: enough signal to assign reads to copies. The N50, not the mean, is the number that decides: a repeat whose span sits at the N50 gets almost no spanning reads.

Choosing the long-range evidence.

platformspanresolvesblind to
PacBio HiFi (Revio/Sequel IIe)15–20 kb reads, >99.9% (Q30)repeats under ~10 kb with unique flanks, base-accuratearrays >20 kb; copies within ~0.1% identity
ONT ultra-long (R10.4.1)N50 50–100 kb+repeats under ~50 kb, order and orientationbase-level accuracy in homopolymers (simplex ~99% modal; duplex ~99.9%)
Hi-Ccontacts kb → whole chromosome; scaffolding resolution tens of kb–Mb at depthscaffolding and phasing across megabasesbase sequence, small arrays
optical map (Bionano DLE-1)labels ~every 6–7 kb, molecules 150 kb–2 Mbtandem copy number, 10 kb–Mb orderbase sequence

Decision rules. R + 2A inside the HiFi read length with unique flanks → HiFi alone. Array longer than a read but copy number and order still needed → add optical map or Hi-C. Copies >99.9% identical and longer than any read → no platform yields per-copy sequence; leave a gap and say so rather than emit a collapsed consensus. In a diploid, a resolved repeat still needs phasing: trio binning or Hi-C.

Failure modes and detection.

  • Collapsed copies: depth at the locus ≈ N× the single-copy depth for N collapsed copies (two copies → ~2×, not half). A region present on one haplotype only shows ~half depth. Compare the depth profile against k-mer-based copy number.
  • False join: off-diagonal Hi-C contacts; discordant read pairs.
  • Segmental duplication loss: MAPQ 0 pileup with depth inconsistent with the expected copy number.
  • Centromeric gap: a run of Ns with no spanning read.
  • Contamination: bimodal k-mer spectrum; read-level taxonomic classification.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-13

Design a long-read polishing workflow.

Answer

Core answer (first 90 seconds). Polishing is a consensus step, not an assembly step, so the workflow is: assemble, decide whether polishing can help at all, run one or two long-read rounds, optionally one short-read round, then validate with k-mers and stop when the gain falls below noise.

  1. Assemble with Flye, hifiasm or Shasta. Measure the assembly with Merqury (k=21) against the read set to get a QV and a k-mer completeness number before touching it.
  2. Gate. If the assembly is already QV ≥ 40, typical for hifiasm on HiFi, stop. Polishing a Q50 assembly with Q30 reads can only move it toward the reads' error profile. ONT simplex assemblies (roughly QV 30–35) go forward.
  3. Long-read round 1: Racon. Align reads with minimap2 (-x map-ont or -x map-hifi), run 2–4 Racon iterations. The first iteration buys the most; later ones buy about a QV point each.
  4. Long-read round 2: Medaka for ONT. Pick the model matching basecaller version, flowcell and kit (e.g. an r1041_e82_400bps_sup model for R10.4.1 sup reads). A mismatched model is worse than no polishing.
  5. Optional short-read round: Pilon or NextPolish with 30–50× Illumina. This is the only step that reliably fixes small indels, and the only one that can drag the assembly toward a reference: run it reference-free.
  6. Validate with Merfin, which flags polished bases that disagree with the read k-mers and reverts them, then re-measure with Merqury.
roundtoolinputtypical ΔQVstop signal
0Flye / hifiasmreads—QV ≥ 40 → stop
1Racon ×2–4long reads+5 to +10ΔQV < 1
2MedakaONT reads + matched model+1 to +3model mismatch
3Pilon / NextPolishIllumina+1 to +5k-mer completeness drops
checkMerfin / Merquryreads—QV regression

Figures are typical, not guarantees; measure your own.

Why it behaves this way. Consensus polishing moves each base toward the majority of aligned reads. That is the whole mechanism, and it is also the whole risk: if the read set carries a systematic error (ONT homopolymer slippage, a GC-biased short-read library) the majority is wrong and the true base gets corrected away. Over-polishing is therefore detected by watching two numbers move in opposite directions: QV climbs while Merqury k-mer completeness falls. That divergence, not the QV alone, is the signal to stop.

Trade-offs. Long-read-only polishing preserves haplotype structure and never sees a reference, but leaves small indels. Short-read polishing fixes those indels and can collapse heterozygous sites, because a haploid consensus model has no way to represent a het. For HiFi, skip polishing entirely. For a diploid ONT assembly, prefer Racon/Medaka over Pilon, or polish haplotypes separately.

Failure modes and how you catch them.

  • Over-polishing: QV up, k-mer completeness down. Merqury on the pre- and post-polish assembly.
  • Reference bias: Pilon run against a reference erases real variants and can "fix" a misassembly in the wrong direction. Rerun reference-free and diff the two assemblies.
  • Reinforcing a misassembly: polishing a collapsed repeat makes it look cleaner without making it right. Check with a second assembler or long-range links.
  • Mixed haplotypes: het SNP retention drops after polishing. Count het sites before and after.
  • Model-chemistry mismatch: Medaka with a model trained on a different basecaller version produces systematic substitutions. Pin the model hash in the pipeline and record it with the assembly.

Stopping rule. Stop when ΔQV < 1 per round, or when Merfin reports no further corrected positions. Both are cheap to compute and both are independent of the tool that did the polishing.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-17

Compare assemblies without misusing N50.

Answer

Assume I'm comparing two draft assemblies of the same genome, same read set or at least same species, and I don't have a finished reference. If I do have one, the answer changes: I'll say how at the end.

The core answer: N50 is a contiguity statistic, not a quality score. It's the length such that contigs of at least that length cover half the assembly's total bases. So it moves when you change the total span, the contig count, or the minimum contig length you kept. Comparing two N50s directly is only valid if both assemblies have the same total span and the same cutoff. Otherwise you're comparing apples to oranges.

What I actually do: run QUAST on both, and read N50 alongside total length, number of contigs, L50, largest contig, and the Nx curve. Then run BUSCO with the appropriate lineage (e.g. bacteria_odb10) for completeness, and Merqury against the raw reads for k-mer completeness and QV. Only then do I compare.

Why N50 misleads: a single chimeric join between two contigs can double N50 while creating a misassembly. Filtering out short contigs raises N50 without improving the assembly. A contaminant contig from another organism inflates total span and can inflate N50. A collapsed haplotype makes longer contigs and raises N50 while losing one copy. And an assembly that only covers 70% of the genome can have a beautiful N50 because the missing 30% is the hard, repetitive part.

Worked comparison (hypothetical numbers, same genome, same 500 bp cutoff):

metricassembly Aassembly B
total span5.0 Mb5.6 Mb
contigs10080
N501.2 Mb2.5 Mb
L5032
BUSCO (bacteria_odb10)98.5% complete92.0% complete
Merqury QV4231
Merqury k-mer completeness99.2%95.0%

B has the higher N50, but it also has 0.6 Mb more sequence, lower completeness, and a lower QV. That pattern says B is either contaminated or over-joined: the extra span is not real genome. A is the assembly I'd take forward, and I'd investigate B's joins.

When N50 is the right metric: tracking contiguity across versions of the same pipeline on the same data, with the same cutoff. Then a rising N50 with stable BUSCO and QV means real improvement. If the total span changes, switch to NG50 (uses an estimated genome size as denominator) so both assemblies are measured against the same target. If you have a reference, use NGA50 and QUAST's misassembly count: that penalizes the chimeric joins N50 rewards.

Failure modes and detection: contamination. Check total span against expected genome size, run BUSCO for duplicated or foreign lineages, or map reads from a suspected contaminant. Chimeric join: look for a contig whose GC or k-mer profile changes mid-sequence; Merqury's QV drops. Missing genome: BUSCO completeness below ~95% with high N50. Haplotype collapse: BUSCO duplicated fraction spikes. Wrong cutoff: always report the cutoff; a 1 kb cutoff versus 500 bp changes N50 by tens of percent.

The one-line rule: never compare N50 without total span, cutoff, BUSCO and a k-mer QV on the same table.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-18

Use NG50 in an assembly benchmark.

Answer

Core answer

First I'd pin down three things: is there an independent genome-size estimate I trust, what minimum contig length the benchmark uses, and whether every assembly was filtered the same way. If there's no credible G, NG50 isn't reportable: I'd fall back to N50 and say so on the slide.

Assumptions I'd state out loud: G comes from an independent estimate (flow cytometry, or a k-mer spectrum fit with GenomeScope), not from the assembly itself; every assembly in the table is filtered at the same minimum contig length; and NG50 is reported next to a completeness metric and a base-accuracy metric, never alone.

Then: NG50 is the contig length L such that contigs of length ≥ L cover half of G. I'd compute it with QUAST (--est-ref-size <G>), which also emits N50, L50 and misassembly counts when a reference is supplied. QUAST's default minimum contig length is 500 bp; I'd state whatever value the benchmark uses and hold it constant across rows.

Worked trace

G = 100 Mb. Contigs sorted descending: 30, 25, 20, 18, 15, 12, 10, 8, 7, 5, 5, 5 Mb. Assembled span 160 Mb.

  • NG50: target = G/2 = 50 Mb. Cumulative 30, 55 → crosses 50 at the second contig → NG50 = 25 Mb.
  • N50: target = span/2 = 80 Mb. Cumulative 30, 55, 75, 93 → crosses 80 at the fourth contig → N50 = 18 Mb.

The 7 Mb gap is duplication: span is 1.6× G, so N50 flatters the assembly and NG50 corrects it. Flip it, if the assembly only reached 70 Mb of span, NG50 would land below N50, which is the penalty for missing sequence.

Trade-offs

  • N50: use when G is unknown or ploidy is unclear. It's self-referential, so a wrong G can't distort it, but it rewards inflated assemblies.
  • NG50: use when G is independently established. It's the only one of the two that's comparable across assemblies of different span.
  • BUSCO (v5, e.g. vertebrata_odb10): gene-space completeness, blind to span and to intergenic gaps. High NG50 with 85% BUSCO means the assembly is contiguous where it assembled but missing whole regions.
  • Merqury k-mer completeness and QV: catches base errors and collapsed repeats that NG50 cannot see.

Failure modes and how I'd catch them

  • Wrong G: too small inflates NG50. Cross-check two independent estimates; if they disagree by more than ~10%, don't publish NG50.
  • Ploidy confusion / included alternates: both haplotypes assembled → span near 2× G and NG50 well above N50. Detect via the k-mer spectrum's heterozygosity peak and BUSCO duplication above ~10%.
  • Contamination: foreign contigs add span. Detect with FCS-GX or a GC–coverage plot (BlobTools).
  • Unequal filtering: one assembly at 1 kb, another at 500 bp. Detect by reading the min-contig setting in each stats file.
  • Collapsed repeats: copies merged, span shrinks and NG50 drops while coverage over the repeat runs ~2× expected. Detect by comparing k-mer copy number to assembly copy number (Merqury).
  • Reading NG50 as correctness: it says nothing about order, orientation or base accuracy. Detect by pairing it with QV and a reference-based misassembly count.

The cost is the same in every case: the benchmark ranks the wrong assembly first, and the decision downstream is wrong.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-20

Interpret a BUSCO report for a diploid assembly.

Answer

Assumptions first. Diploid organism, a primary assembly meant to represent one haplotype, BUSCO v5.4.x in genome mode, and a lineage dataset matched to the organism: vertebrata_odb10 for a fish, embryophyta_odb10 for a plant. If any of those is wrong, the numbers below mean something else.

The answer. The whole report is one line:

C:96.5%[S:94.1%,D:2.4%],F:1.8%,M:1.7%,n:3354

Of the 3354 conserved single-copy orthologs in vertebrata_odb10, 96.5% were recovered complete: 94.1% as single-copy, 2.4% as duplicated: 1.8% fragmented, 1.7% missing. For a diploid assembly the number that decides the interpretation is D. A clean haploid representation of a diploid genome sits near 0–2% D. Above roughly 5% D, the assembly is carrying both haplotypes across part of the gene space: unpurged haplotigs, not biology.

Why D inflates. BUSCO calls a gene duplicated when two or more complete hits land on distinct loci. In an unpurged diploid assembly, heterozygous regions are represented twice, once per haplotype, so every BUSCO gene inside a heterozygous block scores as two complete hits. D therefore tracks the fraction of the gene space still diploid in the assembly, not the fraction duplicated in the organism. That is why D is the primary QC signal for haplotig purging (purge_dups, purge_haplotigs, or a phased Hi-C assembly).

Worked example. A diploid fish assembly returns:

C:98.2%[S:88.0%,D:10.2%],F:1.0%,M:0.8%,n:3354

Complete is high, but 10.2/98.2 ≈ 10% of complete BUSCOs are duplicated: far above the 1–2% a collapsed haploid assembly shows. Two hypotheses: unpurged haplotigs, or a recent lineage-specific whole-genome duplication. Separate them by where the duplicates sit. If they cluster in high-heterozygosity regions and the k-mer spectrum shows a second peak, purging removes them and D drops: say from 10.2% to ~1.5%. If D stays high after purging and the duplicates are spread evenly, it is WGD.

Fragmented and missing. Fragmented means the BUSCO profile is only partially covered: a gene model truncated by a gap, a scaffold break, or a mis-join. Missing means no hit at all, and it is the category to distrust. It can be true gene loss, a coverage hole in a repeat-rich region, or the wrong lineage. Check three ways: confirm the lineage is the closest available (a mammal scored against vertebrata_odb10 shows spurious missing), BLAST a few missing BUSCO proteins back to the assembly, and see whether missing genes cluster in low-coverage or repeat regions.

When BUSCO misleads. BUSCO measures gene-space completeness, not whole-genome completeness. It says nothing about intergenic, repeat, or non-coding content, and 98% BUSCO is compatible with a badly collapsed assembly. Pair it with k-mer QV and completeness (merqury, yak) for base-level errors and missing repeats, and with assembly stats for the haplotig signal.

Failure modes and detection.

FailureSymptomDetection
Wrong lineageLow C, high M across the boardRe-run with the closest odb10 lineage; --auto-lineage
Unpurged haplotigsD > 5%Purge, re-run; D should drop
True gene lossA few M, stable across lineagesBLAST missing proteins; check synteny
ContaminationLineage-specific D or M patternGC/coverage outliers; FCS, BlobTools
Dataset version driftNumbers shift between OrthoDB releasesPin the dataset version in the report
Genome vs protein modeDifferent C/F/MState the mode; never compare across modes

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-21

Create read-back assembly diagnostics.

Answer

What a read-back diagnostic is. A per-window statistic computed from the reads realigned to the assembly, plus a threshold and a clustering rule that turns the statistic into a flagged interval a reviewer can open. "Create diagnostics" means build that pipeline, not list things to look at.

Core answer (first 90 seconds). Align the reads back to the assembly with a platform-matched preset, keep the flags and CIGAR, then compute four features per 1 kb window: depth relative to the genome median, soft-clip fraction, discordant-pair fraction, and mismatch rate. Flag a window when any feature crosses its threshold, merge adjacent flagged windows into intervals, and rank intervals by how many features fire. One feature is a hint; two or more co-located is a misassembly call. State your assumptions up front: haploid or diploid, expected insert size and its SD, and the genome-wide median depth you are normalising against.

featurecomputed fromflag whensignature of
depthsamtools depth -a<0.5x or >2x genome mediandeletion (low), collapsed repeat (high)
soft-clipCIGAR S at read start/end>20% of reads clip >=10 bp at one basemisjoin, chimeric join
discordant pairsinsert size + orientation>5% of pairs beyond 3 SD or wrong orientationinversion, translocation
mismatch rateNM tag / aligned length>3x the genome-wide ratecollapsed repeat, wrong haplotype

Thresholds are starting defaults; calibrate the median and SD on the actual library.

Why each fires. A misjoin fuses the end of contig A to the start of contig B. Reads that truly span A's end have no contiguous match across the join, so the aligner soft-clips them at the join coordinate: a single-base clip spike. A collapsed repeat is the opposite: two near-identical copies merge into one segment, so reads from both copies pile onto it and depth doubles while mismatches rise from sequencing error (~0.2%) toward the inter-copy divergence. An inversion flips read orientation, so pairs map with the wrong strand and an insert size that no longer fits the library.

Worked trace: collapsed repeat. Genome has two copies of a 5 kb repeat at 30x haploid coverage each. The assembly keeps one copy. Reads from both copies map to that single segment: depth = 60x against a 30x median, i.e. 2x. The copies differ by 2% (100 bp over 5 kb), so half the reads carry ~2% divergence and the window mismatch rate lands near 1% instead of 0.2%. Two features fire in the same window: that is the call.

Shell
minimap2 -ax sr -t 16 assembly.fa R1.fq R2.fq | samtools sort -@4 -o back.bam
samtools index back.bam
samtools depth -a -q 20 -Q 20 back.bam > depth.tsv
MED=$(awk '{print $3}' depth.tsv | sort -n | awk '{a[NR]=$1} END{print a[int(NR/2)+1]}')
awk -v med="$MED" '{w=int(($2-1)/1000); d[w]+=$3; n[w]++}
  END{for(w in d){m=d[w]/n[w]; if(m<0.5*med||m>2*med) print w*1000, m}}' depth.tsv

Use -ax map-ont for ONT, bwa mem for Illumina. -a keeps zero-coverage positions, which is what makes a deletion visible.

When read-back is the wrong tool. It is circular for repeats: if the reads collapsed, the assembly collapses too, and no depth anomaly appears. It needs reads that span the join, so low coverage or short reads across a large gap give no evidence. And aligning back to the assembly inherits the assembly's own errors as reference bias. Pair it with k-mer methods (Merqury) for base accuracy and gene-based completeness (BUSCO) for missing content.

Failure modes to check before trusting a flag. A MAPQ filter silently drops multimapping reads and manufactures false zero-coverage. Duplicate reads inflate depth. The wrong preset (ONT preset on Illumina) clips everywhere. Dropped supplementary/SA records make a chimeric join look clean. And a genuinely high-copy repeat looks exactly like a collapse: confirm with the mismatch rate before calling it.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-19

Validate suspected structural errors.

Answer

What a strong candidate says first

"Structural error" means a claimed junction, order, orientation or copy number that is not in the true genome: a misassembly or a false-positive SV call. I'd assume I have the reads that produced the call, a reference, and the suspect breakpoint. I don't trust any single signal. I require that the junction be spanned by independent reads with a consistent breakpoint, that the reference allele be absent from those reads, and that the call survive a reference-free check. Only then do I break or accept sequence.

Mechanism

A true junction is spanned by reads whose alignment carries the event: a CIGAR D/I of the right size, or a supplementary alignment whose mate lands within a few bp of the breakpoint. A misassembly gives a junction that reads either don't span, or span only with soft-clips and mismatches at the join. The discriminator is spanning reads with a consistent breakpoint, not the presence of the call.

Worked check

Python 3.11. Reads are (mapq, ref_start, cigar); pos is the expected 0-based breakpoint.

Python
import re
from collections import Counter

CIGAR = re.compile(r"(\d+)([MIDNSHP=X])")
REF_CONSUMING = set("MDN=X")

def deletion_breakpoints(cigar, ref_start):
    off, out = 0, []
    for n, op in CIGAR.findall(cigar):
        n = int(n)
        if op == "D":
            out.append((ref_start + off, n))
        if op in REF_CONSUMING:
            off += n
    return out

def support(reads, pos, tol=50, min_mapq=20):
    hits = []
    for mapq, start, cigar in reads:
        if mapq < min_mapq:
            continue
        for bp, size in deletion_breakpoints(cigar, start):
            if abs(bp - pos) <= tol:
                hits.append((bp, size))
    return hits

def decide(hits, min_support=5, size_tol=50):
    if not hits:
        return "reject: no spanning reads"
    sizes = Counter()
    for _, size in hits:
        for s in list(sizes):
            if abs(s - size) <= size_tol:
                sizes[s] += 1
                break
        else:
            sizes[size] = 1
    size, n = sizes.most_common(1)[0]
    if n < min_support:
        return f"hold: {n} reads support {size} bp (need {min_support})"
    return f"accept: {n} reads support {size} bp"

Trace with pos = 1_000_000:

readmapqref_startCIGARD atsizekept
160999900100M4180D100M10000004180yes
26099995050M4180D150M10000004180yes
335999880120M4180D80M10000004180yes
412999900100M4180D100M——no, MAPQ < 20
560999900100M200D100M1000000200yes
660999000100M4180D100M9991004180no, 900 bp off
760100005050M4180D150M10001004180no, 100 bp off
86099992080M4180D120M10000004180yes
96099997030M4180D170M10000004180yes
1060999860140M4180D60M10000004180yes

support returns seven hits: six at 4180 bp, one at 200 bp. decide bins by size within 50 bp, so the Counter is {4180: 6, 200: 1}, most_common(1) gives (4180, 6), and the result is "accept: 6 reads support 4180 bp". Read 5 on its own would have looked like support; the size binning is what exposes it.

Three non-read checks on the same call: coverage inside the interval 4× against a 32× genome median (a deletion drops it); a second caller (cuteSV) placing the same breakpoint within 20 bp; breakpoint k-mers unique in the reference. All pass → accept. Any fail → hold and inspect in IGV or Samplot before touching the sequence.

Trade-offs

Long-read spanning is the strongest and cheapest per call when you already have ONT or PacBio data; it fails in low-complexity or low-coverage regions. Linked reads (10x, stLFR) phase and confirm at lower cost but resolve only larger events. Hi-C and optical maps confirm scaffold-scale misjoins but need a separate library and won't resolve a 200 bp event. Comparing two de novo assemblies (e.g. hifiasm) is the most decisive and the most expensive; use it when the call changes a clinical or release decision.

Failure modes and how to detect them

  • Reference bias: reads from a divergent haplotype map poorly and look like a deletion. Remap to a sample-specific assembly; if the call disappears, it was reference bias.
  • Repeat mapping: MAPQ 0 breakpoints. Detect with a k-mer uniqueness check on the reference around the breakpoint.
  • Chimeric reads: one read spans a junction that is a ligation artifact. Require the same breakpoint in ≥2 independent libraries or read sets.
  • Haplotype switch: a diploid assembly joins two haplotypes. Detect with trio data or Hi-C phasing; a switch shows as a junction with no read support in either parent.
  • Unsupported automated correction: a tool "fixes" a break with no read evidence. Diff before/after and require the correction be spanned by reads.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-10

How do you use Hi-C contact maps and long reads to resolve chromosome-scale scaffolding and detect structural misassemblies?

Answer

Hi-C gives you contact frequencies between loci that fall off with genomic distance: close to $P(s) \propto s^{-1}$ over megabase scales. That monotonic decay is the entire signal. Contigs on the same chromosome contact each other far more often than contigs on different chromosomes, and once order and orientation are right, contacts pile up near the diagonal. So I use Hi-C to cluster, order and orient contigs into chromosome-scale pseudomolecules, and long reads, PacBio HiFi or ultra-long Nanopore, to give those contigs gap-free contiguity across the repeats and segmental duplications Hi-C cannot see through.

The pipeline, assuming roughly 30–50× Hi-C coverage and a 4-cutter like DpnII: assemble with hifiasm or similar to get haplotype-resolved contigs, often N50 above 20 Mb. Map Hi-C reads as independent ends, discard self-ligations, unligated ends and duplicates, then normalize the matrix (ICE or equivalent). Cluster contigs by inter-contig contact density, then order and orient within each cluster to maximize near-diagonal contacts: a TSP-like problem solved by dynamic programming or greedy heuristics.

The diagnostics are what the interview turns on. An inversion shows a bow-tie: off-diagonal signal running perpendicular to the main diagonal, with density peaking at the contig's outer edge instead of the junction with its neighbour. A chimeric join shows the diagonal terminating abruptly with no cross-boundary decay. A translocation shows an off-diagonal rectangular block of high contact between two otherwise unlinked regions. A haplotype switch shows alternating checkerboard bands between maternal and paternal copies. Long reads cross-check each: a spanning read contradicting the orientation, a coverage drop or split alignment at a breakpoint, or the absence of any ultra-long read bridging two loci.

Hi-C is not always the right tool, and that is the trade-off to state.

MethodWhat it givesLimitUse when
Hi-Cchromosome-scale clustering, ordering, orientationresolution limited by contact frequency, blind below ~1 Mbno reference, sequencing-only budget
Optical mapping (Bionano)long-range restriction maps, large SVsneeds high-MW DNA, no orientation on its ownordering against a reference
Strand-seqdirect orientation, inversions, phasingsparse, needs dividing cellsfine-scale inversions, haplotypes
Genetic linkagegold-standard orderingneeds pedigree/population, low resolutionvalidating an order

Deciding criteria: with a reference and a few contigs to place, optical mapping or linkage is cheaper. If you need orientation and inversions at fine scale, Strand-seq. Hi-C is the default when you have no reference, want chromosome scale from sequencing alone, and can live with ~1 Mb resolution. It is the wrong tool for small genomes with too few contacts, for aneuploid cancer genomes with many rearrangements, or when you need base-pair resolution: Hi-C will not resolve inversions below its contact resolution.

Failure modes to name with detection: a collapsed repeat shows a focal hotspot across disparate bins and 2×+ long-read depth over the locus, fixed by unrolling via graph traversal; a mis-join is detected as a long-read coverage drop and split alignments, fixed by cutting at the breakpoint before ordering; a translocation is confirmed by the absence of spanning ultra-long reads, fixed by splitting and reassigning the contig to its matching linkage group.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-22

Validate and normalize a circular bacterial chromosome.

Answer

Let me clarify what I assume: we have a draft assembly, likely from long reads, and we want to decide if a contig is truly circular and then normalize its coordinates. The core answer: I confirm the overlap is unique and consistent, supported by reads that span the join and by coverage depth; I remove only the duplicated overlap; and I rotate the sequence to a documented origin like the dnaA gene, without changing any bases. I never trust an assembler's circular flag alone.

Why that works: a true circular chromosome has a single overlap between its ends that is not a repeat. If the assembler collapsed a repeat, the coverage across that region will be about half the genome-wide median, because two copies were merged into one. So I map reads back with minimap2 and compute coverage in 1 kb windows with samtools. For a 4.6 Mb E. coli genome at 50x, the median coverage is 50x. If the join shows 25x, I suspect a repeat collapse. I also look for reads that span the join: at least a few reads with 1 kb on each side. If no read spans the join, the circularization is a hypothesis, not a fact.

Trade-offs: for long-read assemblies with >30x coverage and spanning reads, the assembler flag (Flye's circular=true in the FASTA header, Canu's circular=true in the spec file) is usually reliable. For short-read only, repeats longer than 150 bp cannot be resolved, so circularization is unreliable; I'd use a reference-guided approach or PCR. Circlator (circlator all --min_contig_length 1000) automates the confirmation by mapping reads to the overlap. Manual inspection with Bandage is good for small genomes but doesn't scale.

Failure modes: repeat-driven false closure (coverage drop at join), duplicated terminal bases (the assembler leaves the overlap in both ends; I remove one copy), plasmid-host fusion (check for plasmid replicons with PlasmidFinder or by GC skew), orientation change (the origin rotation can flip the strand if not careful; I keep the sequence as is and only change the start), unsupported origin (no dnaA or oriC match; then I document the convention used), heterogeneous population (multiple alleles; check for variants in the join region), and coordinate-breaking release (changing coordinates breaks gene annotations; I provide a mapping file).

Here's a hypothetical but realistic trace: Flye assembles a 4,641,652 bp contig from 50x ONT reads, marked circular=true. The reported overlap is 12 kb. I map reads with minimap2 and run samtools depth. Median coverage is 50x; across the 12 kb join, coverage is 48x. I find 15 reads spanning the join with >1 kb on each side. I then rotate the sequence to start at the first base of the dnaA gene, using E. coli K-12 MG1655 (NC_000913.3) as the convention. I remove the duplicated 12 kb overlap, leaving 4,629,652 bp. I verify with a dot plot against the reference. If coverage across the join were 25x, I'd run Bandage to inspect the graph and likely reject the circularization.

CheckPassFailWhy it works
Overlap uniquenessSingle overlap, not a repeatMultiple overlaps or repeat matchA repeat can be collapsed, creating a false join
Spanning reads≥5 reads with 1 kb on each sideNo spanning readsPhysical connection proves circularization
Coverage across joinWithin 20% of median<50% of medianRepeat collapse halves coverage
OriginMatches dnaA or documented oriCNo matchReproducible coordinates

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-14

Choose a diploid assembly representation.

Answer

The 90-second answer. Assume a mammalian genome (~3.1 Gb), long reads (HiFi or ONT), and a downstream consumer that may or may not be haplotype-aware. Default to a primary-plus-alternate assembly when you need one linear coordinate system that existing aligners, variant callers and annotation pipelines already understand. Go fully phased, two haplotype FASTA files, when the biology is allele-specific: imprinting, HLA typing, compound-heterozygous loss-of-function, or structural variants that differ between homologs. With a trio, phase with it; without one, Hi-C or Strand-seq gets you most of the way. If you have many samples and care about SV-aware analysis, a pangenome graph is the third option.

Why the choice exists: a single haploid consensus collapses every heterozygous site to one base. You keep the sequence but lose which allele sits on which homolog. Phasing restores that assignment, and the deliverable is how completely and how confidently you do it.

Mechanism of primary-plus-alternate. hifiasm's default output is primary contigs plus alternate contigs. The primary is a mosaic, it picks one haplotype per region, and the alternate set carries the divergent second-haplotype sequence only where the assembler could separate it. So alt contigs are patches, not a second haplotype. That distinction is what decides the choice.

representationwhat it ispick it whenmain failure
primary + alternateone linear primary + alt contigs for divergent regionsreference-like coordinates, haplotype-unaware toolsalt contigs double-counted in coverage
fully phased (hap1/hap2)two complete FASTA, one per homologallele-specific biology, trio or Hi-C availableswitch errors, unphased gaps
pangenome graph (GFA)haplotypes as paths in a graphmany samples, SV-aware analysistooling maturity

Failure modes and how you detect them.

  • Collapse: the assembler merges homologs into one contig and heterozygous sites vanish. Detect with Merqury HapMer completeness, or dipcall showing missing heterozygous calls.
  • False duplication: one haplotype is split into two contigs and total length inflates past ~3.1 Gb plus expected divergence. Detect by inflated length and duplicated k-mers.
  • Switch error: the haplotype assignment flips mid-block. Trio phasing drives this near zero; Hi-C typically leaves a few percent. Report switch-error rate and phase-block N50, not just contig N50.
  • Sex chromosomes: a male X and Y are effectively haploid, so phasing there is trivial; the PAR is diploid and needs real phasing. Don't cite a male X phase block as evidence of phasing quality.
  • Double counting: with GRCh38-style alt scaffolds, reads from a divergent region map to both primary and alt, inflating coverage. Use alt-aware alignment or mask the alts.

Retain unresolved regions explicitly rather than silently collapsing them into the primary.

Arithmetic to put in the methods. At a heterozygous rate of roughly one per 1,000 bp, a 3.1 Gb genome carries about 3 million heterozygous sites. A phase-block N50 of 10 Mb covers about 10,000 of them; a 2% switch-error rate means roughly 200 of those are misassigned. That is the number a reviewer will ask for.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-16

How do you detect and resolve phase-switch errors and chimeric contigs in diploid long-read de novo assemblies using trio-binning or Hi-C contact maps?

Answer

Assume 30x PacBio HiFi reads, a diploid vertebrate, and an overlap-based assembler such as Hifiasm. A phase switch is a contig that changes haplotype mid-sequence; a chimera joins non-homologous loci. They need different evidence: a phase switch is syntenic, a chimera is not.

Trio-binning

Parental k-mers: $S_M = K_M \setminus K_P$ and $S_P = K_P \setminus K_M$, typically $k=21$ to $31$. Offspring reads carrying $S_M$ are maternal; those carrying $S_P$ are paternal. Hifiasm trio mode labels unitigs in the assembly graph with these k-mers rather than pre-binning reads.

Detection: slide a 100 kb window and count $S_M$ and $S_P$. A correctly phased contig has one parent's markers enriched, e.g. $M/(M+P) > 0.8$. A phase switch is an abrupt flip to $< 0.2$. Hypothetical trace: a 12 Mb maternal contig; windows 1–41 have $M/(M+P)=0.94$; window 42 drops to 0.08; windows 43–120 stay at 0.05. Break at 4.2 Mb and reassign the downstream 7.8 Mb to paternal. If the flip sits inside a 300 kb homozygous gap where $M=P=0$, use Hi-C links to the flanking heterozygous blocks to decide orientation.

Chimeras: trio k-mers may look consistent if both segments come from the same parent, so add long-read coverage and Hi-C. Zero spanning HiFi reads across a junction is a breakpoint. If Hi-C contacts stay on the same chromosome, it is a phase switch; if they jump to a different chromosome, it is a chimera. Break at the junction.

Hi-C

Align Hi-C pairs to the dual assembly. Contact frequency decays with genomic distance. For phase switches, compute cis contacts (same haplotype contig) and trans contacts (between haplotypes) in 1 Mb bins. A phase switch creates a block on the wrong haplotype: cis contacts to the rest of its assigned haplotype drop, trans contacts to the opposite haplotype rise. Hypothetical trace: an 8 Mb contig assigned to haplotype A; bins 1–3 have 92% cis to A; bin 4 has 45% cis to A and 48% trans to B; bins 5–8 have 10% cis to A and 85% trans to B. Break at 4 Mb and reassign bins 4–8 to B. Resolve by re-phasing the split blocks with a graph-based Markov random field or spectral method that maximizes likelihood under the Hi-C decay model, or by parental k-mers if trio data exist.

Chimera detection: Hi-C contacts jump from one chromosome to another; the decay continuity breaks. Combine with zero spanning long reads. Hypothetical: a 5 Mb contig; bins 1–2 contact chromosome 3, bins 3–5 contact chromosome 7; coverage at 2.1 Mb drops to 0 spanning reads. Break at 2.1 Mb; assign left to chr3, right to chr7.

ErrorTrio k-merHi-CLong-readResolution
Phase switch$M/(M+P)$ flipscis drop, trans spikeno single read bridgesbreak; reassign; re-phase
Chimeramay be consistentcontacts jump to different chromosomezero spanning readsbreak; assign to correct chromosomes

Trade-offs

Trio-binning is deterministic and resolves switches across long homozygous runs because parental k-mers do not depend on heterozygosity. It requires high-coverage parental DNA and fails in identical-by-descent regions where $S_M$ and $S_P$ are empty or ambiguous, or when parents are unavailable. Hi-C works on the individual alone, but phasing accuracy is lower and sensitive to low heterozygosity, centromeres, and segmental duplications; Hi-C signal noise there induces spurious switches. Hi-C is better for chimeras because they violate synteny. Use orthogonal validation: trio k-mers, optical maps, Strand-seq, or long-range PCR.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-12

How do you detect, separate, and screen out organellar DNA and cross-species contamination from high-coverage long-read de novo assemblies?

Answer

The 90-second answer. Three orthogonal signals separate these contigs: depth relative to the nuclear baseline, topology (circular or tandem-repeat), and taxonomic divergence. Depth alone over-filters NUMTs; taxonomy alone misses contaminants with no database hit. Use depth to nominate candidates, topology and taxonomy to confirm, and flanking-read evidence to decide NUMT versus true organelle.

Assumptions: diploid host, ~30× HiFi nuclear coverage, one assembly graph from Flye or Hifiasm, and a reference organelle genome for the clade.

Why the signals separate. Organelle genomes sit at 10²–10⁴ copies per cell, so their contigs assemble far above the nuclear baseline. Expected organelle depth ≈ nuclear depth × (organelle copies per cell ÷ nuclear ploidy). Flye records the observed value directly in assembly_info.txt: cov. is per-contig mean coverage, circ. is Y for a circular element. A mitochondrial contig shows cov. tens to hundreds of times the nuclear mean and circ. Y. A bacterial contaminant shows a GC shift plus a depth that is either a few reads' worth or wildly over-represented.

Protocol.

  1. Per-contig depth. Map reads back and read coverage off the BAM:
Shell
# minimap2 2.28, samtools 1.19
minimap2 -ax map-hifi --secondary=no asm.fa reads.fq.gz | samtools sort -@8 -o asm.bam -
samtools index asm.bam
samtools coverage asm.bam   # rname, numreads, covbases, coverage, meandepth
  1. Nominate. Flag contigs with meandepth above ~5× the assembly-wide median, circ. Y in Flye, or GC more than 2 SD from the contig GC distribution.
  2. Confirm. blastn or diamond the nominees against RefSeq organelle and RefSeq microbial; run Tiara or BlobToolKit for GC–depth–taxonomy plots. An organelle hit at >90% identity over >80% of the contig confirms organelle; a bacterial hit with no host-clade match confirms contamination. MitoHiFi automates the animal-mitogenome case: it extracts organelle reads against a reference, assembles, and circularises.
  3. Partition, don't delete. Extract organelle contigs to their own FASTA, trim the tandem overlap, circularise, and submit as a separate organelle record. Hard-filter vectors and spike-ins (UniVec, PhiX): those are never biology.

Worked example (hypothetical, 30× HiFi mammal).

ContigLengthmeandepthGCcirc.Call
ctg12.1 Mb30×41%Nnuclear
ctg216.5 kb2,400×38%Ymitochondrion
ctg33.2 Mb12×61%Nbacterial contaminant
ctg42.1 Mb30×41%Nnuclear, carries a NUMT

ctg2 is 80× the nuclear baseline and circular: extract. ctg3 is 0.4× nuclear with a 20-point GC shift and a RefSeq hit to a Proteobacterium: quarantine. ctg4 is the one that decides whether the screen is any good.

Failure mode: NUMT/NUPT. ctg4 contains a 4.2 kb segment at 92% identity to the mitochondrial reference, but its depth is 30×, not 2,400×. Depth filtering keeps it; a naive blastn-and-drop deletes a real nuclear scaffold. The deciding evidence is flanking reads: 37 HiFi reads span from nuclear sequence into the NUMT segment and out the other side. A true mitochondrial contig has no such flanks: reads run off both ends into the circular overlap.

Failure mode: the endosymbiont you need. Wolbachia in an insect, or a gut symbiont in a vertebrate, is a contaminant by sequence and essential biology for the study. Quarantine it to a separate record and let the submitter decide; do not silently drop it.

What breaks the screen. A contaminant at nuclear-like depth (a co-infecting strain, a hybrid) evades depth filtering, leaving taxonomy as the only signal. An AT-rich nuclear region can mimic organelle GC. A novel contaminant with no RefSeq hit passes taxonomy; Tiara's composition-based call is the fallback.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-23

Plan a metagenomic assembly.

Answer

Clarify before you plan. "Plan a metagenomic assembly" is underspecified. Four things change the plan: the biological question (species catalog vs. strain tracking vs. gene discovery), read type and depth, sample count and whether samples are time-series or spatial, and how much host/background DNA is present. I'd state my assumptions out loud and get agreement before running anything.

Assumptions I'll carry: short-read Illumina, ~10 Gbp per sample, 20 gut samples, goal is species-level MAGs for a comparative study.

The plan, in order.

  1. QC and host depletion. fastp or KneadData (Trimmomatic + Bowtie2 against GRCh38). Report the fraction removed. If >50% of reads are host, the microbial depth is half what the run sheet says.

  2. Decide co-assembly vs. per-sample. This is the biggest fork and it is decided by the question, not by tool preference.

  3. Assemble. MEGAHIT for scale, metaSPAdes when complexity is high and memory allows, metaFlye or hifiasm-meta if long reads exist.

  4. Bin. MetaBAT2, MaxBin2, CONCOCT, then consolidate with DAS Tool or metaWRAP.

  5. Evaluate and refine. CheckM2, GTDB-Tk, GUNC.

  6. Deliverables. MAG set with completeness/contamination, taxonomy, per-bin coverage, and the read-recruitment rate.

Why coverage decides everything. Coverage per genome = (total bp × relative abundance) / genome size. For a 4 Mbp genome in 10 Gbp:

  • 20% abundance → 2 Gbp / 4 Mbp = 500×
  • 1% → 100 Mbp / 4 Mbp = 25×
  • 0.1% → 10 Mbp / 4 Mbp = 2.5×

Both MEGAHIT and metaSPAdes need roughly ≥10–20× before a genome's k-mer graph connects. Below that it fragments or drops out. Rare-genome loss is not a bug; it is this distribution.

StageToolKey settingWhy
QC / hostKneadData, fastpBowtie2 → GRCh38remove human reads
AssemblyMEGAHITdefault k 21–141scales to hundreds of Gbp, low memory
metaSPAdesk 21, 33, 55, 77better on high-complexity, slower
metaFlye / hifiasm-metalong readsspans repeats, full rRNA operons
BinningMetaBAT2min contig 1500 bptetranucleotide + coverage
MaxBin2, CONCOCTcomplementary signals
DAS Tool / metaWRAPconsolidate to non-redundant set
EvalCheckM2ML model, no marker set needed
GTDB-Tktaxonomy
GUNCchimerism detection

MIMAG thresholds: high-quality >90% completeness, <5% contamination, plus 16S/23S/5S rRNA and ≥18 tRNAs; medium ≥50% complete, <10% contamination.

Failure modes, with detection and cost.

  • Strain collapse: two strains at >99% ANI merge into one bin. Detect via CheckM contamination >5% on a single-species bin, or heterozygous SNP density from read mapping (inStrain). Cost: you report one organism where there are two, and every strain-level conclusion is wrong.
  • Interspecies chimera: a contig joins two taxa. Detect with GUNC, or a coverage/tetranucleotide discontinuity inside a contig. Cost: inflated genome size and false gene content.
  • Rare-genome loss: below ~10×. Detect by mapping reads back (Bowtie2) and checking recruitment; if 20–40% of reads don't map, taxa are missing.
  • Conserved-gene misbinning: rRNA operons and recA pull contigs together. Detect the same rRNA contig appearing in multiple bins.
  • Inflated completeness: CheckM2 and CheckM1 disagree, or single-copy genes are duplicated.

Trade-offs and deciding criteria. Co-assembly raises per-taxon coverage and recovers rare taxa, but creates cross-sample strain chimeras and needs more memory. Per-sample preserves strain resolution but loses anything under threshold. Decide: time-series or strain tracking → per-sample; many low-depth samples and a species catalog → co-assembly. Short reads are accurate but fragmented; long reads span repeats and give complete rRNA operons but need polishing. Hybrid (assemble with long, polish with short) is the default when both exist.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-24

How do you reconstruct high-identity segmental duplications and alpha-satellite centromeric arrays that fail standard string-graph or de Bruijn graph resolution?

Answer

High-identity segmental duplications (>99.5% identity over >100 kb) and centromeric alpha-satellite higher-order repeats (HORs spanning megabases) fail standard de Bruijn graphs (DBG) and Overlap-Layout-Consensus (OLC)/string graphs because their identical unit lengths exceed standard read lengths and k-mer sizes, causing graph collapse, tangled knots, or false multi-copy bubble simplifications.

Resolving these regions requires a two-pass hybrid strategy combining high-accuracy reads (e.g., PacBio HiFi, Q20-Q30 accuracy) with ultra-long nanopore reads (ONT UL, N50 >50–100 kb, reads >100 kb):

  1. Identify Singly Unique Nucleotide K-mers (SUNKs): Extract rare or unique k-mers (typically $k=21$ to $31$) from accurate HiFi reads that occur exactly once within the duplicated or tandem region despite high background homology. In alpha-satellite arrays, divergence between HOR units or rare single-nucleotide variants (SNVs) provide variant signatures across the array.
  2. UL Read Anchoring and Path Disambiguation: Anchor ultra-long ONT reads across the collapsed subgraph using SUNK markers and variant patterns. Because an individual UL read can span 100–300 kb, it spans multiple 171-bp alpha-satellite monomers and complete HOR structural variants, providing an unambiguous physical path through the repeat.
  3. String Graph Untangling and Phased Consensus: Walk the string graph using phased UL read alignments as guides. Rather than relying on default heuristic graph reduction (e.g., tip clipping or bubble popping), enforce read-path threading: an edge is traversed only if consecutive spanning reads share the identical ordered set of SUNKs/SNVs. Polish the resulting path backbone with accurate HiFi reads to eliminate UL indel errors without collapsing paralogous copies.

Repeat Architecture vs. Resolution Strategy

Repeat ClassUnit Size / IdentityFailure Mode in GraphDisambiguation Mechanism
Segmental Duplications10 kb–500 kb; >99.5% identityCollapses into single contig; coverage spikes to $N \times$; flanking regions disconnectedSUNKs anchor HiFi reads; paralog-specific variants (PSVs) partition reads into distinct haplotypes/loci
Centromeric Alpha-Satellites171 bp monomers; HORs of 1–5 kb; total array 1–5 MbMassive tangled flower/knot topology; graph decycling aborts or introduces chimeric loopsUltra-long (>100 kb) reads spanning multiple HOR copies; unique HOR structural variants and monomer composition order

Failure Modes and Diagnostics

  • Repeat Collapse: Indicated by local depth-of-coverage doubling or multiplying (visible in BAM read-depth profiling) and truncated contig ends terminating at repeat boundaries.
  • Chimeric Misassembly: Caused by spurious overlaps between non-homologous HOR copies sharing high baseline identity; detected when paired spanning reads show inconsistent insert sizes or when UL reads have clipped, discordant supplementary alignments across the junction.
  • Paralog Gene Conversion Artifacts: Polishing repeat regions with short or unphased reads maps reads from paralog A onto paralog B, artificially homogenizing genuine biological divergence.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-25

How do you choose an assembler and assembly pipeline for a given genome and read dataset (comparing hifiasm, Verkko, Flye and similar long-read assemblers) and what evidence about the data justifies the tool choice and its key parameters?

Answer

Before naming a tool I pin down five properties of the dataset, because each one eliminates or selects an assembler: read chemistry and accuracy, coverage, ploidy and heterozygosity, genome size and repeat content, and whether trio or Hi-C data exists.

Read chemistry is the first cut. PacBio HiFi (Q20+, ~15–20 kb) and ONT R10.4.1 simplex (Q20+, --nano-hq) are high-accuracy; older ONT R9.4 and PacBio CLR are ~Q10–13 and need a different code path. hifiasm is built around HiFi and has an --ont mode for Q20+ ONT; Flye has separate --pacbio-hifi, --nano-hq and --nano-raw modes; Verkko requires both HiFi and ultra-long ONT (N50 >100 kb) and will not run on one chemistry alone.

Coverage sets the floor. A haploid bacterial genome assembles well from 30–50x ONT in Flye. A diploid vertebrate wants ≥25–30x HiFi for a primary assembly and ≥30–40x for haplotype-resolved contigs in hifiasm; Verkko's published human configuration is ~100x HiFi plus ~30–50x UL ONT. Below those, you get fragmentation or collapsed haplotypes, not a tool failure.

Ploidy and phasing data decide the mode. Haploid bacterial isolate → Flye --nano-hq, no phasing. Diploid with trio → hifiasm --trio-father/--trio-mother, which partitions reads by parental k-mers and gives near-perfect phase blocks. Diploid with Hi-C only → hifiasm --h1/--h2 or Verkko, which phase from contacts but can switch at low contact density. Diploid with neither → you get a primary/alternate pair with switch errors; say so rather than calling it phased.

Genome size and repeats decide between OLC and multiplex de Bruijn. Flye's repeat graph handles bacterial and small eukaryotic genomes well and is the pragmatic default up to a few hundred Mb. hifiasm scales to human. Verkko is tuned for large vertebrate genomes with long repeats; on a 5 Mb bacterial genome it is overkill and its UL requirement is wasted.

datasetassemblerkey flagswhy
haploid bacterium, 50x ONT R10.4.1Flye--nano-hq -g 5mrepeat graph, no phasing needed
diploid plant, 35x HiFi + triohifiasm--trio-father/--trio-motherparental k-mer phasing
diploid human, 100x HiFi + 40x UL ONTVerkkoHiFi + nano inputsUL reads bridge long repeats
diploid, 30x HiFi, Hi-C onlyhifiasm--h1/--h2contact phasing, expect switches
metagenome, 20x ONTFlye--metacoverage-aware graph

Parameters that matter: Flye -g/--genome-size (a wrong value skews the repeat graph), --asm-coverage to cap coverage on large genomes, --iterations for polishing. hifiasm -t threads, --ul for ultra-long reads in Hi-C mode, -l purge level. Verkko's k-mer sizes are tuned; don't hand-tune without a reason.

Failure modes: running Flye --nano-raw on Q20+ reads makes it treat real bases as errors and over-polish, collapsing heterozygous sites. Running hifiasm on CLR or R9.4 ONT produces garbage because the error model is wrong. Verkko without UL reads stalls or fragments. hifiasm without trio/Hi-C on a 1% heterozygous genome gives a merged primary with switch errors: detectable as a BUSCO duplication drop and abnormally long contigs. Coverage above ~100x ONT increases chimeric joins; check for coverage spikes and discordant Hi-C links.

Arithmetic: 3.1 Gb human, 30x HiFi = 93 Gb; at 15 kb N50 that is ~6.2M reads. 40x UL ONT = 124 Gb at 100 kb N50 = ~1.24M reads. With only 20x HiFi, hifiasm runs but phase blocks collapse: that is the number to check before promising a phased assembly.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-1

Design sequencing for a repeat-rich diploid genome.

Answer

What I'd say first

Assume a 1–3 Gb diploid genome that is 50–80% repetitive, and the deliverable is a phased, chromosome-scale assembly. The binding constraint is read length against the longest repeat you must resolve, not read accuracy. A repeat longer than a read cannot be spanned, so the assembler either collapses its copies into one or breaks the contig at the boundary. I size reads to the repeat distribution, not to the platform's advertised maximum.

For a 3.1 Gb human-like genome: HiFi reads with a 15–20 kb N50 at >99.9% accuracy (Q20) span LINEs (~6 kb) and most LTR retrotransposons (~10 kb). They do not span segmental duplications of 10–100 kb: those need ultra-long ONT reads (N50 50–100+ kb) or Hi-C/Bionano scaffolding.

Depth: 25–30x HiFi for a diploid. 30x × 3.1 Gb = 93 Gb of HiFi; a Revio cell yields roughly 25–30 Gb HiFi, so 3–4 cells. Add 30–60x ONT ultra-long for scaffolding and ~200M Hi-C read pairs for chromosome-scale phasing.

Choosing between the options

needpickwhylimit
span repeats >20 kbONT ultra-long, 30–60xN50 50–100+ kb crosses LTRs and duplicationsraw accuracy ~99%; polish with HiFi
base accuracy, SNP phasingPacBio HiFi, 25–30x>99.9% Q20, 15–20 kb N50cannot span >20 kb repeats
chromosome-scale haplotypesHi-C ~200M pairs, or trio binninglinks reads across megabasesswitch errors accumulate; trio needs parents

Phasing mechanism: HiFi reads carry heterozygous SNPs, so WhatsHap/HapCUT2 can phase them into blocks bounded by the distance between heterozygous sites. Hi-C adds contacts that link distant blocks, extending phase blocks to chromosome scale, but each wrong contact is a switch error, so phase blocks are only as good as the contact depth.

Failure modes and how I'd catch them

  • Collapsed repeats: assembly coverage sits near 2x the mapped-read depth in the collapsed region, and the k-mer copy number from GenomeScope disagrees with the assembly.
  • Switch errors: compare phase blocks against a trio or reference haplotype; HapCUT2 reports the switch error rate directly.
  • Degraded HMW DNA: Femto Pulse or PFGE size distribution; a modal size under 50 kb kills ultra-long libraries before sequencing starts.
  • GC bias: coverage-versus-GC plot; extreme-GC bins drop out and leave gaps.
  • Underestimated genome: GenomeScope k-mer estimate versus final assembly size; a 20% shortfall means repeats collapsed rather than absent.

Decision trigger: if the longest repeat class exceeds HiFi N50, add ultra-long ONT; if chromosome-scale haplotypes are required, add Hi-C or trio binning.

Curated: · Written: · Reviewed:

Difficulty: Hard