Skip to main content
medRxiv
  • Home
  • About
  • Submit
  • ALERTS / RSS
Advanced Search

Early Detection of Erythropoietic Protoporphyria Using Sequential Machine Learning on Longitudinal Electronic Health Records

Aryan Ayati, Goktug Onal, Alana Sur, Shadera Azzam, Bruce Wang, View ORCID ProfileVivek A. Rudrapatna
doi: https://doi.org/10.64898/2026.08.15.26360514
Aryan Ayati
1Bakar Computational Health Sciences Institute, University of California, San Francisco, San Francisco, California, USA
MD, MPH
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
Goktug Onal
1Bakar Computational Health Sciences Institute, University of California, San Francisco, San Francisco, California, USA
BS
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
Alana Sur
2Department of Medicine, Division of Gastroenterology, University of California, San Francisco, San Francisco, California, USA
BS
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
Shadera Azzam
MS
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
Bruce Wang
2Department of Medicine, Division of Gastroenterology, University of California, San Francisco, San Francisco, California, USA
MD
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • For correspondence: bruce.wang{at}ucsf.edu vivek.rudrapatna{at}ucsf.edu
Vivek A. Rudrapatna
1Bakar Computational Health Sciences Institute, University of California, San Francisco, San Francisco, California, USA
2Department of Medicine, Division of Gastroenterology, University of California, San Francisco, San Francisco, California, USA
MD, PhD
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Vivek A. Rudrapatna
  • For correspondence: bruce.wang{at}ucsf.edu vivek.rudrapatna{at}ucsf.edu
  • Abstract
  • Full Text
  • Info/History
  • Metrics
  • Data/Code
  • Preview PDF
Loading

Abstract

Objective Erythropoietic protoporphyria (EPP) is a rare photodermatosis marked by multi-year diagnostic delays. We developed and externally validated machine learning models to identify patients with EPP earlier from longitudinal electronic health record (EHR) data and estimate undiagnosed disease burden.

Materials and Methods In a retrospective case–control study at two San Francisco health systems—an academic referral center (UCSF) and a safety-net hospital (ZSFG)—we identified 74 confirmed EPP cases using combined diagnostic coding, biochemical criteria, and specialty chart review. Symptom-enriched controls were sampled at a 40:1 ratio. Longitudinal diagnoses, laboratory results, medications, procedures, and encounters preceding the outcome date were modeled with a gradient-boosting classifier (CatBoost) and a state-space sequence model (MAMBA). The best model was deployed across the UCSF population and externally validated at ZSFG without retraining.

Results On the UCSF held-out test set (n=1,865; 43 cases), MAMBA outperformed CatBoost (AUC–ROC 0.91 vs 0.89; average precision 0.42 vs 0.27; precision 65% vs 20%), flagging cases a median of 229 days before documented diagnosis. Deployed across 297,967 symptom-compatible patients, it identified 310 high-risk individuals, implying a prevalence approaching genetic estimates. External validation at ZSFG showed attenuated performance (AUC–ROC 0.72; average precision 0.10) while preserving early detection (median 264 days).

Discussion A sequence model integrating temporal EHR signals detected EPP months before clinical recognition, corroborating genetic evidence of substantial underdiagnosis. Cross-site attenuation reflects population and documentation differences and underscores the need for local recalibration.

Conclusion Longitudinal EHR-based machine learning can shorten EPP diagnostic delay and prioritize patients for confirmatory testing, supporting proactive rare-disease case finding.

Competing Interest Statement

VAR has research funded by grants to UCSF from the following for-profit entities: Johnson and Johnson, Merck, Genentech, BeOne Medicines, and Sanofi. He is a scientific advisor to Data Unite and ZebraMD. BW received research support from: Alnylam Pharmaceuticals, Disc Medicine, Recordati Rare Diseases, and Tanabe Pharma. He is a scientific advisor to Portal Therapeutics.

Author Declarations

I confirm all relevant ethical guidelines have been followed, and any necessary IRB and/or ethics committee approvals have been obtained.

Yes

The details of the IRB/oversight body that provided approval or exemption for the research described are given below:

This study was approved by the University of California, San Francisco (UCSF) Institutional Review Board (IRB #24-42109), which granted a waiver of informed consent and HIPAA authorization for retrospective chart review. The research was determined to pose no greater than minimal risk to participants.

I confirm that all necessary patient/participant consent has been obtained and the appropriate institutional forms have been archived, and that any patient/participant/sample identifiers included were not known to anyone (e.g., hospital staff, patients or participants themselves) outside the research group so cannot be used to identify individuals.

Yes

I understand that all clinical trials and any other prospective interventional studies must be registered with an ICMJE-approved registry, such as ClinicalTrials.gov. I confirm that any such study reported in the manuscript has been registered and the trial registration ID is provided (note: if posting a prospective study registered retrospectively, please provide a statement in the trial ID field explaining why the study was not registered in advance).

Yes

I have followed all appropriate research reporting guidelines, such as any relevant EQUATOR Network research reporting checklist(s) and other pertinent material, if applicable.

Yes

Data availability

Deidentified electronic health records data from UCSF and ZSFG are available to support study reproducibility and extensions following the execution of a data use agreement with these health systems.

Funder Information Declared

Mitsubishi Tanabe Pharma Corporation, https://ror.org/038ehsm73
National Institutes of Health, UL1 TR001872
National Library of Medicine, R00 LM014099
Copyright 
The copyright holder for this preprint is the author/funder, who has granted medRxiv a license to display the preprint in perpetuity. It is made available under a CC-BY-NC 4.0 International license.
Back to top
PreviousNext
Posted August 17, 2026.
Download PDF
Data/Code
Email

Thank you for your interest in spreading the word about medRxiv.

NOTE: Your email address is requested solely to identify you as the sender of this article.

Enter multiple addresses on separate lines or separate them with commas.
Early Detection of Erythropoietic Protoporphyria Using Sequential Machine Learning on Longitudinal Electronic Health Records
(Your Name) has forwarded a page to you from medRxiv
(Your Name) thought you would like to see this page from the medRxiv website.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Share
Early Detection of Erythropoietic Protoporphyria Using Sequential Machine Learning on Longitudinal Electronic Health Records
Aryan Ayati, Goktug Onal, Alana Sur, Shadera Azzam, Bruce Wang, Vivek A. Rudrapatna
medRxiv 2026.08.15.26360514; doi: https://doi.org/10.64898/2026.08.15.26360514
Twitter logo Facebook logo LinkedIn logo Mendeley logo
Citation Tools
Early Detection of Erythropoietic Protoporphyria Using Sequential Machine Learning on Longitudinal Electronic Health Records
Aryan Ayati, Goktug Onal, Alana Sur, Shadera Azzam, Bruce Wang, Vivek A. Rudrapatna
medRxiv 2026.08.15.26360514; doi: https://doi.org/10.64898/2026.08.15.26360514

Citation Manager Formats

  • BibTeX
  • Bookends
  • EasyBib
  • EndNote (tagged)
  • EndNote 8 (xml)
  • Medlars
  • Mendeley
  • Papers
  • RefWorks Tagged
  • Ref Manager
  • RIS
  • Zotero
  • Tweet Widget
  • Facebook Like
  • Google Plus One

Subject Area

  • Gastroenterology
Subject Areas
All Articles
  • Addiction Medicine (617)
  • Allergy and Immunology (901)
  • Anesthesia (332)
  • Cardiovascular Medicine (4814)
  • Dentistry and Oral Medicine (479)
  • Dermatology (415)
  • Emergency Medicine (650)
  • Endocrinology (including Diabetes Mellitus and Metabolic Disease) (1627)
  • Epidemiology (15949)
  • Forensic Medicine (33)
  • Gastroenterology (1203)
  • Genetic and Genomic Medicine (7048)
  • Geriatric Medicine (733)
  • Health Economics (1065)
  • Health Informatics (5047)
  • Health Policy (1434)
  • Health Systems and Quality Improvement (1767)
  • Hematology (585)
  • HIV/AIDS (1344)
  • Infectious Diseases (except HIV/AIDS) (16291)
  • Intensive Care and Critical Care Medicine (1173)
  • Medical Education (668)
  • Medical Ethics (154)
  • Nephrology (724)
  • Neurology (7274)
  • Nursing (366)
  • Nutrition (1082)
  • Obstetrics and Gynecology (1241)
  • Occupational and Environmental Health (1005)
  • Oncology (3610)
  • Ophthalmology (1052)
  • Orthopedics (397)
  • Otolaryngology (456)
  • Pain Medicine (470)
  • Palliative Medicine (139)
  • Pathology (708)
  • Pediatrics (1798)
  • Pharmacology and Therapeutics (737)
  • Primary Care Research (767)
  • Psychiatry and Clinical Psychology (5897)
  • Public and Global Health (9757)
  • Radiology and Imaging (2423)
  • Rehabilitation Medicine and Physical Therapy (1453)
  • Respiratory Medicine (1249)
  • Rheumatology (641)
  • Sexual and Reproductive Health (771)
  • Sports Medicine (578)
  • Surgery (777)
  • Toxicology (107)
  • Transplantation (305)
  • Urology (291)