Skip to content
Tech Interview Prep
Technical interview guide

Phylogenetics & Evolutionary Analysis

Reconstructing evolutionary relationships from sequence data: tree-building methods, substitution models, and molecular clocks.

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

Scope: MAFFT 7; current IQ-TREE, RAxML-NG, MrBayes and BEAST documentation; ModelFinder, ultrafast bootstrap, multispecies coalescent and recombination source literature 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-1

Design and defend a phylogenetic analysis for homology and orthology.

Answer

I'd clarify scope first: are we building ortholog groups for a species tree, or assigning function to a focal gene? The pipeline changes. Assume we have predicted proteomes for 12 metazoans, one focal gene family, and we need orthologs for comparative genomics. I'd run this:

StageTool and parametersWhy
QCBUSCO odb10 >95% complete, <5% fragmented; keep longest isoform per geneRemoves isoform mix and partial models before they distort homology
Homology searchDIAMOND blastp --evalue 1e-5 --max-target-seqs 500 --query-cover 50 --subject-cover 50; HMMER hmmsearch against Pfam for domainsBLAST finds close homologs; profile HMMs catch remote homology below the BLAST threshold
ClusteringOrthoFinder with DIAMOND all-vs-all, MCL inflation 1.5, species-tree awareRecovers many-to-many ortholog groups that reciprocal best hits miss
Alignment and treeMAFFT L-INS-i, trimAl -gt 0.8, IQ-TREE -m LG+G4 -B 1000L-INS-i is accurate for <200 sequences; trimming removes flanks; ultrafast bootstrap gives support
ReconciliationSpecies tree from BUSCO concatenation; gene tree-species tree reconciliation (NOTUNG, ALE)Labels duplication and speciation nodes, so hidden paralogs become visible
SyntenyMCScanX or SynFind, 10-gene windowIndependent positional evidence when the tree is ambiguous

I'd defend the clustering choice first. Reciprocal best hits are fast but fail when a duplication precedes speciation: both copies in species A hit both copies in species B, and RBH picks one pair arbitrarily. OrthoFinder's normalized similarity scores and species-tree aware clustering keep those co-orthologs in one group. Profile HMMs matter because a domain can be homologous even when full-length identity falls below 30%. Synteny is the tie-breaker: if two genes sit in conserved blocks across species, they are positional orthologs even if the gene tree is unresolved.

Failure modes I'd watch, with detection and cost:

FailureDetectionCost if missed
Hidden paralogGene tree has a duplication node before the speciation node; synteny shows the copy on a different chromosomeOrtholog set mixes paralogs; dN/dS inflated; wrong species tree
Isoform mixMultiple peptides map to one gene model; longest isoform onlyInflates family size; tree has polytomies
ContaminationGC skew, coverage, top BLAST hit to a foreign taxonChimeric tree; false horizontal transfer
Horizontal transferAnomalous topology; no syntenic blockOverestimates duplication
Partial sequencesAlignment coverage <50%; internal stop codonsLong-branch attraction
Annotation errorFrame shifts, missing start or stopWrong homology
Circular orthologySame evidence used for clustering and validationOverfit; no independent test

Worked trace: four species, genes A1, A2, B1, B2, C1, D1. RBH gives A1-B1 and C1-D1. But A1 hits A2 at 1e-50, and B1 hits B2. OrthoFinder groups {A1,A2,B1,B2} because the duplication predates speciation. Synteny confirms A1 and B1 in one conserved block, A2 and B2 in another. So I retain co-orthologs and document the duplication.

I'd validate on 100 BUSCO genes with known orthologs; require >95% recovery. If the focal family fails, I'd fall back to manual curation with domain architecture and synteny.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-3

Design and defend a phylogenetic analysis for multiple-sequence alignment.

Answer

Core answer. Before choosing anything I pin down three facts: how many sequences, how divergent they are, and whether they are coding. Those decide the aligner. For a protein family of 50–500 sequences at roughly 30–70% identity I run MAFFT L-INS-i, trim with trimAl, and infer with IQ-TREE 2 using ModelFinder and 1000 UFBoot replicates. I defend that as the accuracy-first default and only drop to faster settings when sequence count or runtime forces it. The whole point is that downstream likelihood treats each column as a comparable homologous character, so any column that is not homologous becomes a false shared character and inflates support for the wrong clade.

Step 1: align. MAFFT L-INS-i (--localpair --maxiterate 1000) for up to ~200 sequences; G-INS-i when sequences are globally alignable end to end; FFT-NS-2 or --auto above ~2000 sequences, where L-INS-i's pairwise cost dominates. If the family is indel-rich and divergent, PRANK with +F instead: it treats insertions as rare events and resists over-aligning, at the cost of slower runtime and gappier-looking output.

Step 2: trim. trimAl -gt 0.5 drops columns that are more than 50% gaps; -automated1 is the heuristic alternative. Gblocks is the older, more conservative option. Trimming raises signal-to-noise but throws away data: on short proteins, over-trimming can leave too few columns to resolve anything.

Step 3: model and tree. IQ-TREE 2 with -m MFP picks the substitution model per partition; -B 1000 gives UFBoot support (≥95% is the usual strong-support line, SH-aLRT ≥80%). RAxML-NG is the alternative when you need its specific models; FastTree is only for a first look.

Step 4: defend. Align at least twice (MAFFT vs PRANK) and check whether the clades you care about survive. If a clade flips between alignments, the alignment is the problem, not the tree.

Shell
mafft --localpair --maxiterate 1000 family.faa > aln.faa   # L-INS-i
trimal -in aln.faa -gt 0.5 -out aln.trim.faa
iqtree2 -s aln.trim.faa -m MFP -B 1000 -T AUTO
choicewins whencost
MAFFT L-INS-i≤200 seqs, moderate divergenceslow, memory-heavy
MAFFT FFT-NS-2>2000 seqsless accurate on indels
PRANK +Findel-rich, divergentslow, gappy output
trimAl -gt 0.5gap-rich endsdiscards columns

Failure modes and how I catch them.

  • Over-alignment: non-homologous residues forced into one column create false synapomorphies and inflated support. Detect with GUIDANCE2 column scores, or by re-running PRANK and comparing the tree.
  • Paralogs: the tree tracks gene duplication, not speciation. Detect with reciprocal BLAST and a check for more than one hit per species; resolve by keeping one ortholog per species.
  • Saturation / long-branch attraction: divergent taxa cluster artifactually. Detect with a substitution-saturation plot or by removing third codon positions and re-running.
  • Wrong orientation: reverse-complemented sequences misalign. Detect with a six-frame translation or ORF check.
  • Fragmented sequences: partials misalign de novo. Add them with mafft --addfragments against the existing alignment instead.

If a clade survives two aligners, trimming, and a model swap, I will defend it. If it does not, I report the instability rather than the tree.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-4

Design and defend a phylogenetic analysis for alignment uncertainty.

Answer

I would not trust a single alignment. I would generate a set of plausible alignments, quantify per-column uncertainty, and test whether the clades I care about survive that uncertainty. Assume 50 taxa, 1,000 bp of protein-coding DNA, and a question about deep divergences.

Pipeline

  1. Align with multiple methods: MAFFT v7.505 L-INS-i, G-INS-i, E-INS-i; PRANK v.170427 +F for codon-aware; and MUSCLE v3.8.31. Vary gap open penalties (e.g., --op 1.0, 1.5, 2.0, 2.5, 3.0) to get 10 alignments.
  2. Quantify uncertainty: Run GUIDANCE2 with 100 bootstrap replicates on the MAFFT L-INS-i alignment. It returns a per-column confidence score. Filter columns with score <0.93 (the GUIDANCE default). Also run trimAl v1.4.rev15 -gappyout and -strict for comparison.
  3. Infer trees: For each alignment (untrimmed and trimmed), run IQ-TREE v2.2.0 with ModelFinder and 1,000 ultrafast bootstrap replicates (UFBoot2). Use the same model selection procedure across alignments.
  4. Compare: Compute Robinson-Foulds distances between trees. Build a consensus network in SplitsTree4. Predeclare: a clade is robust if it appears in ≥90% of alignments with bootstrap ≥70 (or posterior ≥0.95). Report unstable splits.

Mechanism

Alignment uncertainty arises because gaps and substitutions are inferred. Different gap penalties produce different alignments. Misaligned columns can create false synapomorphies or obscure true ones. Bootstrap resampling assumes columns are independent and correctly aligned. If a column is misaligned, it can be resampled and inflate support. By comparing across alignments, you see if a clade is robust to alignment uncertainty. Trimming can shift topology because removing columns changes the character matrix. If the removed columns were the only support for a clade, that clade collapses. If they were homoplastic, removing them can increase support for a wrong clade. Topology-driven trimming is circular: you use a tree to decide which columns to keep, then infer a tree from those columns, which will resemble the guide tree. A cleaner alignment is not necessarily more homologous; trimming can remove true signal.

Trade-offs

GUIDANCE2 is slow (100 bootstrap alignments) but directly measures alignment uncertainty. trimAl -gappyout is fast but only removes gap-rich columns; it does not measure uncertainty. BMGE uses a similarity matrix and can be more aggressive. I would use GUIDANCE2 as the primary filter and trimAl as a sensitivity check. If GUIDANCE2 removes >30% of columns, I would flag the alignment as too uncertain and consider adding taxa or using a different marker.

Failure modes

Failure modeDetectionOperational cost
Topology-driven trimmingCheck if trimming method uses a guide tree (e.g., Gblocks with -t=d). If so, discard.Circular support; overestimated confidence.
Excessive data lossCount columns before and after trimming. If >30% removed, flag.Reduced phylogenetic signal; unstable trees.
Nonrandom missingnessCompute per-taxon gap frequency. If a taxon has >50% gaps, trimming may remove its unique signal.Loss of taxa-specific signal; biased topology.
Codon disruptionFor coding sequences, check if trimmed columns are multiples of 3 and if reading frame is preserved. Translate and check for stop codons.Frameshift; false amino acid substitutions.
Removed rare signalCount parsimony-informative sites before and after trimming. If >20% removed, flag.Loss of rare synapomorphies; reduced resolution.
One sensitivity run hiddenPre-register analysis plan; report all sensitivity runs.Cherry-picking; irreproducible results.

Example

Start with 1,000 columns. GUIDANCE2 removes 350 columns (35%). If those 350 columns contained 50 parsimony-informative sites, and the total informative sites were 200, you lost 25% of your signal. Run IQ-TREE on the trimmed alignment. If a clade has bootstrap 95 in the untrimmed tree but 60 in the trimmed tree, that clade is sensitive to alignment uncertainty.

The defense is: if a clade survives all of this, it is robust to alignment uncertainty. If it does not, I report it as unstable.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-2

Design and defend a phylogenetic analysis for taxon sampling.

Answer

Core answer (first 90 seconds).

Before choosing anything I'd pin down three things: what the tree has to answer (deep divergences vs. a recent radiation), what data I actually have (marker type, alignment length, per-taxon missingness), and which inference method, because taxon sampling interacts with all three. Then the design: sample densely inside the focal clade, add at least two outgroups from the sister group, and treat sampling as a variable I test rather than a fixed input.

Why that shape. Parsimony, and to a lesser degree model-based methods, are misled by long-branch attraction (Felsenstein 1978): two long branches (usually sparse, fast-evolving taxa) get grouped. Adding taxa that break those branches into shorter segments reduces the chance the wrong topology wins. Zwickl & Hillis (2002) showed in simulation that adding taxa can cut phylogenetic error more than adding characters, which is the empirical basis for "more taxa beats more sequence" when the tree is the goal.

Defending the choices.

  • Outgroups: two or more, drawn from the sister group, not a distant fast-evolving lineage. A single long-branch outgroup is a standard way to root the tree in the wrong place. If the sister group is itself poorly sampled, say so and test rooting with an alternative.
  • Density vs. breadth: dense sampling inside the focal clade resolves short internodes; broad sampling places the root and polarises characters. With a fixed budget I'd add taxa rather than lengthen the alignment, up to the point where per-taxon missingness starts to dominate.
  • Missing data: Wiens & Moen (2016) argue missing data is often less harmful than dropping taxa, but the cost is real. I'd quantify per-taxon missingness and drop taxa above a threshold (commonly ~50–70% missing) only after checking they aren't the sole representative of a clade.

Sensitivity analysis: the actual defence.

Run the same pipeline on: (a) the full matrix, (b) the matrix with the most fragmentary taxa removed, (c) the matrix with the fastest/most divergent taxa removed, (d) the matrix with a different outgroup. Compare topologies with Robinson–Foulds distance and read support from UFBoot and SH-aLRT in IQ-TREE 2, or bootstrap in RAxML-NG. If the ingroup topology is stable and only the dropped taxa move, sampling is not driving the result. If the ingroup moves, the conclusion is sampling-dependent and I'd report that.

Failure modes and detection.

failurehow it shows updetection
long-branch attractionfast taxa cluster together regardless of markerremove them, rerun; topology changes
rogue taxalow support, unstable placement across replicatesRogueNaRok / rogueNaR; drop and recheck
misidentification or contaminationa taxon sits far from its congenersBLAST the sequence; check against BOLD/GenBank
redundant samplesnear-identical sequences inflate supporttreemmer or a pairwise-identity filter
sparse outgrouproot placement flips between runsadd outgroups, rerun rooting
conclusion-dependent samplingtaxa added only when they support the hypothesispre-register the sampling rule

Arithmetic. 40 taxa × 2,000 bp is 80,000 characters. Adding 20 taxa at 1,000 bp each adds 20,000 characters, a 25% increase, but also adds 20 new tips that subdivide long branches. The trade is not symmetric: characters add information about the same branches, taxa add new branches.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-5

Design and defend a phylogenetic analysis for substitution models.

Answer

Core answer (first 90 seconds). I'd fix three things before choosing a model: the data type (nucleotide or protein), whether the tree is fixed or being searched, and how the alignment is partitioned. Then the loop is partition → select → estimate → stress-test.

Assume a 2,000-site nucleotide alignment over 40 taxa, tree unknown. Partition by gene and by codon position: third positions evolve roughly 5–10× faster than first and second, so one model averaged over all three biases branch lengths and inflates support for deep nodes. Run ModelFinder (IQ-TREE) or ModelTest-NG per partition, select by BIC, search the tree with the selected model, then read the parameter estimates and rerun with the runner-up to see whether the topology moves.

The model ladder. Each rung adds parameters; the question is whether the data pay for them.

modelfree paramswhat it adds
JC690equal base frequencies, equal rates
K2P1transition/transversion ratio κ
HKY854unequal frequencies + κ
GTR85 relative exchangeabilities + 3 frequencies
GTR+G49+ gamma shape α for rate heterogeneity
LG+G4 (protein)1empirical exchangeabilities + α

Criterion. AIC = 2k − 2lnL; BIC = k·ln(n) − 2lnL. BIC penalizes parameters harder, which matters on short partitions. Worked numbers on one partition: GTR+G4 gives lnL = −12,340 with k = 9; HKY+G4 gives lnL = −12,360 with k = 5; n = 2,000 sites.

  • AIC: GTR = 18 + 24,680 = 24,698; HKY = 10 + 24,720 = 24,730. ΔAIC = 32, GTR wins.
  • BIC: ln(2000) = 7.60; GTR = 68.4 + 24,680 = 24,748.4; HKY = 38.0 + 24,720 = 24,758.0. ΔBIC = 9.6: same winner, thinner margin.

That gap is the whole argument: GTR is justified here, but on a 300-site partition the BIC penalty would flip it to HKY.

Running it. iqtree2 -s aln.fa -p partition.nex -m MFP -B 1000 -alrt 1000: MFP is ModelFinder Plus, default criterion BIC, -B is ultrafast bootstrap. RAxML-NG equivalent: --model GTR+G --all.

Failure modes and how I'd catch them.

  • Overparameterization. GTR+G4+I on a 300-site partition. IQ-TREE prints confidence intervals on α and the invariant proportion; if the α CI hits the upper bound or the invariant fraction is ~0, drop the parameter. AICc, not AIC, on small n.
  • Compositional heterogeneity. IQ-TREE's chi-square test of base composition across taxa; p < 0.05 means GC-rich taxa get pulled together regardless of history. Fix: RY-coding, or a site-heterogeneous model (CAT-GTR in PhyloBayes).
  • Saturation. Plot p-distance against GTR-corrected distance; a plateau means deep splits are noise. Xia's Iss test in DAMBE gives a number.
  • Stationarity failure. Non-homogeneous model, or drop the offending taxon and report both trees.
  • Model-selection uncertainty. Rerun with the second-best model. If the topology changes, that's the finding: report the split, not a single tree.

Defense in one line: the model is a claim about how sites change, and I defend it by showing the data prefer it under a stated criterion and that the conclusion survives the runner-up.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-6

Design and defend a phylogenetic analysis for rate heterogeneity.

Answer

Assumptions I'd state up front: a 60-taxon, 1,000-site protein-coding alignment; the goal is topology plus branch lengths, no clock; I don't yet know whether amino-acid composition is stationary across the tree. Rate heterogeneity means sites evolve at different speeds: ignore it and branch lengths compress and long-branch attraction gets worse.

Core answer. Fit a discrete gamma with four categories (+G4) as the baseline, then test whether the data justify more. In IQ-TREE 2 that's -m MFP (ModelFinder, ranked by BIC by default); in RAxML-NG, --model with --all. Four categories is standard because the discretized gamma converges fast: going to 8 categories buys a few likelihood units for two extra parameters, rarely worth it.

Why gamma. The rate distribution across sites is right-skewed (most sites slow, a few fast) and the shape parameter α controls that skew. With α=0.5 and four equal-probability categories the rates are 0.03, 0.25, 0.82, 2.89 (mean 1). So in a 1,000-site alignment roughly 250 sites are effectively frozen and 250 evolve ~3× faster than average. α→∞ collapses to equal rates; α below ~0.3 means a few hypervariable sites dominate and saturation is a real risk.

Alternatives and when to use them.

modelextra params vs +G4use when
+G4baselinedefault
+I+G+1 (p_inv)many sites, strong invariant fraction: check identifiability
+R4 (FreeRate)+3bimodal rate profile gamma can't fit
CAT-GTR / LG+C20manycomposition shifts, deep nodes, LBA risk

+I+G adds a proportion of strictly invariant sites. It often wins on BIC but is confounded with +G: a small α already piles mass near zero, so p_inv and α trade off and the pair is weakly identified unless you have many sites. FreeRate (Soubrier et al. 2012) drops the gamma constraint and estimates four free rates with mean 1: three extra parameters instead of one, but it captures bimodal profiles gamma can't. If composition shifts across the tree, a site-heterogeneous mixture (CAT-GTR in PhyloBayes-MPI, or LG+C20 in IQ-TREE) is the right tool and the standard defence against long-branch attraction in deep phylogenies.

Defence. Compare ΔBIC, not just likelihood; ΔBIC > 10 is strong. Then refit the tree under +G4 and +I+G and compare topologies, if the topology moves and ΔBIC is small, the extra parameters aren't identified and I keep the simpler model. For Bayesian runs, check maxdiff < 0.1 and ESS > 200 before trusting anything.

Failure modes and detection.

  • +I+G not identified: if p_inv > 0.5 and α < 0.3, refit without +I; if the likelihood barely drops, drop it.
  • Too few sites: rule of thumb ≥50 sites per parameter; a 200-site alignment can't support a partitioned +I+G.
  • Partition overfit: more partitions always raise likelihood. Use PartitionFinder2 or rcluster and check BIC plus per-partition site counts.
  • Saturation: plot patristic vs observed pairwise distances; if third codon positions are saturated, drop them or switch to a codon model.
  • Site dependence: gamma assumes independence across sites; use an autocorrelated model (adgamma) or a codon model if there's structure.
  • Rate class ≠ functional proof: a site in the fast category is not evidence of positive selection; that needs dN/dS (codeml, HyPhy).

If none of the extra models clears ΔBIC > 10 and the topology is stable, +G4 is the answer: simpler, faster, and defensible.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-7

Design and defend a phylogenetic analysis for partitions.

Answer

Assume we have a concatenated alignment of five protein-coding genes, 10,000 sites, and we want a maximum-likelihood species tree. The core answer: partition by biological criteria before looking at the tree, use BIC-based model selection to merge partitions, compare linked versus unlinked branch lengths, and validate with recombination and frame checks.

I would start by defining initial partitions from gene boundaries and codon positions. For protein-coding genes, splitting by codon position (1st+2nd versus 3rd) is standard because 3rd positions are often saturated and evolve under different rates. For rRNA, split by stem and loop regions. The key is to define these partitions from biology, not from the inferred topology: otherwise you risk circularity and overfitting.

Next, ensure coordinates match the concatenation. A common bug is an off-by-one error when mapping gene boundaries to the concatenated alignment. I would write a small script to verify that each partition's start and end positions correspond exactly to the original gene coordinates, using 1-based indexing consistently. For example, if gene A is 1000 bp, gene B must start at position 1001 in the concatenation.

Then, use PartitionFinder2 (Lanfear et al. 2017) to evaluate partitioning schemes. I would provide the initial partitions and a candidate set of models: GTR+G, GTR+I+G, HKY+G, and codon models like GY94 for coding genes. PartitionFinder2 searches for the best scheme under BIC, merging partitions that do not significantly improve likelihood. BIC is preferred over AIC because it penalizes parameters more heavily, reducing overfitting. With 10,000 sites, adding one parameter increases BIC by ln(10000) ≈ 9.21, so a partition must improve -2lnL by more than 9.21 to be worth keeping.

After selecting a scheme, compare linked versus unlinked branch lengths. Linked means one set of branch lengths for all partitions (proportional rates), while unlinked allows separate branch lengths per partition. In IQ-TREE 2, use -p partition_file for linked and -Q partition_file for unlinked. Compare BIC scores. Unlinked often fits better when partitions have very different rates, but it adds many parameters. I would defend linked if the BIC difference is small, because it is more parameter-efficient and less prone to overfitting.

Run the final analysis with IQ-TREE 2: iqtree -s concatenated.phy -p partition_file -m MFP -B 1000. ModelFinder Plus (-m MFP) selects the best model for each partition, and -B 1000 gives ultrafast bootstrap support. Alternatively, RAxML 8: raxmlHPC -s concatenated.phy -q partition_file -m GTRGAMMA -p 12345 -x 12345 -# 100 -f a.

Here is a hypothetical comparison of schemes for a 10,000-site alignment:

SchemePartitionsParameterslnLBIC
Unpartitioned110-50,000100,092
By gene530-49,50099,276
By gene + codon1580-49,00098,737
PartitionFinder2 merged636-49,20098,732

The merged scheme has the lowest BIC: it captures most of the likelihood gain while using fewer parameters than the full codon partition.

Failure modes and detection:

  • Off-by-one boundary: a partition includes one base from an adjacent gene. Detect by comparing partition coordinates to the original alignment. Cost: model misspecification and biased branch lengths.
  • Frame shift: codon positions misaligned. Detect by translating to protein and checking for stop codons. Cost: wrong dN/dS estimates and incorrect tree.
  • Too many parameters: BIC increases despite likelihood improvement. Detect by computing BIC and checking parameter count versus sites. Cost: overfitting and inflated support.
  • Mixed genes: a partition contains genes with different evolutionary processes. Detect by heterogeneity tests or conflicting signals. Cost: wrong topology.
  • Recombination within partition: conflicting phylogenetic signals within a partition. Detect with GARD or RDP4. Cost: incorrect branch lengths and tree.
  • Model overfit: poor predictive performance. Detect with cross-validation or information criteria. Cost: overconfident estimates.

The defence: partitioning improves model fit when substitution processes differ, but every partition adds parameters. BIC gives a principled trade-off. Defining partitions from biology avoids circularity. Comparing linked and unlinked schemes prevents unnecessary parameter inflation. Validation catches the common production misses.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-10

Design and defend a phylogenetic analysis for parsimony.

Answer

Core answer. Parsimony picks the tree that minimises the total number of character-state changes. It is a maximum-likelihood estimator in the limit of rare change under a symmetric model, so it is statistically consistent when rates are roughly equal across lineages and homoplasy is low. My design: build the matrix with an explicit gap policy, search with TBR branch swapping from many random addition replicates, measure support with bootstrap and Bremer decay, then defend the result by re-running maximum likelihood on the same matrix and reporting whether the topologies agree. Disagreement is the finding, not a nuisance to hide.

Design.

  1. Matrix. Characters are alignment columns. Fix the gap policy and record it: gaps as missing, or as a fifth state if the indels are homologous. Fifth-state coding adds steps and can move topology, so the choice is a stated assumption, not a default.
  2. Search. Above ~15 taxa, exhaustive search is out; use a heuristic. PAUP* or TNT with TBR swapping and 100+ random addition replicates to escape local optima. Parsimony has no substitution parameters, so there is no ModelFinder step.
  3. Support. Nonparametric bootstrap (1000 replicates) plus Bremer support (decay index) for clades bootstrap leaves unresolved.
begin paup;
  set criterion=parsimony;
  hsearch addseq=random nreps=100 swap=tbr;
  bootstrap nreps=1000;
end;

Defence, when parsimony is the right call. Use it when characters are few and mostly independent, rates are near-equal, and you want a model-free result you can explain without defending a substitution model. Do not use it when rates are strongly unequal, or when the tree has long branches separated by short internals: the Felsenstein zone.

Why minimum-change fails under unequal rates. Parsimony counts every shared derived state as evidence of grouping. On two long, non-sister branches, independent changes to the same state are common, and parsimony reads those parallel changes as synapomorphies. A likelihood model with a branch-length parameter knows a long branch is likely to change, so it discounts the coincidence. As sites increase, parsimony converges on the wrong tree: it is inconsistent, not merely noisy.

Illustrative figures: two-state characters, long-branch change probability 0.3 per site, internal branch 0.02. Parallel changes to the same state on the two long branches occur at roughly 0.045 per site; true synapomorphies at roughly 0.02. Over 10,000 sites that is ~450 misleading sites against ~200 informative ones. (Figures illustrative, not measured.)

Failure modes and detection.

  • Long-branch attraction: re-run ML/Bayesian on the same matrix; if the parsimony tree groups the two longest branches and ML does not, suspect it. Plot branch lengths to confirm.
  • Saturation: multiple hits erase signal. Plot substitutions against divergence; a flattening curve means saturated positions should be dropped or modelled.
  • Gap coding: run missing and fifth-state coding both ways and compare topologies.
  • Character dependence: linked characters (e.g. rRNA stem regions) violate independence and inflate bootstrap. Detect by partitioning or removing them and re-running support.

Worked Fitch trace. Tree ((A,B),(C,D)). Character 1: A=0, B=0, C=1, D=1. Post-order: node AB = {0}∩{0} = {0}, cost 0; node CD = {1}∩{1} = {1}, cost 0; root {0}∩{1} disjoint → union, cost +1. Total 1 step. Same character on ((A,C),(B,D)): AC disjoint → cost 1; BD disjoint → cost 1; root {0,1}∩{0,1} intersects → cost 0. Total 2. Character 1 supports ((A,B),(C,D)) by one step.

Character 2: A=0, B=1, C=0, D=1. On ((A,B),(C,D)): AB disjoint cost 1, CD disjoint cost 1, root intersects cost 0 → total 2. On ((A,C),(B,D)): AC = {0}∩{0} cost 0, BD = {1}∩{1} cost 0, root disjoint cost 1 → total 1. Character 2 supports ((A,C),(B,D)). Parsimony sums these: the tree with the lower total across all characters wins, and conflicting characters are exactly what bootstrap and Bremer support quantify.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-8

Design and defend a phylogenetic analysis for maximum likelihood.

Answer

First two minutes

Maximum likelihood picks the tree T, branch lengths b and model parameters θ that maximise P(D | T, b, θ). The search space is the problem: (2n−5)!! unrooted trees: 2,027,025 at n=10, ~2.8×10^74 at n=50. No exact search exists, so every run is heuristic and the real risk is a local optimum. Branch lengths are not the risk: for a fixed topology the surface is well-behaved and independent starts land on the same optimum. Two runs that disagree in log-likelihood therefore disagree about topology, and the lower one lost.

Assumptions I state up front: homologous, orthologous sequences; sites independent given the tree; a stationary, time-reversible CTMC; no recombination within a locus. What I control is model fit, search repetition, and support.

Design

  1. Alignment. Check orthology and coding frame, then base composition across taxa (χ² or matched-pairs). One skewed taxon breaks homogeneity and drags long branches together. Trim last, not first: trimAl and Gblocks remove real data and cost support.

  2. Model. ModelFinder in IQ-TREE 2 (-m MFP) selects model and rate scheme by BIC; partition multi-locus data with PartitionFinder2 first. +I and +G are partly confounded, so ModelFinder can return GTR+F+I+G with an inflated invariant-site fraction. If the BIC gap between GTR+G and GTR+I+G is under ~10, I take GTR+G.

  3. Search. Same command, different seeds:

iqtree2 -s aln.fasta -m MFP -B 1000 -alrt 1000 -T AUTO -seed 7 -pre run1

Repeat with -seed 11, -seed 13; keep the highest log-likelihood. A gap is a likelihood ratio: 5 log units is e^5 ≈ 148:1, which optimizer noise does not produce. Ten or more seeds on hard data; raise perturbation strength until the top scores agree.

  1. Support. 1000 UFBoot and 1000 SH-aLRT replicates. Call a branch supported at SH-aLRT ≥ 80 and UFBoot ≥ 95 (IQ-TREE's recommended thresholds). UFBoot resamples site log-likelihoods over bootstrap alignments instead of re-searching each replicate, so it is fast and its values are not posterior probabilities.

  2. Rival topologies. Candidates from parsimony, a Bayesian run, or constrained trees:

iqtree2 -s aln.fasta -m GTR+G -z candidates.nwk -n 0 -au -pre autest

AU p > 0.05 means not rejected, not correct; SH is the conservative companion; only the supplied candidates are tested.

Why scaling matters

Felsenstein pruning multiplies per-site conditional likelihoods down the tree. On ((A,B),C), branch lengths 0.1, 0.1, 0.3, JC69, site A=A, B=A, C=G:

  • Internal node: L(A) = p_same(0.1)² = 0.9064² = 0.8215; L(C)=L(G)=L(T) = p_diff(0.1)² = 0.0312² = 0.00097.
  • Root: 0.25 × [0.8215×0.0824 + 0.00097×(0.0824+0.7527+0.0824)] = 0.01715 → lnL = −4.07.

Each added taxon multiplies in another factor below 1, so per-site likelihoods underflow double precision at a few hundred taxa. IQ-TREE scales per site by default; a hand-rolled likelihood that does not will return −inf.

When ML is the wrong tool

MLParsimonyBayesianDistance/NJ
Assumesexplicit model, branch lengthsno branch lengthsprior + modeldistances only
Failurelocal optimalong-branch attractionprior sensitivity, MCMC lengthdiscards data
Use whendefensible point estimatelow divergence, fastneed posteriorsthousands of taxa, first look

I use ML when I need a defensible point estimate and have a model I trust. Bayesian posterior probabilities run higher than bootstrap values, so never read 0.95 as equivalent to 95.

Failure modes and detection

  • Local optimum: log-likelihood gaps across seeds. More seeds, stronger perturbation.
  • Model misspecification: a branch that moves when the fastest-evolving taxon is dropped or rate classes are added. Better model, or drop the taxa that break long branches.
  • Compositional bias: composition test in step 1. Composition-heterogeneous model, or drop the taxon.
  • Rogue taxa: removing one taxon raises UFBoot on several branches. Name it and flag it; do not delete quietly.
  • Too little signal: standard bootstrap (-b 100) runs lower than UFBoot on the same alignment, and 100 replicates is too few to resolve a branch near the threshold. More data, not more replicates.

Defence

One command line per run, reproducible if I record alignment checksum, IQ-TREE version, model, seed and best log-likelihood. It attacks the failure mode that actually loses trees, local optima, with a decision rule rather than a hope; reports two support measures that fail in different directions; and tests rivals explicitly. What would change my conclusion: a log-likelihood gap that survives more seeds, an AU test that fails to reject a rival I have reason to believe, or support that collapses when the fastest taxa are removed.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-9

Design and defend a phylogenetic analysis for tree search.

Answer

What I'd say first

Assume the task is maximum-likelihood (ML) tree search: a fixed alignment of n taxa and m sites, a substitution model chosen up front, and the goal is the topology and branch lengths that maximize the likelihood. "Defend" means I have to name the search protocol, the stopping rule, and the evidence that the answer is not a local optimum.

Recommendation

Run IQ-TREE 2 as the primary search: ModelFinder to pick the substitution model, then its default search, repeated NNI hill-climbing from perturbed versions of the current best tree, with UFBoot2 (-B 1000) and SH-aLRT (-alrt 1000) for branch support. Then run RAxML-NG as an independent second search and compare the two best trees. If they differ, you have a local-optimum problem, not a result.

Why the search is hard

The number of unrooted bifurcating trees on n taxa is (2n−5)!!: 2.0×10^6 at n=10, 2.2×10^20 at n=20, ~10^74 at n=50. Exhaustive enumeration dies immediately. Likelihood as a function of topology is non-convex and multimodal, different starting trees climb to different peaks, so this is a heuristic over a rugged surface, not an optimization with a guaranteed optimum.

Why NNI vs SPR matters

NNI (nearest-neighbor interchange) swaps across one internal edge; an unrooted tree has exactly 2(n−3) NNI neighbors: 94 at n=50. That is cheap to enumerate and evaluate, but the move radius is small, so NNI hill-climbing gets stuck easily. SPR (subtree prune and regraft) has a neighborhood on the order of n², roughly 10^4 candidates at n=50, so it escapes shallow optima, but each round costs far more likelihood evaluations. TBR is larger still. The practical answer is cheap NNI moves for the bulk of the climb and larger moves (SPR, or IQ-TREE's random perturbation) to jump between peaks.

Trade-off: thoroughness vs runtime

More starting trees and larger moves raise the chance of finding the global optimum and raise wall-clock roughly linearly in the number of independent searches. RAxML-NG's default search starts from 20 trees (10 parsimony, 10 random) and hill-climbs with SPR moves; IQ-TREE 2 iterates NNI hill-climbing from perturbed trees. If the top trees from independent searches agree, extra effort buys little; if they disagree, add starts before adding bootstrap replicates.

How to compare topologies

Do not compare only lnL. Compute the Robinson-Foulds (RF) distance between the best trees from each search. ΔlnL of a few units with RF = 0 means the same tree; a large RF distance with a small ΔlnL means two competing peaks, and you should report both.

Failure modes and detection

  • Premature stop: the search halts at a local optimum. Detect by re-running from random starts; if a new start beats the best lnL, the first run stopped early.
  • Identical repeated starts: all "random" starts were seeded the same way, so they explore one peak. Detect by logging the seed and start tree per run.
  • Nondeterminism: same input, different output. Detect by fixing the seed and re-running; differing lnL means an unseeded RNG.
  • Resource cutoff: a wall-clock or memory limit kills the run mid-search. Detect by checking the log ends with a convergence line, not a truncation.
  • Retaining one log: only the best tree is kept, so you cannot tell whether the search converged. Keep every start's log.

Worked trace (figures illustrative)

n=50, GTR+G, IQ-TREE 2: start tree lnL = −48,210. After NNI hill-climbing, −47,905. Perturbation and re-climb, −47,880. Two more perturbations do not improve; stop. RAxML-NG from 20 starts returns −47,882 with RF distance 0 from the IQ-TREE tree → same peak, report it. Had RAxML-NG returned −47,700 with RF = 12, that is a second peak and the search was not done.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-11

Design and defend a phylogenetic analysis for bootstrap support.

Answer

I'd design this as a two-tier analysis: fast screen with UFBoot, then standard nonparametric bootstrap for the splits that decide the paper. Assume a single-gene or concatenated alignment, 50–200 taxa, 1,000–10,000 sites. If sites <500, bootstrap is fragile and I'd say so before interpreting any value.

Shell
iqtree2 -s aln.fa -m MFP -B 1000 -alrt 1000 -bnni -T 8 --prefix ufboot
iqtree2 -s aln.fa -m MFP -b 1000 -T 8 --prefix stdboot

-B 1000 is ultrafast bootstrap, -b 1000 is standard nonparametric bootstrap, -alrt 1000 is SH-aLRT, -bnni optimizes UFBoot trees to reduce inflation under model violation. I map every support value to a bipartition, not a node label, because rerooting changes node labels but not splits.

Mechanism: standard bootstrap resamples alignment columns with replacement, keeps the same length, re-estimates the tree under the same model, and counts how often each split appears. UFBoot resamples site log-likelihoods (RELL) and only optimizes a subset of candidate trees. That approximation is why UFBoot can be anti-conservative: if the model is wrong, RELL resampling preserves the same biased site likelihoods, so every replicate can recover the same wrong split. Standard bootstrap also preserves systematic bias, but it re-optimizes each replicate, so it is less likely to be inflated by one bad tree.

Trade-offs: 1,000 standard bootstrap replicates on 200 taxa × 5,000 sites can take days; 1,000 UFBoot replicates take minutes. SH-aLRT is a parametric test, not a resampling support; report it alongside, not instead. Bayesian posterior is a different quantity; don't compare 0.95 posterior to 95% bootstrap. For UFBoot, ≥95% is the usual strong cutoff; for standard bootstrap, ≥70% is often treated as moderate and ≥95% strong; SH-aLRT ≥80% is a common companion cutoff. These are conventions, not probabilities.

failuredetectioncost
Too few replicatesStandard bootstrap n=100 at p=0.95 gives SE = sqrt(0.95×0.05/100) = 2.2%, so 95% CI ≈ 91–99%; UFBoot prints correlation <0.99Support swings ±5 points; overconfident clades
Approximate metric mislabeledMethods say "bootstrap" but command has -B not -b; UFBoot 95 is not standard 95Reviewers compare wrong thresholds
Short alignment<500 sites; split support changes >10 points when adding 500 sitesUnstable clades
Systematic error with high support≥95% split disappears when removing fast-evolving sites or adding taxa; long-branch attractionConfident wrong tree
Cherry-picked cutoffThreshold chosen after seeing tree, e.g. calling 90% strongInflated false positives
Reroot label shiftSupport values attached to splits; compare bipartitions before/after rerootWrong clade labeled

I'd defend the design by saying bootstrap answers "how stable is this split to column resampling under this model," not "is this clade true." If the question is truth, I'd add model-fit checks: site-heterogeneous models such as CAT-GTR in PhyloBayes, posterior predictive checks, and independent loci. I'd also rerun with -m MFP and a fixed model, and with/without fast sites, then compare split support. A split that stays ≥95% UFBoot and ≥70% standard bootstrap across those runs is defensible; one that moves is not.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-12

Design and defend a phylogenetic analysis for Bayesian posterior.

Answer

Assume 15 taxa, 12,000 bp of mitochondrial protein-coding sequence, and the goal is a posterior distribution over trees and node ages. I'd run MrBayes 3.2.7a for the tree and BEAST 2.7 if I need a time-calibrated tree. The core answer: specify a partitioned GTR+Γ likelihood, set explicit priors, run two independent MCMC chains, diagnose convergence with ESS and split frequencies, run a prior-only chain, and report a 95% credible set of trees rather than one MAP tree.

DecisionSettingDefensible reason
LikelihoodGTR+Γ, 4 rate categories, partitioned by codon positionCodon positions evolve at different rates; unpartitioned GTR+Γ underfits third positions and inflates support.
Priorsexponential(10) on branch lengths; Dirichlet(1,1,1,1) on base frequencies; uniform(0,200) on Γ shapeWeakly informative; prior-only runs show whether these drive clade support.
MCMC2 independent runs, 4 chains each, 20M generations, sample every 1,000, stop when average standard deviation of split frequencies < 0.0120M / 1,000 = 20,000 trees per run; 25% burn-in leaves 15,000 per run, 30,000 total.
DiagnosticsESS > 200 for all parameters, PSRF ~1.00, trace plots stationaryESS < 200 means the chain has not explored the posterior enough to trust credible intervals.
Summary95% credible set of trees, not one MAP treeA single MAP tree hides topological uncertainty; the credible set shows which clades are actually supported.

In RevBayes 1.1 I'd use mcmc with mvTreeScale, mvSubstitutionModel, and mnFile/mnScreen; in BEAST 2.7 I'd set logEvery=1000 and check ESS in Tracer. The prior-only run is the key defence: run the same MCMC with the likelihood disabled. If the prior-only posterior already puts 95% probability on a clade, then any support for that clade in the real run is prior-driven. If the real posterior is much narrower than the prior-only, the data are informative.

Failure modes and detection:

  • Nonconvergence: average standard deviation of split frequencies stays above 0.01 after 20M generations, or ESS < 200. Fix by longer runs, better mixing, or reparameterization.
  • Label switching: in mixture models like CAT-GTR, rate categories swap labels between runs. Detect by comparing category-specific posteriors across independent runs; if they permute, impose ordering or merge categories.
  • Model inadequacy: posterior predictive check. Simulate 1,000 alignments under the posterior and compare summary statistics such as GC content, saturation, and treeness. If the observed alignment falls in the tail, the model is wrong.
  • Posterior overconfidence: prior-only vs posterior. If the posterior is narrow but the likelihood is flat, the prior is too strong. Also compare with bootstrap: if bootstrap support is 70% but posterior is 0.99, suspect model misspecification or a strong prior.
  • Bootstrap-posterior equivalence: do not assume it. Under flat priors and large data they converge, but with strong priors or small data they diverge. Report both if the audience expects it.

Trade-offs: concatenation assumes one tree and can be overconfident with incomplete lineage sorting; a coalescent model such as *BEAST handles ILS but is slower and needs more priors. Decide by gene tree discordance. Partitioned vs unpartitioned: partitioning improves fit but adds parameters; compare with stepping-stone marginal likelihood or Bayes factors. Strict vs relaxed clock: use a strict clock if a clock test fails to reject it; otherwise use an uncorrelated relaxed clock. The posterior is a distribution, not a point estimate, and the defence is showing that the prior, likelihood, and chain all behave as claimed.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-13

Design and defend a phylogenetic analysis for MCMC convergence.

Answer

Core answer (first 90 seconds)

Assume Bayesian phylogenetic inference, MrBayes or BEAST, and the question is whether the posterior sample we're about to summarize is trustworthy. Convergence means the chains have forgotten their starting tree and are drawing from the stationary posterior. I'd defend a design on four things: independent dispersed starts, diagnostics that cover both parameters and topology, thresholds I can name, and a statement of what would make me reject the run.

Design: run at least four independent chains, each from its own random starting tree, not one chain restarted. In MrBayes that's nruns=2 nchains=4: two runs, each one cold plus three heated, with Metropolis coupling so heated chains can hop between peaks in tree space. Sample every 500 generations (the default), discard the first 25% as burn-in only after the trace shows stationarity, and watch the average standard deviation of split frequencies (ASDSF); MrBayes' default stop threshold is 0.01.

Why dispersed starts: if every chain begins at the same tree, agreement between them is guaranteed by construction and tells you nothing. Independent starts test whether the posterior is reachable from different regions.

Why topology frequencies: tree space is enormous and multimodal. A substitution rate can have ESS of 500 while the chain never visits a competing clade. Split (bipartition) frequencies across runs catch that: ASDSF is the mean absolute difference in clade posterior probabilities between runs. Parameter convergence and topological convergence are separate claims.

What ESS measures: ESS = N / τ, where τ = 1 + 2Σρ is the integrated autocorrelation time. 1000 samples with τ = 50 gives ESS ≈ 20: twenty independent draws' worth of information, not a thousand. Tracer's rule of thumb is ESS ≥ 200 per parameter.

Trade-offs

Thinning vs running longer: thinning by k cuts autocorrelation but discards samples; for the same wall-clock, running longer and thinning less usually yields higher ESS. Thinning is for storage, not convergence.

ASDSF vs parameter ESS: ASDSF can pass while a rare topology is unsampled; ESS can pass while topology is stuck. Use both.

When it fails: if ASDSF plateaus above 0.01 and runs disagree on splits, no burn-in fixes it. The chains sit in different modes. That's a model or proposal problem, not a run-length problem.

Failure modes and detection

failuredetectioncost
Low ESSTracer ESS < 200; trace driftscredible intervals too narrow
MultimodalityASDSF stuck > 0.01; runs find different topologieswrong clade support
Premature burn-intrace still trending after the cutbiased posterior
Thinning as cureESS/generation unchangedautocorrelation hidden, not removed
Numerical underflow-inf likelihoods on large treeschain stalls; fix with scaling
Summarizing unconverged samplesconsensus from mixed runsspurious topology

Defense: show the reviewer the ASDSF plot, a per-parameter ESS table, and the split-frequency comparison across runs. If those three agree, the run is defensible.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-14

Design and defend a phylogenetic analysis for rooting.

Answer

The 90-second answer. Rooting is a hypothesis about direction, not a property of the alignment. My default: root with an outgroup that is (1) demonstrably outside the ingroup, (2) as close to it as I can find, and (3) not fast-evolving. Then I re-root with at least two alternative outgroups and check that the ingroup topology and the ancestral-state reconstructions do not move. If no credible outgroup exists (the ingroup is the whole clade of interest, or every candidate is distant) I fall back to a clock or a non-reversible model, and I say which and why. In the report I publish the unrooted tree plus the rooting decision, so a reader can re-root without re-running anything.

Why outgroups fail: long-branch attraction. In a homogeneous substitution model the likelihood of a site pattern depends on the tree and its branch lengths. When the outgroup branch is long and the model is misspecified (no among-site rate variation, one average amino-acid exchange matrix) the longest ingroup branch and the outgroup branch get pulled together, and the ingroup's fast branch is placed at the base. That is the Felsenstein zone. It hits parsimony hardest, but maximum likelihood under a too-simple model too. Three ways to catch it: re-root with a second, independent outgroup and see whether the ingroup's internal topology changes; drop the fastest-evolving sites or switch to a site-heterogeneous model (LG+C20/F, or CAT-GTR in PhyloBayes); add taxa to break the long branch. Orthology is a separate trap: if the outgroup sequence is a paralog, you have rooted the tree at a gene duplication, not a speciation. Check with reciprocal BLAST and synteny before anything else.

Clock rooting. Midpoint rooting assumes an approximately clock-like tree. Test that assumption rather than assert it: PAML baseml with clock=1 against clock=0, where 2ΔlnL is approximately χ² with n−2 degrees of freedom. Worked example (hypothetical figures): five taxa, lnL_clock = −12,345.6, lnL_unclocked = −12,330.1, so 2Δ = 31.0 with df = 3; the 5% critical value is 7.81, so the clock is rejected and midpoint rooting is unjustified. Tajima's relative-rate test (in MEGA) gives the same verdict pairwise.

Non-reversible models. If the data are informative enough, a non-reversible model estimates the root position from the likelihood itself, with no outgroup. IQ-TREE 2 supports non-reversible Lie Markov models (e.g. 12.12) for this; check the version's documentation before relying on it. Compare BIC against the reversible fit, if the non-reversible model does not win, the root estimate is not worth defending.

rooting methodwhat it assumesfirst failurehow I catch it
outgroupoutgroup is outside the ingroup, orthologous, not fast-evolvingdistant outgroup plus model misspecification pulls the longest ingroup branch to the basere-root with a second outgroup; if ingroup topology moves, distrust
midpointrates are roughly clock-like across lineagesrate heterogeneity puts the root off-centrerelative-rate test, or clock LRT (baseml clock=1 vs clock=0)
non-reversible modelthe substitution model fits the datamisspecification biases the rootBIC against the reversible model

Two reporting traps. A display root is not a biological root: FigTree, iTOL and ggtree will happily draw the tree from an arbitrary node, and ape::unroot() before reporting keeps that cosmetic choice out of the figure. And ancestral states inferred before rooting are meaningless: run ape::root() or phytools::midpoint.root() first, then reconstruct. What would change my answer: if the ingroup is a single species or the clade has no outside, I drop the outgroup entirely and defend a clock or non-reversible root instead.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-15

Design and defend a phylogenetic analysis for branch lengths.

Answer

First I'd pin down what a branch length is here, because that decides everything downstream. In a maximum-likelihood tree from IQ-TREE 2 or RAxML-NG, a branch length is expected substitutions per site under the fitted substitution model: a 0.05 branch on a 1,000-site alignment is about 50 substitutions expected along that edge, not 50 observed differences. It only becomes years after a clock model and calibration. So my first move is to ask which of those two the analysis is for.

Assumptions I'd state up front: the alignment is homologous and trimmed, the model is chosen by fit rather than habit, and the tree is rooted correctly for any clock work.

For the substitution-only design: run ModelFinder (IQ-TREE 2's default) and take the BIC-best model, typically GTR+Γ4 for coding data. The Γ4 means four discrete rate categories with shape α; α near 0.2 says rates are strongly heterogeneous across sites, and fitting it matters because ignoring it inflates long branches. Then check saturation before trusting any long branch: compute the index of substitution saturation (Xia et al. 2003) or plot observed p-distance against model-corrected distance. If they diverge at the high end, multiple hits are compressing the observed differences, and the corrected length is an expectation, not a count.

Now the clock decision, which is the real trade-off:

  • No clock: report substitutions per site. Cheapest, no calibration needed, but you cannot say anything about time.
  • Strict clock: one rate for the whole tree. Few parameters, defensible when the root-to-tip regression in TempEst is tight: high R², residuals homoscedastic. Wrong when rate varies across lineages.
  • Relaxed clock: uncorrelated lognormal in BEAST 2, or MCMCtree for node-dated data. More parameters, needs more data and a calibration (fossil node or tip dates), but it is the honest choice when TempEst shows scatter.

Criteria: if the temporal signal is weak. Root-to-tip R² below roughly 0.2, or a failed date-randomization test. Don't fit a clock at all. Report substitutions and say so.

Failure modes and how I'd catch them:

  • Substitutions read as years. Newick carries no units; a 0.05 branch is subs/site unless annotated. Detect by re-parsing the file and checking the header or annotation, not by eyeballing.
  • Saturation. Detect with ISS or the distance plot above; the cost is underestimated long branches and long-branch attraction.
  • Rate heterogeneity across sites. Compare GTR against GTR+Γ by BIC; a ΔBIC of tens means the plain model is wrong.
  • Zero-length branches. Identical sequences or polytomies collapse to 0. Count them; a tree full of zeros means the alignment has no signal for those edges, and support values there are meaningless.
  • Scale lost on export. A branch of 0.05 exported to a figure without units is unreadable. Annotate units in the tree file.

Worked check: 1,000-site alignment, branch length 0.05 → 50 expected substitutions. If the observed p-distance on that pair is 0.03, the gap is multiple hits, and the corrected 0.05 is the model's expectation.

I'd defend the design by stating units, model and clock choice explicitly, and by showing the saturation and temporal-signal checks that justify each.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-16

Design and defend a phylogenetic analysis for molecular clocks.

Answer

I’d design this as a decision tree, not a single pipeline. First clarify what the clock must deliver: absolute divergence times, relative rates, or both. State assumptions: orthologous alignment, recombination screened, sampling times accurate to the year, and fossil calibrations independent. If the question is absolute dates and there are no reliable calibrations, I stop and report relative rates.

The first gate is temporal signal, not clock model. Run root-to-tip regression in TempEst: regress genetic distance from the root on sampling time. A slope with tight confidence and R² above roughly 0.5 is evidence of a clock; R² near zero is not. Then date-randomisation: permute tip dates 100–1000 times, re-estimate the rate in BEAST 2 or TreeTime. If the real-date rate falls inside the central 95% of randomised rates, there is no measurable temporal signal. I would not fit an absolute clock.

If signal exists, compare strict and relaxed. Strict clock: one rate. Relaxed: uncorrelated lognormal (UCLN) in BEAST 2, autocorrelated lognormal (ACLN), or independent rates (ILN) in MCMCtree. RelTime gives relative rates without external calibration. Choose by marginal likelihood (path sampling/stepping-stone) or Bayes factor, not AIC. I use BF > 10 as a working rule for preferring relaxed.

modelparameterswhen it fitsfailure signature
strictone rateclock-like data, homoscedastic root-to-tip residualsresidual clade rate shifts
UCLNbranch rates independent lognormalviral/short-term serial samplesrate-time confounding if no tips
ACLNrates autocorrelatedclosely related lineagesoverparameterization with few branches
RelTimerelative ratesexploratory, no external calibrationno absolute dates

Use fossil calibrations as soft bounds, not fixed points. Tip dates for serial samples. Run four independent MCMC chains, check ESS > 200 for rates, dates, and tree length, and trace/density overlap. Validate with posterior predictive checks and simulate under the fitted model.

Illustrative date-randomisation trace: 12 sequences over 15 years. Real-date rate estimate 1.2e-3 subs/site/year. 100 date-randomised replicates give a 95% interval of 0.2e-3 to 2.0e-3. The real estimate is inside, so there is no temporal signal; report relative rates. If the real estimate were 3.5e-3, outside the interval, signal exists and I proceed to a relaxed clock. These numbers are hypothetical.

failure modedetectionoperational cost
rate-time confoundingdate-randomisation; prior vs posterior overlapage estimates track the prior, CIs widen
no temporal signalroot-to-tip R² near zero; date-randomisation overlapabsolute dates unidentifiable
overparameterizationmarginal likelihood worse; ESS < 200poor mixing, false precision
broad prior driving datesprior and posterior nearly identicaldates reflect prior, not data
lineage-specific selectionbranch-site dN/dS outliers; posterior predictive checksrate overdispersion, date bias

I defend the design by tying every model choice to a test. If date-randomisation fails, I do not report absolute dates. If relaxed does not beat strict by BF > 10, I use strict. If prior and posterior for a calibration overlap, I flag the date as prior-driven. That is the analysis I would put in front of an interviewer: signal first, model second, calibration third, validation last.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-18

Design and defend a phylogenetic analysis for gene and species trees.

Answer

Core (first 90 seconds)

Three things decide the method, so I'd clarify them first: are the loci orthologous, how much incomplete lineage sorting (ILS) do I expect, and is there gene flow or paralogy. ILS is set by internal branch length in coalescent units, t / (2Ne). A branch of 2 Myr with Ne = 100,000 is 10 coalescent units and ILS is negligible; the same branch at 20 kyr is 0.1 coalescent units and ILS dominates.

My default for a species tree from many loci: infer one gene tree per locus with IQ-TREE 2 (or RAxML-NG), estimate the species tree with ASTRAL-III under the multispecies coalescent, and report discordance with gCF/sCF rather than a single consensus. ASTRAL is statistically consistent under ILS and scales to thousands of taxa.

Choosing the method

MethodInputAssumesUse whenAvoid when
Concatenation (IQ-TREE 2)alignmentsone tree for all lociinternal branches long (> ~0.5 coalescent units), low ILSanomaly zone, high ILS
ASTRAL-IIIgene treesMSC, no gene flowhigh ILS, many lociparalogy, introgression
SVDquartetssitesMSC, no gene treesshort loci, gene-tree erroryou need gene-tree detail
StarBEAST2 (*BEAST)sequencesMSC, co-estimatefew taxa, full posteriorthousands of taxa

Concatenation is inconsistent in the anomaly zone, where the most common gene tree differs from the species tree (Degnan & Salter 2005). ASTRAL avoids that but assumes no gene flow.

Failure modes and detection

  • Paralogy: a duplication inside a locus breaks the orthology assumption. Detect with OrthoFinder orthogroups or ASTRAL-Pro; cost is a biased species tree.
  • Gene-tree estimation error: short loci with weak signal. Detect by comparing IQ-TREE and RAxML-NG topologies or bootstrap support; ASTRAL accuracy degrades.
  • Recombination: one tree per locus is invalid. Detect with RDP4 or ClonalFrameML; split the locus.
  • Introgression: MSC methods assume none. Detect with ABBA-BABA (D-statistic) or QuIBL; the species tree may be wrong.
  • Too few loci: high variance. Detect by subsampling loci and plotting support; fewer than ~50 loci with high ILS is unstable.
  • Missing taxa: sparse matrices reduce accuracy. Check matrix completeness.
  • High support despite biased loci: ASTRAL localPP can be ~1.0 even when gene trees are biased. Cross-check with gCF/sCF and concatenation.

Worked check

A branch with localPP = 0.99, gCF = 28%, sCF = 31%. gCF below 33% is below the random expectation under a hard polytomy, so the branch is likely in the anomaly zone or driven by a few loci: flag it, don't report it as resolved. If gCF = 85% and sCF = 80%, the branch is well supported and concatenation and ASTRAL agree.

What would change my answer: if ABBA-BABA is significant, I'd move to a method that models gene flow (e.g., PhyloNet or a network), not ASTRAL.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-19

Design and defend a phylogenetic analysis for duplication and loss.

Answer

Assume we have sequenced genomes for a set of species, a reliable species tree, and a gene family of interest. The design: build a robust species tree, infer gene trees, reconcile under a duplication-loss (DL) model, then validate with synteny and raw sequence searches. I'd start with the species tree using ASTRAL on 1000 gene trees, or concatenated RAxML with 1000 bootstraps, and only trust nodes with >70% support. Then infer gene trees with IQ-TREE, using ModelFinder and 1000 ultrafast bootstraps. Root gene trees with an outgroup or midpoint, but verify with synteny. Reconcile with Notung or GeneRax under a DL model, with equal duplication and loss costs (typically 1 each). This yields a set of duplication and loss events.

Reconciliation works by mapping each gene tree node to a species tree node. A duplication is inferred when two gene lineages coalesce above the speciation node that separates their species. A loss is inferred when a gene lineage is absent in a species but present in its ancestor. The DL model minimizes total cost, typically 1 per duplication and 1 per loss. For example, species tree ((A,B),(C,D)), gene tree (((A1,B1),(C1,D1)),(A2,B2)). The root maps to the species root. One lineage leads to (A1,B1) and (C1,D1), the other to (A2,B2). The second lineage lacks C and D, so losses in C and D. The first lineage splits into A/B and C/D, matching speciation. So one duplication at the root, two losses. This is parsimonious.

Alternatives: DTL models add horizontal transfer, but require more parameters and can overfit; use only with evidence of transfer, like in prokaryotes. Probabilistic methods like ALE estimate rates but are slower. For most eukaryotic families, DL is sufficient.

Trade-offs: Reconciliation is sensitive to species tree error. If the species tree is wrong, events are misplaced. So test alternative topologies. Gene tree error from limited data can create false duplications. Use bootstrap support: only trust nodes >70%. Synteny resolves ambiguity: if a duplication is inferred but copies are in conserved syntenic blocks, it's likely real; if in different locations, could be transposition. Missing annotation is a trap: a species may lack a gene in annotation but have it in raw genome. Search with tBLASTn before calling a loss.

Failure modes: hidden loss. Gene present but not annotated; detect by tBLASTn. Incomplete assembly: gene missing due to gaps; check coverage or use long reads. Isoforms as copies: alternative splicing looks like duplication; map to genome and check exon structure. Horizontal transfer: gene jumps species; detect by phylogenetic placement and synteny. Wrong species tree: leads to wrong reconciliation; compare ASTRAL and concatenation, check conflict. Ancient duplication: both copies retained but synteny decayed; use outgroup and conserved flanking genes. Overconfident event placement: reconciliation may place duplications on low-support branches; bootstrap the reconciliation or use multiple methods.

Defend: This design uses a well-supported species tree, checks gene tree support, and validates with synteny and raw sequence. The main risk is species tree error, so test alternatives. The output is a set of duplication and loss events with branch support, usable for function transfer only after these checks.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-20

Design and defend a phylogenetic analysis for incomplete lineage sorting.

Answer

What I'd say first. The real question is whether the discordance among gene trees is incomplete lineage sorting or introgression, because the design has to separate them. I'd state three assumptions up front: the loci are single-copy orthologs, each is recombination-bounded so it carries one coalescent history, and the target is a bifurcating species tree rather than a network. Then the design is: assemble 500–2000 independent loci, infer each gene tree, infer the species tree under the multispecies coalescent with ASTRAL-III, test whether the discordance exceeds the coalescent's own prediction, and only if it does, test introgression with the ABBA-BABA D-statistic. The defense rests on that fourth step: ILS produces discordance at a rate the coalescent predicts from internode length and ancestral Ne; introgression produces more than that.

Why it behaves this way. For three taxa with an internal branch of t generations and ancestral effective size Ne, the probability a gene tree matches the species tree is 1 − (2/3)e^(−T), with T = t/(2Ne) in coalescent units, and each discordant topology gets (1/3)e^(−T). Discordance is a function of T, not of how many loci you sequence. At T = 0.5 about 40% of gene trees are discordant; T = 1 gives ~25%; T = 2 gives ~9%. That is the whole reason short internodes and large ancestral populations yield discordant gene trees with no introgression: the ancestral alleles have not coalesced before the next split.

Trade-offs. With long internodes (T > 2) and few taxa, concatenation is fine and far cheaper: it and the MSC converge. Concatenation breaks when internodes are short, because it assumes one tree for all sites and gets dragged toward the most variable loci. ASTRAL-III is statistically consistent under ILS and scales to thousands of loci; full-MSC methods like StarBEAST2 or BPP are more powerful but realistically handle tens to low hundreds of loci. In the anomaly zone, five or more taxa with very short internodes, the most frequent gene tree can differ from the species tree, so even a perfect gene-tree distribution misleads; there you need the full MSC, not a greedy consensus.

Failure modes, with detection. Linked loci treated as independent inflate the effective sample size and shrink intervals: detect by checking scaffold position and recombination distance, then keep one locus per block. Paralogs inflate discordance: detect by reconciliation and synteny, then drop. Poor gene trees from short alignments add noise: filter on alignment length and bootstrap support. Introgression masquerading as ILS: detect with the D-statistic (|Z| > 3) and PhyloNet; if present, the honest answer is a network, not a tree. Biased locus selection, say conserved exons only, biases branch lengths: compare gene-tree distributions across locus classes.

Worked arithmetic.

T (coalescent units)P(gene tree matches)total discordance
0.50.600.40
1.00.750.25
2.00.910.09

So if I observe 35% discordance across 1000 loci and the estimated T is 1.0, the coalescent predicts 25%: the 10-point excess is the signal to test for introgression rather than accept ILS.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-21

Design and defend a phylogenetic analysis for recombination.

Answer

First I'd clarify whether the question is detection or tree estimation in the presence of recombination. I assume aligned homologous sequences, no major alignment errors, and the goal is a defensible phylogeny. My core answer: do not concatenate first. Run at least two independent recombination screens, infer breakpoints, partition into nonrecombining blocks, build per-block trees, and only concatenate if topologies are congruent. If recombination is pervasive, use a recombination-aware model or network, not a single tree.

StepToolStatisticThresholdWhy
ScreenRDP5p-value<0.05 Bonferroni, >=3 methodscuts rate-variation false positives
BreakpointsGARDAIC/BIC, KHp<0.05finds multiple breakpoints with gamma
BacteriaGubbinsSNP densityp<0.05removes recombinant blocks
BacteriaClonalFrameMLR/theta95% CIestimates recombination rate
Block treesIQ-TREEGTR+gamma1000 bootstrapper-block topology
IncongruenceAU testp-value<0.05tests topology differences

For viral or mixed datasets, I run RDP5 with RDP, GENECONV, BootScan, MaxChi, Chimaera, and 3Seq. I require p < 0.05 after Bonferroni correction and at least three methods agreeing on the same breakpoints. That agreement is the defence against rate-variation false positives: MaxChi and BootScan can mistake a fast-evolving region for a recombinant one. I then run GARD with gamma rate variation, which searches breakpoints by genetic algorithm and reports AIC/BIC and KH-test p-values; I keep breakpoints with p < 0.05. For bacterial genomes, I use Gubbins with GTR+gamma and a p < 0.05 threshold to remove recombinant blocks, and ClonalFrameML to estimate R/theta, the relative rate of recombination to mutation, with 95% credible intervals.

I partition the alignment at the breakpoints. I require each block to have at least 500 bp and 20 parsimony-informative sites; below that, breakpoint uncertainty dominates and I merge blocks or switch to a network. I build per-block trees with GTR+gamma and 1000 bootstrap replicates. I compare topologies with Robinson-Foulds and an AU test. If the AU test rejects a single topology at p < 0.05, I report a network (SplitsTree) or an ancestral recombination graph (Relate or ARGweaver for small datasets). I then test the key conclusion (clade support, dating, ancestral state) in every block. If it holds in all blocks, concatenation is defensible; if not, the conclusion is recombination-dependent.

Worked example: a 10 kb alignment with a 2 kb recombinant block. Concatenation gives that block 20% of the weight. If the block supports a different topology, the concatenated bootstrap can still be >95% for the wrong clade because the other 8 kb dominates. Per-block trees expose the conflict; the AU test rejects the concatenated topology.

Failure modes and detection:

  • Rate variation false positives: rerun with gamma and require three methods; cost is false breakpoints that split the alignment and lose power.
  • Missed ancient recombination: signal erodes with substitutions; use ClonalFrameML or ARG methods; cost is underestimating recombination.
  • Breakpoint uncertainty: bootstrap breakpoint positions; require >=500 bp blocks; cost is wrong partitioning.
  • Selection confounding: test dN/dS and Tajima's D; cost is false positives from convergent substitutions.
  • Concatenated high support: compare per-block trees; if incongruent, concatenated bootstrap is misleading; cost is a wrong topology.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-22

Design and defend a phylogenetic analysis for horizontal transfer.

Answer

I'd clarify first: are we testing one candidate gene or screening a whole genome? I'll assume a bacterial genus with 10–20 closed genomes, one outgroup, and short reads at ≥30×. The core answer: build a species tree from 100–200 single-copy core genes, build a gene tree for the candidate, and ask whether the gene tree is statistically incompatible with the species tree. If it is, corroborate with synteny, composition, mobile elements and taxonomic distribution. Only then call horizontal transfer. A transferred locus is a real history, but it is the wrong marker for a vertical species tree; I exclude it from the species tree and analyse it separately.

Species tree: BUSCO or CheckM to pick single-copy orthologs; MAFFT to align; trimAl to trim; concatenate; IQ-TREE 2 with LG+G4 and 1,000 ultrafast bootstraps. If incomplete lineage sorting is likely, use ASTRAL-III on individual gene trees instead. Gene tree: same alignment, model test, 1,000 UFBoot. Discordance: AU or SH test; I reject the species-tree topology at p<0.05 and require the donor-recipient topology at ≥95% bootstrap or ≥0.95 posterior. In ASTRAL, I look for the donor clade's local posterior probability >0.95; a quartet score of 0.7 is suggestive, not decisive.

Worked example (hypothetical): 12 Enterobacteriaceae genomes, 1,024 core genes. Species tree from 120 single-copy orthologs. Candidate yhhA: gene tree places it with Salmonella at 98% bootstrap; AU test p=0.003 against the species tree. Synteny: yhhA flanked by an IS1 and a 12-kb prophage; GC 41% vs recipient 52%, donor 40%. Coverage 45×, no assembly gaps. Call HGT from Salmonella to E. coli. If coverage were 3× or the gene sat on a 200-bp contig with no mate-pair support, I'd call contamination first.

Defence: no single line is enough. Synteny alone can be rearrangement; GC alone can be convergence; a gene tree alone can be paralogy or incomplete lineage sorting. I require at least two independent lines: phylogenetic discordance plus either mobile-element association or anomalous composition. I check orthology with reciprocal best hits and synteny: if the gene has two copies, one in each species, it's ancient paralogy, not HGT. Gene conversion: scan the alignment for mosaic tracts with RDP4 or ClonalFrameML; if the gene is a mosaic of donor and recipient, the history is not a clean transfer. Unsampled donor: if the gene branches sister to a known donor with a long branch and no close relative, I report 'donor unsampled' rather than naming a species. Taxonomic distribution: if the gene is patchy across the genus and absent from close relatives, that supports HGT; if it is present in all, it is likely vertical.

Trade-offs: concatenation is simple but assumes no HGT and can be pulled by the transferred gene; ASTRAL handles ILS but not reticulation; PhyloNet models reticulation but needs many loci and can overfit. For a full reconciliation, RANGER-DTL or ALE can estimate transfer, duplication and loss; I use them as a second line, not the primary call. I would not use this design when there is only one locus, no outgroup, no donor sampling, or recombination so high that no single gene tree is meaningful. Then I'd use a screening tool such as HGTector or GIPSy and treat the result as a hypothesis.

Failure modes and detection: contamination (read mapping, coverage, GC skew, negative controls; sparse sampling) add genomes, check with rarefaction; ancient paralogy, synteny and gene duplication; compositional convergence, compare multiple genes and codon usage; donor unsampled, long branch and no close relative; gene conversion, mosaic alignment; species claim from one locus. Require multiple loci. Operational cost: each extra check adds a day of manual curation; the AU test and RDP4 are cheap, but closing genomes and re-sequencing are not.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-23

Design and defend a phylogenetic analysis for long-branch attraction.

Answer

Core answer (first 90 seconds)

Assume a fixed alignment (say 5,000 amino-acid sites across 40 taxa) and a question about deep divergences where some lineages evolve several times faster than others. Long-branch attraction (LBA) is the failure where two or more fast, non-sister lineages are grouped because they share homoplasy, parallel and convergent substitutions, rather than synapomorphy. Parsimony is statistically inconsistent under these conditions (Felsenstein 1978): more data make it more confidently wrong. ML and Bayesian inference are consistent only if the model is right, so the design has to attack the data and the model together.

My plan, in the order I would defend it:

  1. Break the long branches with taxon sampling. Adding intermediate taxa splits a long branch into shorter segments, so the probability of parallel change on two branches falls. This is the single most effective remedy when the taxa exist (Hillis 1996; Graybeal 1998). Cost: requires new data.
  2. Fit a model with among-site rate and composition variation. Site-homogeneous models (LG+G4) still assume one amino-acid equilibrium; site-heterogeneous models (CAT-GTR in PhyloBayes, or profile mixtures LG+C20/C60 and GHOST in IQ-TREE 2) let different sites have different equilibrium frequencies and are the current defence against LBA from substitutional heterogeneity.
  3. Check saturation and composition before trusting a topology. A chi-square test of composition (p<0.05) flags heterogeneous taxa; RY-coding (nucleotides) or Dayhoff-6/SR4 recoding (amino acids) reduces saturation and composition bias at the cost of resolution.
  4. Compare methods and require convergence. Parsimony, ML under site-homogeneous and site-heterogeneous models, and Bayesian CAT-GTR should agree; where they disagree, the disagreement is the finding.
Shell
# IQ-TREE 2: model selection with rate heterogeneity, then a mixture model
iqtree2 -s aln.faa -m MFP -mset LG,WAG,JTT -mrate G,R,I -bb 1000 -alrt 1000
iqtree2 -s aln.faa -m LG+C60+F+G4 -bb 1000

# Likelihood mapping: how much of the signal is resolved at all
iqtree2 -s aln.faa -lmap 10000 -wql

# PhyloBayes-MPI: site-heterogeneous CAT-GTR
mpirun -np 4 pb_mpi -d aln.faa -cat -gtr chain1

Likelihood mapping draws 10,000 random quartets; if more than ~30% fall in the central unresolved region, the data carry little signal for those quartets and any resolved topology there is suspect.

Why the remedies work: the arithmetic. In the Felsenstein zone, take two long branches each with expected 0.5 substitutions/site and a true internal branch of 0.05. The chance of a substitution on a long branch is 1 − e^(−0.5) ≈ 0.39, so two independent parallel changes occur with probability ≈ 0.39² ≈ 0.15 per site. The true synapomorphy signal is 1 − e^(−0.05) ≈ 0.049. Homoplasy outweighs the real signal roughly three to one, which is exactly why parsimony groups the long branches. (Illustrative figures, not a measurement.)

Trade-offs and deciding criteria. Parsimony is fast and model-free but inconsistent here: I would not use it for deep divergences with rate heterogeneity. ML with a site-homogeneous model is consistent only if the model is right; misspecification reintroduces the bias. CAT-GTR is the most robust to among-site heterogeneity but is expensive, PhyloBayes chains can run for days to weeks, and can over-split. Recoding reduces composition and saturation bias but discards information and lowers resolution. Deciding criteria: if taxa are sparse and branches long, prioritize taxon addition; if composition is heterogeneous, recode or use a heterogeneous model; if signal is weak, report likelihood-mapping and topology tests rather than a single tree.

Failure modes and detection. A distant outgroup is itself a long branch: detect by re-running with alternative or multiple outgroups, or with a non-reversible model and no outgroup. Compositional heterogeneity: chi-square p<0.05, or posterior predictive checks. Site-rate misspecification: ModelFinder BIC comparison of +G4 vs +I+G4 vs +R. Strong bootstrap on the wrong topology: bootstrap measures support under the fitted model, not correctness. Detect with the approximately unbiased (AU) test across candidate topologies and by re-analysis under a different model. If the AU test rejects the ML tree under CAT-GTR, the ML tree is the artefact.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-17

How do you test hypotheses of continuous phenotypic trait evolution across a phylogeny, specifically contrasting Brownian Motion and Ornstein-Uhlenbeck models?

Answer

Brownian Motion (BM) models neutral drift or fluctuating directional selection where trait variance accumulates linearly with time: $dX(t) = \sigma dW(t)$, parameterized by diffusion rate $\sigma^2$ and root state $X_0$. Under BM, trait values across tip taxa follow a multivariate normal distribution $\mathbf{X} \sim \mathcal{N}(X_0 \mathbf{1}, \sigma^2 \mathbf{C})$, where covariance matrix element $C_{ij}$ is the shared branch length (time from root to most recent common ancestor) between taxa $i$ and $j$.

An Ornstein-Uhlenbeck (OU) process adds a deterministic restoring force toward an adaptive optimum $\theta$: $dX(t) = -\alpha(X(t) - \theta)dt + \sigma dW(t)$. Parameter $\alpha$ represents rubber-band pull strength (adaptation rate), creating an phylogenetic half-life $t_{1/2} = \frac{\ln(2)}{\alpha}$. When $\alpha \to 0$, OU reduces to BM. For an ultrametric tree of total depth $T$, tip variance reaches stationary equilibrium $\frac{\sigma^2}{2\alpha}$ when $T \gg t_{1/2}$, and phylogenetic covariance decays exponentially: $\text{Cov}(X_i, X_j) = \frac{\sigma^2}{2\alpha} e^{-\alpha d_{ij}} (1 - e^{-2\alpha t_{ij}})$, where $d_{ij}$ is the phylogenetic distance between tips and $t_{ij}$ is root-to-ancestor time.

Model Comparison Workflow

  1. Phylogenetic Variance-Covariance Matrix Construction: Build $\mathbf{V}{\text{phy}}$ from time-calibrated branch lengths (BEAST output in Newick/Nexus). Add intraspecific measurement error by adding a diagonal matrix $\mathbf{V}{e} = \text{diag}(\text{SE}i^2)$ such that total variance is $\mathbf{V} = \mathbf{V}{\text{model}} + \mathbf{V}_{e}$.
  2. Optimization: Maximize log-likelihood $\ln L = -\frac{N}{2}\ln(2\pi) - \frac{1}{2}\ln|\mathbf{V}| - \frac{1}{2}(\mathbf{X} - \mathbf{\mu})^T \mathbf{V}^{-1} (\mathbf{X} - \mathbf{\mu})$ using generalized least squares or pruning algorithms.
  3. Model Selection: Evaluate sample-size corrected AIC ($\text{AIC}_c$). BM has 2 parameters ($X_0, \sigma^2$), single-optimum OU1 has 3 ($X_0/\theta, \sigma^2, \alpha$), and multi-optimum OUM adds $k-1$ regime optima on designated tree branches.
ModelStochastic Differential EquationFree Parameters (Ultrametric)Expected Variance at Time $T$Covariance Between Tips $i,j$
BM$dX(t) = \sigma dW(t)$2 ($X_0, \sigma^2$)$\sigma^2 T$$\sigma^2 t_{ij}$
OU (OU1)$dX(t) = -\alpha(X(t) - \theta)dt + \sigma dW(t)$3 ($\theta, \sigma^2, \alpha$)$\frac{\sigma^2}{2\alpha}(1 - e^{-2\alpha T})$$\frac{\sigma^2}{2\alpha} e^{-\alpha d_{ij}}(1 - e^{-2\alpha t_{ij}})$
White Noise$X_i \sim \mathcal{N}(\mu, \sigma^2)$2 ($\mu, \sigma^2$)$\sigma^2$$0$ ($i \neq j$)

Critical Failure Modes

  • Microevolutionary noise mistaken for OU: Omitting within-species measurement error inflates $\alpha$. Unmodelled noise shifts signal from phylogenetic structure to the tree tips, falsely penalizing BM in favor of OU.
  • Unidentifiability of root state and stationary optimum: On ultrametric trees under strong selection (large $\alpha$), ancestral state $X_0$ is unidentifiable from the optimum $\theta$. Enforce $X_0 = \theta$ or verify $t_{1/2} > 0.1 T$.
  • Overfitting multi-regime OU: Hypothesizing regime shifts on small clades without penalizing regime numbers (e.g., using surface-fitting without cross-validation) produces spurious ecological niches.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-25

How do you reconstruct ancestral character states on a phylogeny, choosing among parsimony, maximum likelihood and Bayesian methods, and quantify confidence in the reconstructions?

Answer

ASR is conditional inference: given a fixed tree with branch lengths and a model of character change, estimate states at internal nodes. The tree and the model are assumptions, not data, and most disagreements between methods trace back to them rather than to the algorithm. Choose by what you must report: parsimony for a fast, assumption-light count of changes; ML for a model-based point estimate with a likelihood; Bayesian or stochastic mapping when you need a distribution over histories.

Mechanism. For discrete characters the workhorse is the Mk model (Lewis 2001): a continuous-time Markov chain on k states with rate matrix Q. Equal-rates (ER) sets all off-diagonals equal; symmetric (SYM) forces q_ij = q_ji; all-rates-different (ARD) lets gain and loss differ. Likelihoods come from Felsenstein's pruning algorithm, O(nk²) per site. Marginal reconstruction maximizes the likelihood at each node independently; joint reconstruction (Pupko et al. 2000) finds the single most probable assignment across all nodes by dynamic programming. Marginal optima need not be jointly realizable: that is the whole difference. For continuous traits use Brownian motion or Ornstein-Uhlenbeck (Hansen 1997); ML returns ancestral values with CIs, Bayesian returns credible intervals.

Worked trace. Symmetric Mk, α=1, tree ((A:0.1,B:0.1):0.2,(C:0.1,D:0.1):0.2), tips A=0,B=0,C=0,D=1. A branch of length t changes state with probability (1−e^{−2t})/2, so a terminal branch (t=0.1) has p=0.0906 and the internal branch (t=0.2) has q=0.1648.

Subtree likelihoods: L(AB=0)=(1−p)²=0.8270, L(AB=1)=p²=0.0082, L(CD=0)=L(CD=1)=p(1−p)=0.0824.

  • Root=0: (0.8352·0.8270 + 0.1648·0.0082) × 0.0824 = 0.6920 × 0.0824 = 0.0570
  • Root=1: (0.1648·0.8270 + 0.8352·0.0082) × 0.0824 = 0.1432 × 0.0824 = 0.0118

PP(root=0) = 0.0570/(0.0570+0.0118) = 0.83. Fitch parsimony also gives root=0 with one change. Now change only the internal branch length:

Internal branchL(root=0)L(root=1)PP(root=0)
0.20.05700.01180.83
1.00.03900.02990.57

Same tips, same topology, one branch length changed, and the reconstruction went from confident to ambiguous. That is the sensitivity you have to report.

Confidence is three different numbers. Marginal PP per node (above). Joint MAP, the most probable combination, which can be lower than the product of marginals. Stochastic mapping (Nielsen 2002; Huelsenbeck et al. 2003), which samples full histories and gives a posterior distribution of transition counts: report a median and an interval, e.g. 2 gains (95% HPD 1–4). Tree uncertainty is separate: run ASR over bootstrap trees (IQ-TREE -B 1000, RAxML-NG --bs-trees) or posterior trees (MrBayes, BEAST) and report the fraction supporting each state. That fraction is not clade bootstrap support.

Failure modes. PP near 0.5 is ambiguity, not a result. Parsimony and ML disagreeing usually means unequal rates or long branches: test with a likelihood ratio or AIC. Long-branch attraction (Felsenstein zone) misplaces taxa and drags ancestral states with them. Missing taxa and polytomies violate the fixed-tree assumption. For continuous traits, BM vs OU changes the answer; compare with AICc (OUwie, mvMORPH).

R
library(ape); library(phytools)
tree <- read.tree(text="((A:0.1,B:0.1):0.2,(C:0.1,D:0.1):0.2);")
x <- c(A=0, B=0, C=0, D=1)
fit <- ace(x, tree, type="discrete", model="ARD")
fit$rates; fit$lik.anc          # q01/q10, marginal likelihoods per node
sim <- make.simmap(tree, x, model=fit$rates, nsim=1000)
describe.simmap(sim)            # posterior transition counts

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-24

How do you design a scalable near-real-time Bayesian phylogenetics pipeline for genomic pathogen surveillance to infer transmission dynamics and divergence dates under molecular clock models?

Answer

Assumptions first. Before designing anything I'd pin down three things: what decision the output drives (cluster detection, or a tMRCA that goes into an epidemiological report) how many genomes arrive per week, and the SLA. If the answer is "flag clusters within a day," full Bayesian MCMC over the whole dataset is off the table, and I'd say so up front rather than discover it at hour twelve.

The core answer is three tiers, and only the last one is Bayesian.

Tier 1, ingestion. Align each incoming consensus against a fixed reference with mafft --add new.fasta --keeplength ref.fasta, so historic coordinates never shift underneath you. Drop sequences with more than 5% ambiguous bases, frameshift indels, or missing collection dates. Then place them onto a fixed ML backbone, UShER or IQ-TREE, which is minutes of work and scales to 10^5 tips.

Tier 2, temporal signal screening. Run root-to-tip regression (TempEst) on the ML tree. Above roughly R² = 0.6 the data is clock-like enough to date; below about 0.2 there is no usable temporal signal and Bayesian tip-dating will hand you back the prior. This is also where contamination and misreported dates surface, as tips with large positive residuals.

Tier 3, focused Bayesian inference. Take the new cluster plus a stratified background sample (temporal, geographic, by lineage) capped at a few hundred tips. BEAST 2, uncorrelated relaxed lognormal clock, Bayesian Skygrid or BDSKY tree prior. Feed the ML subtree in as a starting tree with dated internal nodes; that cuts burn-in substantially.

Why the cap. Per-iteration likelihood cost is linear in tips times sites, but the iterations needed to converge grow faster than that, and each demographic parameter multiplies the problem. A Skygrid with twenty-odd population-size parameters gets slow and poorly mixed past a few hundred tips. The design choice is: don't make the Bayesian step carry the whole dataset, make it carry the question.

The arithmetic that picks the clock model. Take a substitution rate around 1e-3 subs/site/year and a 30 kb genome. A three-week outbreak window is 21/365 ≈ 0.058 years, so expected divergence across the window is 1e-3 × 0.058 × 30,000 ≈ 1.7 substitutions. Two substitutions cannot support a relaxed clock: rate and date trade off against each other. So for a short local outbreak I'd use a strict clock with an informative rate prior, and reserve the relaxed lognormal clock for multi-lineage datasets spanning months to years, where the coefficient of variation is actually estimable.

Failure modes I'd watch for. First, no temporal signal: detection is root-to-tip R² near zero, or a posterior clock rate that just mirrors the prior; mitigation is an empirical normal prior on the rate from the literature, or fix the rate and report dates as conditional on it. Second, non-convergence inside the SLA: detection is ESS below 200 on the log and tree likelihoods in Tracer, plus Gelman-Rubin across four independent chains; mitigation is collapsing the Skygrid to an exponential growth coalescent, which removes most of the parameters.

What would change the design. If the SLA is minutes rather than hours, I'd drop tier 3 entirely and report placement-based cluster assignments with ML dating, flagging that tMRCAs are point estimates without credible intervals. If the question is legal-grade, a transmission pair in a court case, I'd invert the trade-off: fewer tips, longer chains, and explicit sensitivity analysis over the clock prior.

Curated: · Written: · Reviewed:

Difficulty: Hard