HyPhy 3 Adds a Unified Pipeline for Codon Alignment and Selection Testing

Codon-based selection analysis lives or dies on the quality of the input alignment. When insertions and deletions are handled by heuristic aligners that do not respect the genetic code, non-homologous codons can be forced into the same column and downstream likelihood tests can mistake alignment artifacts for evidence of selection. In this preprint, HyPhy 3 introduces WALRUS, a unified engine designed to repair that split workflow by estimating codon alignment, phylogenetic structure, and selection signals in a single run.

The motivation is straightforward. Standard pipelines usually treat sequence alignment and evolutionary inference as separate tasks, even though errors in the first stage can dominate the second. Here, that separation is replaced by a coordinate-consistent framework built around a single Inside-Outside likelihood table, allowing the analysis to recover reading frames, estimate a codon alignment, infer an Ohmic reticulate network, model directional base-composition drift, and run eight selection tests in one computational pass.

Indel noise can manufacture selection where none exists.

Why Codon Alignment Errors Distort Selection Inference

Selection inference at the codon level depends on a biologically coherent alignment. If a gap-heavy region is misaligned, the model may compare unrelated codons as though they were orthologous, which can inflate apparent nonsynonymous change and push likelihood-based tests toward false positives. The problem becomes more severe as indel density rises, because each misplaced codon column compounds the distortion across the rest of the gene tree.

WALRUS is built to address that failure mode directly. Rather than accepting an externally prepared alignment as fixed, it integrates alignment repair into the same statistical machinery used for selection inference. The framework is meant to reduce the need for sequential approximation and to keep the codon reading frame aligned with the phylogenetic signal from the start.

The authors evaluated the system across 10,020 simulated alignments, which gives the method broad stress testing across different sequence contexts. On 800 INDELible replicates, WALRUS recovered 94.6% of true columns. That level of recovery matters because codon-level inference cannot outperform the structural integrity of the alignment it receives; if the columns are wrong, the selection test inherits the error.

Accuracy Gains Across Simulated and Saturated Indel Regimes

The strongest evidence comes from the false-positive control data. Under BUSTED, indel-driven false positives fell from 44.7%–58.1% to 4.4% when WALRUS was used. Under BUSTED-E, the rate dropped from 21.1%–21.4% to 1.4%. Those shifts are large enough to change how a dataset would be interpreted in routine comparative genomics, especially in studies where candidate selection signals are already sparse and vulnerable to overcalling.

A single misaligned codon can flip a gene from neutral to suspicious.

Under Zipfian indel saturation, where the challenge becomes more extreme, false positives still fell four-fold, from 33.3%–83.3% to 17.0%–20.5%. The remaining signal does not disappear entirely, which is consistent with the fact that very dense indel structure can overwhelm any inference system, but the reduction is still substantial. In practical terms, WALRUS appears to convert a large fraction of artifact-driven selection calls into a more conservative and biologically credible output.

The pipeline’s effect was not limited to simulated data. Across 11,190 avian orthogroup runs, execution was 6.6- to 35.8-fold faster, and housekeeping false positives fell 13-fold, with a 28-fold reduction on ultraconserved genes across the proteome. Speed matters here because large comparative genomic projects often face a choice between statistical rigor and throughput. A method that is both faster and less prone to spurious calls can shift that tradeoff substantially.

How the Integrated Framework Changes the Inference Workflow

WALRUS does more than fuse existing steps into a single wrapper. It uses the shared likelihood framework to co-estimate several biologically connected processes: codon alignment, reticulate structure, base-composition drift, and eight selection tests, including BUSTED-E, aBSREL, RELAX, FEL, dFEL, MEME, Contrast-FEL, and PRIME. The breadth of that menu is important because selection analysis in real datasets rarely rests on one statistic alone; different tests probe episodic, pervasive, directional, and lineage-specific patterns.

By keeping those analyses inside one engine, the workflow avoids the computational waste of reprocessing the same sequence information multiple times. It also reduces the risk that a downstream selection test will inherit a fixed alignment artifact that was never evaluated in the same probabilistic space as the evolutionary model. In effect, the alignment is no longer treated as a neutral preprocessing step. It becomes part of the inference problem itself.

The inclusion of directional base-composition drift is particularly relevant in coding sequences, where compositional biases can mimic or mask substitution patterns. Once those forces are modeled together, the resulting selection atlas is more likely to reflect genuine evolutionary pressure rather than a composite of technical artifacts.

What the Performance Numbers Mean for Comparative Genomics

For researchers working on large orthogroup collections, the reported speed-up is not just an engineering detail. Faster execution makes it more realistic to process genome-wide datasets without resorting to coarse filters that may exclude difficult regions precisely where selection signals are most interesting. The lower false-positive burden also means that candidate genes emerging from screens built on WALRUS may require less downstream triage before being treated as credible leads.

The preprint’s results are especially relevant for datasets enriched in indels, where conventional pipelines tend to become least trustworthy. In that setting, the method’s apparent value lies in preserving biologically meaningful codon relationships while suppressing the false selection signal introduced by gap structure. For evolutionary studies of rapidly diverging lineages, gene families with complex indel histories, or proteome-wide scans of conserved regions, the method could materially alter which genes are considered under selection.

The study also has a clear boundary. These findings come from a preprint and have not yet undergone peer review, so the reported gains should be treated as provisional until independent validation arrives. Even so, the numerical pattern is consistent across simulation and real orthogroup analyses: alignment-aware inference lowers artifact-driven positives and can do so with substantial gains in speed.

For codon selection analysis, that combination is hard to ignore.


Reporting by Dr. A. Nikhil Krishnan, MBBS for Medicine World Foundation, with additional data provided by bioRxiv (Biomedical Preprints).