2026-09-18
Delphy samples mutation-annotated trees and matches BEAST on SARS-CoV-2, Ebola, Zika, mpox and H5N1, 2-3 orders faster; 100k sequences hit ESS 248 in 15 hours.
Pathogen sequencing during outbreaks is now routine. More than 17 million SARS-CoV-2 genomes sit in public databases. Phylogenetic trees are how those sequences become a transmission history: dating the start of an outbreak, separating zoonotic spillover from human spread, naming lineages, mapping geography.
Bayesian tools such as BEAST X, BEAST 2 and MrBayes remain the most reliable way to do that work, because they quantify uncertainty rather than returning a single tree. They are also too slow and too fiddly for most public-health teams. Live tracking systems (NextStrain, Cov2Tree) fall back to maximum likelihood or maximum parsimony, then bolt on ad hoc uncertainty. Outbreak sequences typically differ from their nearest neighbor at 0 to 2 sites. Felsenstein pruning still recomputes partial likelihoods at every variable site on every node between the attachment point and the root.
Delphy rewrites Bayesian phylogenetics around an explicit mutation-annotated tree (EMAT): a timed bifurcating tree whose root sequence is stored outright and whose branches carry time-stamped mutations and missations (markers for missing data). The structure extends UShER's mutation-annotated trees with timestamps, multiple hits at the same site on one branch, and explicit missingness.
The posterior is dominated by a genetic prior. Each site evolves as an independent continuous-time Markov chain. The prior factors into three local pieces: the root's stationary distribution, an escape rate on each branch, and a transition rate for every mutation. Evaluating it scales with the number of elements in the tree, not genome length.
Sampling is standard MCMC. The workhorse move is subtree pruning and regrafting (SPR): detach the subtree at X from P and reattach it at P'. On an EMAT the posterior ratio depends almost only on the P-X and P'-X branches, a handful of local operations. The same move under Felsenstein pruning can cost hundreds of thousands of operations. Moves mix less efficiently; each one is cheap enough that the net throughput still rises.
Three supporting ideas make the sampler usable at outbreak scale:
The first release uses a single-partition HKY model, a strict clock, and either exponential-growth or Skygrid coalescent priors. The C++ core is about 8,000 lines, compiled to WebAssembly so a browser can run the analysis on-device. Native binaries are 2-3x faster than the web build. A Well-Calibrated Simulation Study covering the main features found no material MCMC defects.
Baselines are BEAST X, BEAST 2, and the NextStrain core of IQ-Tree 2 plus TreeTime. Speed is effective uncorrelated samples per minute. Unless noted, timings use native Delphy on AWS c7a.2xlarge (8 vCPUs), not the browser.
| Setting | Baseline | Delphy |
| 757 early SARS-CoV-2 genomes | BEAST 2 / BEAST X | 2-3 / 2 orders of magnitude faster; MCC trees and parameter posteriors match |
| 1,610 West African Ebola genomes | BEAST X with Skygrid | 3 orders of magnitude higher statistical efficiency |
| 81 Ebola, 174 Zika genomes | BEAST | only modestly faster; Zika topology ESS per minute per sequence 7x lower |
| 3,339 U.S. cattle H5N1 genomes | BEAST X stopped before halfway at 21 days; IQ-Tree 2 took hours | 42 minutes |
| 100,000 simulated sequences | prior Bayesian ceiling 40,000 sequences, fixed topology, 3 weeks | ESS 248 in 14.80 h on a 96-vCPU machine |
The H5N1 run recovers the known dynamics: origin on Texas farms, tMRCA around 26 December 2023 (95% HPD 2 December 2023 to 15 January 2024), genome-wide mutation rate 3.3e-3 per site per year. On 177 hMPXV-1 mpox genomes, a two-partition APOBEC3 model matches BEAST; naive MCC parsimony places the spillover in Nigeria's South-South region but cannot pin Rivers state with high certainty.
A week-by-week replay of complete SARS-CoV-2 genomes submitted to GISAID in early 2020 shows that by 1 February 2020 a mutation rate of 1-2e-3, a doubling time of 10-20 days, and a tMRCA in early December 2019 would already have been visible. The site-rate heterogeneity parameter alpha disagrees because Delphy uses a continuous gamma and BEAST a K-category discrete approximation; with heterogeneity off, the discrepancy disappears.
For genomic epidemiology, this undercuts the habit of skipping Bayesian methods because they are too slow. Outbreak data, nearly identical sequences with sparse mutations, is exactly the regime where EMATs are cheap. Paste a FASTA into the web app and a laptop can emit an MCC with 95% HPD intervals plus lineage and mutation prevalence curves. The code is MIT-licensed; the core ideas are dedicated to the public domain.
This is a data-structure rewrite of the same Bayesian posterior, not a new evolutionary model. Analyses that need codon models, relaxed clocks, or full phylogeography still belong in BEAST. On thinly sampled data that spans deep evolutionary time the method stays exact, but the speedup shrinks and can reverse.
Tip-date uncertainty on the order of a year breaks mdSPR; the paper currently advises dropping tips with date windows longer than one year. Sequencing error is ignored, so the data likelihood is 0 or 1. Partially ambiguous bases (Y = C or T) are treated as missing. The first release is HKY, a strict clock, and coalescent/Skygrid only.
At 100,000 sequences the parallelized coalescent prior shows numerical error, and that run used less than 25% of the machine, so the parallel implementation is still a proof of concept. Two independent H5N1 chains each jumped in mutation count mid-run (about 4,364 to 4,358 and 4,361 to 4,357). Other traces did not move; clade-correlation plots picked up sporadic outliers. Population curves and tMRCAs were essentially unaffected. About 18% of public H5N1 sequences lack precise dates and were left out of both the paper and the daily-updated trees.
The web app pays a further 2-3x WebAssembly tax. The 42-minute and 15-hour numbers in the figures are native binaries on cloud CPUs, not a browser tab.