HAMdetector: a Bayesian regression model that integrates information to detect HLA-associated mutations

Daniel Habermann, Hadi Kharimzadeh, Andreas Walker, Yang Li, Rongge Yang, Rolf Kaiser, Zabrina L. Brumme, Jörg Timm, Michael Roggendorf, Daniel Hoffmann · DOI

TL;DR

HAMdetector is a new Bayesian regression framework designed to identify HLA-associated mutations (HAMs)—the "escape" mutations viruses use to dodge the human immune system. By integrating viral sequences, host genetics, phylogenetic history, and epitope predictions into a single model, it significantly outperforms traditional statistical methods in identifying true immune-escape candidates.

What Problem Does This Paper Address?

Our immune system relies on the Human Leukocyte Antigen (HLA) system to "show" snippets of viral proteins (epitopes) to T-cells. If a T-cell recognizes a snippet, it kills the infected cell. To survive, viruses like HIV and Hepatitis B (HBV) evolve point mutations—HAMs—that prevent their proteins from binding to HLA molecules, effectively becoming invisible to the immune system.

Detecting these mutations is a "needle in a haystack" problem. HLA genes are incredibly diverse (polymorphic), and viral data is often sparse and noisy. Traditional methods, like Fisher’s exact test, often fail because they treat every viral sequence as independent, ignoring the fact that viruses share a common ancestry (phylogeny). Furthermore, relying on p-values for screening thousands of potential mutations often leads to high false-positive rates and overestimation of effect sizes.

Methods

The authors propose HAMdetector, which moves away from simple association tests toward a structured Bayesian logistic regression model. Key features include:

  • The Bayesian Backbone: Unlike frequentist methods that provide a binary "significant or not" result, this model produces a posterior probability, giving researchers a quantitative measure of confidence for every mutation.
  • Phylogenetic Correction: The model incorporates a baseline probability of a mutation occurring based on its position in a phylogenetic tree (calculated via RAxML-NG), ensuring that similarities due to common ancestry aren't mistaken for immune pressure.
  • Regularized Horseshoe Priors: This is a sophisticated "sparsity-inducing" prior. It assumes that most mutations are not HAMs (shrinking their coefficients toward zero) but allows for "heavy tails," meaning it won't suppress the signal when a genuine, strong association exists.
  • Epitope Integration: The model uses MHCflurry 2.0 to predict which viral segments are likely to bind to specific HLA alleles. If a mutation falls within a predicted binding region, the model "loosens" its sparsity constraint, making it more sensitive to potential HAMs in those areas.

Datasets

The model was validated across several high-stakes viral datasets:

  • HIV: A large dataset (N=1383) spanning multiple genes (gag, pol, env, etc.) from several major cohorts (HOMER, WAHCS, ACTG).
  • Hepatitis B (HBV): 544 sequences covering proteins like preC/core and Pol.
  • Hepatitis D (HDV): 104 sequences, used as a specific test case because it included in-vitro experimental validation of predicted mutations.
  • IEDB: The Immune Epitope Database was used as the "ground truth" for known epitopes to evaluate how well the model's predictions aligned with biological reality.

Key Insights and Ideas

  • Sparsity as a Biological Prior: The most impactful "aha moment" is that the horseshoe prior alone (Model 2) provided a massive jump in performance over standard regression. This confirms that the biological reality of HAMs—that they are rare and specific—is a powerful piece of information that should be baked into the math.
  • Disentangling Linkage Disequilibrium: Because certain HLA alleles are often inherited together, simple tests often flag the wrong allele as the driver of a mutation. By using a multilevel model, HAMdetector can "see" all alleles simultaneously and correctly identify the true driver (e.g., identifying B13 as the cause of a mutation previously attributed to A30).
  • Beyond the Epitope: While the model uses epitope predictions to boost signal, it is not limited to them. It successfully identified "compensatory mutations"—changes that happen far away from the binding site to fix structural issues caused by an escape mutation.

Key Results

  • Superior Enrichment: In HBV data, the full model (integrating phylogeny and epitope data) showed significantly higher enrichment of predicted HAMs within known epitopes compared to Fisher’s exact test and Phylogenetic Dependency Networks.
  • Better Generalization: Using Leave-One-Out Cross-Validation (LOOCV), the authors showed that adding each component (sparsity → phylogeny → epitopes) consistently improved the model’s ability to predict mutations in unseen data.
  • Discovery Power: In the HDV test case, HAMdetector identified 15 high-confidence associations that were missed by traditional significance thresholds. Several of these had already been experimentally confirmed in previous studies, proving the model finds "hidden" biological truths.

Limitations and Future Work

  • HLA Resolution: The current implementation works with 2-digit HLA alleles (e.g., A02). The authors are working on extending this to 4-digit resolution (e.g., A02:01), which is more specific but leads to even thinner data.
  • Fixed Trees: The model currently assumes the phylogenetic tree is 100% correct. A future version could account for "phylogenetic uncertainty" by sampling across multiple possible trees.
  • Computational Load: While it scales linearly, the Bayesian sampling (Hamiltonian Monte Carlo) for large HIV datasets requires overnight runs on standard hardware, though the authors have provided an optimized version for GPUs.

Availability: The source code is available as a Julia package at github.com/HAMdetector/Escape.jl.

Summary updated

BibTeX
@article{habermann2022hamdetector,
  author = {Daniel Habermann and Hadi Kharimzadeh and Andreas Walker and Yang Li and Rongge Yang and Rolf Kaiser and Zabrina L. Brumme and Jörg Timm and Michael Roggendorf and Daniel Hoffmann},
  title = {{HAMdetector: a Bayesian regression model that integrates information to detect HLA-associated mutations}},
  journal = {Bioinformatics},
  year = {2022},
  doi = {10.1093/bioinformatics/btac134},
}
Figure