Rebuilding foundational molecular evolution algorithms with AI-driven research workflows lets us replace discrete tree searches and combinatorial sub-problem loops with continuous, linear-time operators.
RhizAeon formulates recombination analysis as continuous motion across a metric reference map—using attention maps, force dipoles, and dyadic wavelet polishing to resolve mosaic viral, bacterial, and vertebrate genomes in seconds inside a web browser.
Tracks each genome across $K$ metric landmarks with a neutral drain at the center, holding false positives at 0.58%–1.01% across 333,334 clonal genomes in a 1,000,000-alignment sweep.
Parent switches create equal-and-opposite attention dipoles tested against a Brownian bridge, while clade merging collapses 10-taxon recombinant clades into $1.01 \pm 0.08$ ancestral events (98.8% exact).
Maps all 78–83 full-length sarbecovirus genomes (30,956 nt) in 2.6 seconds, matching Spike NTD and S1/S2 junctions within 9–12 nt and isolating the BANAL-20-52 RBD exchange.
Multi-scale wavelet filters resolve 103 short HLA Class I micro-conversions in 1.1s and 392 transfers across 240 S. pneumoniae chromosomes in 36.1s, running locally in any browser.
Over the past several months, we have been using human-orchestrated AI research and engineering workflows to rethink foundational algorithms in molecular evolution from first principles. Instead of porting thirty-year-old discrete search heuristics to faster hardware, AI-assisted mathematical prototyping and large-scale simulation harnesses let us ask a deeper question: can we replace combinatorial tree searches across sequence windows with a single continuous operator that scales linearly with alignment size?
Following HyphAeon (site-and-branch natural selection) and dFEL (non-stationary codon evolution in HyPhy 3), our new preprint with Danielle Callan, Steven Weaver, Hannah Verdonk, Jordan Zehr, Spyros Lytras, Anton Nekrutenko, Taylor Paisie, and Darren Martin introduces RhizAeon (GitHub, WebAssembly app, Zenodo archive)—a continuous-field approach to homologous recombination and horizontal gene transfer that runs in $\mathcal{O}(NKL)$ time.
The central idea of RhizAeon is to treat a sequence alignment not as a series of discrete phylogenetic trees, but as a set of continuous trajectories moving across a fixed geometric map.
The entire inference stack runs in five stages:
- The Reference Map and Center Drain (Root Sink):
RhizAeonselects $K$ diverse sequences and places them as fixed landmarks $\mathbf{x}_k$ on a low-dimensional map via classical multidimensional scaling (Gower, 1966). At the origin of the map ($\mathbf{0}$), we place a neutral center drain ($w_{i,0}$, the root sink). When a lineage mutates rapidly on its own branch without exchanging DNA, it moves away from all landmarks at once. That excess divergence flows into the center drain instead of pulling the sequence toward a false donor. - Continuous Attention Maps and the Ghost Axis: Moving left to right along the alignment ($u = 1 \dots L$), each sequence $i$ assigns soft attention weights $\mathbf{w}_i(u)$ to the $K$ landmarks (plus the center drain) to match its local position $\mathbf{r}_i(u)$ and genetic distances $\widetilde{D}_{ik}(u)$: $$\mathcal{L}(\mathbf{w}_i(u)) = \frac{1}{2}\left\lVert \mathbf{r}_i(u) - \sum_{k=1}^{K} w_{i,k}(u)\,\mathbf{x}_k - \beta_i(u)\,\mathbf{d}_{\mathrm{ghost}} \right\rVert_2^2 + \gamma \sum_{k=1}^{K} w_{i,k}(u)\,\widetilde{D}_{ik}(u) - \tau \sum_{k=0}^{K} w_{i,k}(u)\ln w_{i,k}(u)$$ When sequence $i$ stays inside a single evolutionary lineage, its attention map stays flat. If a tract arrives from an extinct or unsampled ("ghost") lineage that sits outside all sampled landmarks, the weight $\beta_i(u)$ lifts the sequence along an orthogonal ghost axis ($\mathbf{d}_{\mathrm{ghost}}$) perpendicular to the landmark plane.
- Force Dipoles Across Breakpoints: At a recombination breakpoint where sequence $i$ switches from Parent A to Parent B, Parent A's attention weight drops while Parent B's weight rises by the same amount. Comparing the attention vector just left of site $u$ with the vector just right of site $u$ produces an equal-and-opposite force dipole ($\Delta \mathbf{w}_i(u) = \mathbf{w}_i^{+}(u) - \mathbf{w}_i^{-}(u)$): a sharp push away from Parent A paired with an equal pull toward Parent B. Random mutations scatter across coordinates and cancel out, whereas a true crossover creates a coherent dipole that we test against a Brownian-bridge null distribution.
- Dyadic Wavelet Polishing and Viterbi Decoding:
Recombination tracts span four orders of magnitude, from 80-nucleotide gene conversions to 30-kilobase bacterial transfers. Rather than picking a single sliding-window width,
RhizAeonpasses the force-dipole profile through a dyadic wavelet bank—matched filters whose widths double at each step ($2, 4, 8, 16, 32\dots$ informative sites)—so both micro-conversions and long chromosomal cassettes register cleanly at their natural scale. A 5-state Viterbi decoder traces the parent path across the chromosome, and a local maximum-likelihood pass polishes each breakpoint to single-nucleotide resolution. - Iterative Tract Scrubbing and Clade Merging:
Once a mosaic tract is verified,
RhizAeonmasks ("scrubs") that interval out of the alignment and repeats the scan to uncover older, nested transfers underneath. Finally, when an ancestral recombination event is inherited by a clade of descendants that share the same breakpoints and parents,RhizAeonmerges their trajectories into one ancestral event.
Because the entire stack runs in a few milliseconds per alignment in Rust, we could stress-test RhizAeon at a scale that is impossible for traditional phylogenetic tools—evaluating four structural edge cases (Fig. 1) and a continuous sweep of 1,000,000 simulated whole genomes spanning six orders of magnitude in mutation and recombination rates (Fig. 2):
- Immunity to rate bursts and exact clade consolidation: Across 1,200 coalescent rate-heterogeneity nulls and 333,334 clonal genomes in the 1,000,000-genome sweep, the center drain holds false-positive rates at 0.58% and 1.01% (Fig. 1A, Fig. 2A). On 10-taxon recombinant clades, clade merging recovers $1.01 \pm 0.08$ ancestral events (98.8% exact single-event accuracy; Fig. 1B), while orthogonal projection and iterative scrubbing recover unsampled ghost donors (89.2% F1; Fig. 1C), three-parent mosaics (90.0%; Fig. 1D), and up to $R = 10$ overlapping transfers (Fig. 2C).
On empirical alignments, this continuous-field architecture turns multi-day cluster jobs into interactive, second-scale analyses across viruses, bacteria, and vertebrates:
- 78–83 whole sarbecovirus genomes in 2.6 seconds:
Across all 78 full-length sarbecovirus genomes from Lytras et al. (2022) ($30{,}956\text{ nt}$) plus 5 Laotian
BANALbat coronaviruses (Temmam et al., 2022),RhizAeonmaps the whole-genome recombination profile in 2.6 seconds (Fig. 3)—matching all 21 published whole-genomeGARDbreakpoints (median offset 99.0 nt; within 9 to 12 nt at the Spike NTD and S1/S2 junctions) and isolating theBANAL-20-52/RaTG13receptor-binding domain (RBD) exchange ($p < 10^{-16}$). - A 2.22-megabase Streptococcus pneumoniae chromosome in 36.1 seconds:
Across 240 multidrug-resistant S. pneumoniae PMEN1 chromosomes ($2{,}221{,}315\text{ bp}$, Croucher et al., 2011),
RhizAeonmaps 392 horizontal DNA transfers in 36.1 seconds (~35× faster thanGubbins), recovering the resistance cassettes atpbp2x,pbp1a,pbp2b,folA,folP, and the serotype 23F $\to$ 19A capsule switch (cps). - 86–150 bp micro-conversions in 379 primate MHC Class I alleles in 1.1 seconds:
Across 379 hominoid
HLA-A/B/Calleles (Parham et al., 1995), the fine-scale dyadic filters resolve 103 short Exon 2/3 conversions (86–150 nt) that remodel peptide-binding pockets—including the inter-locusHLA-B*46:01cassette spliced betweenHLA-B*15:01andHLA-C*01:02across positions 462–607 ($p = 2.8 \times 10^{-8}$).
GARD breakpoints from Lytras et al. (2022) (median offset 99.0 nt; 9–12 nt at Spike junctions).
(C–D) Isolation of the Laotian bat BANAL-20-52 / RaTG13 RBD exchange and 60,000× speedup.
We are now integrating RhizAeon's continuous partition maps directly into HyPhy 3 and HyphAeon so that selection and molecular-clock analyses automatically partition mosaic genomes in seconds before evaluating $dN/dS$.