PheCode-guided multi-modal topic modeling of electronic health records improves disease incidence prediction and GWAS discovery from UK Biobank

Ziyang Song, Shadi Zabad, Marc‐André Legault, Yue LimedRxiv 2025

Abstract: Phenome-wide association studies (PheWAS) rely on disease definitions derived from diagnostic codes, often failing to leverage the full richness of electronic health records (EHR). We present MixEHR-SAGE, a PheCode-guided multi-modal topic model that integrates diagnoses, procedures, and medications to enhance phenotyping from large-scale EHRs. By combining expert-informed priors with probabilistic inference, MixEHR-SAGE identifies over 1,000 interpretable phenotype topics from UK Biobank (UKB) data. Applied to 350,000 individuals with high-quality genetic data, MixEHR-SAGE-derived risk scores accurately predict incident type 2 diabetes (T2D) and leukemia diagnoses. Subsequent genome-wide association studies (GWAS) using these continuous risk scores uncovered novel diasease-associated loci, including PPP1R15A for T2D and JMJD6 / SRSF2 for leukemia, that were missed by traditional binary case definitions. These results highlight the potential of probabilistic phenotyping from multi-modal EHRs to improve genetic discovery.

Introduction

In medical research, disease is often treated as a binary state—either present or absent—based on administrative billing codes (ICD-10). However, Electronic Health Records (EHRs) are notoriously noisy; codes are frequently entered for administrative purposes rather than clinical precision and fail to capture the "gray area" of early-stage or mild disease. This "binary bottleneck" reduces the statistical power of genetic studies, making it difficult to identify DNA variants that influence disease risk across a continuous spectrum.

Methods

To address these challenges, we developed MixEHR-SAGE (Seed-and-Guided), a probabilistic topic model. By treating a patient’s medical history as a "document" and various clinical codes (diagnoses, medications, procedures) as "words," the model groups these features into clinically interpretable "topics."

Key innovations include:

  • Expert-Guided Seeds: The model uses PheCodes (manually curated groupings of ICD codes) to "seed" topics, ensuring they align with established clinical phenotypes.
  • Multi-Modal Integration: It simultaneously learns from three distinct data streams: ICD-10 diagnostic codes, self-reported medications (mapped to ATC codes), and surgical/procedure codes (OPCS-4).
  • Continuous Risk Scores: Instead of a binary label, every patient receives a probability score for each identified topic, reflecting the severity or progression of their condition.
The MixEHR-SAGE framework: from data preprocessing and initial topic prior computation to multi-modal inference.

Data and Preprocessing

The study primarily utilized the UK Biobank (UKB), a massive dataset containing genetic and health information for approximately 500,000 participants. The preprocessing pipeline involved mapping ICD10 codes to Phecodes and medications to ATC codes. After rigorous genetic quality control—excluding individuals based on ancestry, relatedness, and genotype missingness—the final analysis focused on 350,469 individuals and 525 distinct Phecode topics that met the minimum case threshold.

Overview of the EHR preprocessing and genetic quality control pipeline leading to the final analysis dataset.

Key Results

Enhanced Genetic Discovery

Using MixEHR-SAGE continuous risk scores, we identified several novel genetic loci that were invisible to traditional binary GWAS. For Type 2 Diabetes, we discovered a significant association at the PPP1R15A gene. For leukemia, we identified a locus harboring JMJD6 and SRSF2. These findings demonstrate that continuous phenotypes provide greater statistical power than binary case-control labels.

Predictive Power and Interpretability

The model’s risk scores accurately predicted "incident" cases—patients who had no record of a disease at the start of the study but developed it years later. Furthermore, unlike "black-box" deep learning models, MixEHR-SAGE provides a clear breakdown of the specific medications and procedures contributing to a patient's risk score, enhancing clinical utility.

Discussion

While MixEHR-SAGE significantly improves phenotyping, limitations remain. The current study focused on individuals of European ancestry, and the model primarily handles categorical codes rather than continuous raw data like lab results or medical images. Future work will aim to incorporate longitudinal temporal dynamics to explicitly model disease trajectories over time.

Software Availability: The MixEHR-SAGE software is open-source and available on GitHub at https://github.com/li-lab-mcgill/MixEHR-SAGE.

Summary updated

BibTeX
@misc{song2025phecode,
  author = {Ziyang Song and Ziyang Song and Shadi Zabad and Marc‐André Legault and Yue Li},
  title = {{PheCode-guided multi-modal topic modeling of electronic health records improves disease incidence prediction and GWAS discovery from UK Biobank}},
  year = {2025},
  doi = {10.1101/2025.05.28.25328511},
  howpublished = {medRxiv},
}
Figure