BPG is committed to discovery and dissemination of knowledge
Retrospective Study Open Access
Copyright: ©Author(s) 2026. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution-NonCommercial (CC BY-NC 4.0) license. No commercial re-use. See permissions. Published by Baishideng Publishing Group Inc.
World J Gastroenterol. Jan 28, 2027; 33(4): 123515
Published online Jan 28, 2027. doi: 10.3748/wjg.123515
Pre-diagnostic identification of cholestatic liver diseases using integrated clinical and environmental data framework
Nan Huo, Cui Tao, Department of Artificial Intelligence and Informatics, Mayo Clinic, Jacksonville, FL 32224, United States
Brian D Juran, Konstantinos N Lazaridis, Division of Gastroenterology and Hepatology, Mayo Clinic, Rochester, MN 55905, United States
ORCID number: Nan Huo (0000-0002-4980-2421); Cui Tao (0000-0002-4267-1924); Konstantinos N Lazaridis (0000-0002-0437-681X).
Author contributions: Huo N contributed to study supervision, administrative, technical, or material support, obtained funding, statistical analysis, critical revision of the manuscript for important intellectual content, drafting of the manuscript, acquisition, analysis, or interpretation of data, full access to all the data in the study and takes responsibility for the integrity of the data and the accuracy of the data analysis; Juran BD contributed to statistical analysis, critical revision of the manuscript for important intellectual content, full access to all the data in the study and takes responsibility for the integrity of the data and the accuracy of the data analysis; Tao C contributed to study supervision, administrative, technical, or material support, obtained funding, critical revision of the manuscript for important intellectual content, drafting of the manuscript, acquisition, analysis, or interpretation of data, study concept and design, full access to all the data in the study and takes responsibility for the integrity of the data and the accuracy of the data analysis; Lazaridis KN contributed to study supervision, administrative, technical, or material support, obtained funding, critical revision of the manuscript for important intellectual content, drafting of the manuscript, acquisition, analysis, or interpretation of data, study concept and design, full access to all the data in the study and takes responsibility for the integrity of the data and the accuracy of the data analysis.
AI contribution statement: The authors take full responsibility and accountability for all content of this manuscript, including any portions for which AI tools were used as assistive technologies. All AI-assisted outputs were carefully reviewed, validated, and approved by the authors. AI tools were not used to generate original scientific data, perform independent scientific analyses, or draw scientific conclusions.
Supported by National Institute of Diabetes and Digestive and Kidney Diseases, No. RC2 DK118619 and No. R01 DK126691; National Institute of Environmental Health Sciences, No. R24 ES036131; and Bernard J. and Nancy C. Karwick Career Development Award.
Institutional review board statement: All research was conducted in accordance with both the Declarations of Helsinki and Istanbul. The research of this study was approved by the Mayo Clinic institutional review committee(s) (IRB 16-005892), and written consent was given in writing by all participants.
Informed consent statement: The research of the present study was approved by the Mayo Clinic institutional review committee(s) (IRB 16-005892), and written consent was obtained in writing by all participants.
Conflict-of-interest statement: The authors declare that they have no conflict of interest.
Data sharing statement: Data could be shared based on Mayo Clinic institutional review committee(s) guidelines and restrictions.
Corresponding author: Konstantinos N Lazaridis, MD, Doctor, Division of Gastroenterology and Hepatology, Mayo Clinic, 200 First Street SW, Rochester, MN 55905, United States. lazaridis.konstantinos@mayo.edu
Received: June 1, 2026
Revised: July 16, 2026
Accepted: September 11, 2026
Published online: January 28, 2027
Processing time: 185 Days and 10.4 Hours

Abstract
BACKGROUND

Primary biliary cholangitis (PBC) and primary sclerosing cholangitis (PSC) are chronic immune-mediated cholestatic liver diseases with incompletely understood environmental contributors.

AIM

To evaluate whether spatial and contextual environmental exposures integrated with electronic health record data support pre-diagnostic identification of PBC and PSC.

METHODS

This retrospective case-control study included PBC or PSC patients whose pre-diagnostic clinical data were linked to residential-history-based environmental data. Environmental variables included water-related contextual factors and air pollutants, including particulate matter, nitrogen dioxide, sulfur dioxide, ozone, and carbon monoxide. Random forest and eXtreme Gradient Boosting (XGBoost) models were developed with propensity score weighting to adjust for baseline covariates and class imbalance. Models were tuned using stratified 5-fold cross-validation within the training set and evaluated on the held-out testing set.

RESULTS

In the held-out testing set, full models incorporating baseline, environmental, and laboratory features achieved area under the receiver operating characteristic curves of 0.901 for PBC and 0.803 for PSC using random forest, and 0.892 for PBC and 0.785 for PSC using XGBoost. Laboratory-derived pre-diagnostic trajectories provided the strongest predictive signal, particularly for PBC. Environmental variables contributed modest but measurable incremental information, with a more apparent contribution observed for PSC. SHapley Additive exPlanations analysis identified liver-related laboratory trajectories and selected air pollution features, including sulfur dioxide, particulate matter 10, and nitrogen dioxide, as contributors to model predictions.

CONCLUSION

Environmental exposures provided modest complementary pre-diagnostic predictive signals for cholestatic liver diseases, particularly for PSC. These findings support further investigation of environmental exposome factors for risk stratification and early identification of cholestatic liver diseases.

Key Words: Data; Disease; Exposures; Machine learning; Electronic health record

Core Tip: This study examined whether environmental exposures integrated with electronic health record data could support pre-diagnostic identification of primary biliary cholangitis and primary sclerosing cholangitis.



INTRODUCTION

Primary biliary cholangitis (PBC) and primary sclerosing cholangitis (PSC) are chronic cholestatic liver diseases characterized by progressive injury to the bile ducts. PBC primarily affects small intrahepatic bile ducts and is strongly associated with autoimmune mechanisms, especially in middle-aged women[1]. In contrast, PSC involves inflammation and fibrosis of both intrahepatic and extrahepatic bile ducts and is closely linked to inflammatory bowel disease (IBD)[2]. Over time, both conditions can lead to biliary obstruction, cholestasis, and liver cirrhosis.

The pathogenesis of PBC and PSC involves complex immune-mediated injury to the biliary system, but through distinct mechanisms. PBC is driven largely by autoimmune destruction of small intrahepatic bile ducts, characterized by antimitochondrial antibodies and T-cell mediated targeting of biliary epithelial cells[3]. Genetic susceptibility, environmental triggers, and loss of immune tolerance contribute to disease onset. PSC, on the other hand, is marked by chronic inflammation and fibrotic remodeling of intra- and extrahepatic bile ducts, with strong associations to gut dysbiosis and IBD. Abnormal immune responses, microbial products, and genetic factors interact to promote the progressive “onion-skin” fibrosis typical of PSC.

Despite shared cholestatic features, the two diseases arise from distinct pathogenic pathways. Importantly, the role of exposures in PBC and PSC pathogenesis and outcomes remains important but unclear. Identifying environmental and lifestyle factors associated with pre-diagnostic disease-related patterns may help generate hypotheses regarding immune dysregulation and biliary injury. Studying environmental context may also support early detection, risk stratification, and hypothesis generation for future prevention-oriented research. Environmental exposures may be associated with immune-mediated cholestatic liver diseases through biologically plausible pathways, including oxidative stress, chronic inflammation, immune dysregulation, altered gut microbiota, and gut-liver axis signaling[4-12]. Air pollutants and other environmental toxicants may promote hepatobiliary injury by activating inflammatory and immune pathways. These mechanisms may be particularly relevant to PSC given its strong association with IBD, gut dysbiosis, microbial products, and systemic immune activation[13-16].

Emerging exposomics and metabolomics studies further support the potential role of environmental chemicals in PBC and PSC. Prior studies have examined environmental and exposomic factors in cholestatic liver diseases from several complementary perspectives. Environmental survey-based studies have evaluated self-reported exposures in PSC, including residential, water-related, occupational, and lifestyle factors, and have highlighted the importance of considering IBD status when interpreting PSC-related environmental associations. High-resolution exposomics and metabolomics studies have further identified associations between PBC or PSC and environmental chemicals[17]. These findings suggest that environmental exposures may influence cholestatic liver disease risk through perturbations of immune, metabolic, microbial, and hepatobiliary pathways[17]. Separately, machine learning studies in PBC and PSC have primarily focused on clinical, laboratory, genetic, microbiome, or multi-omics features for diagnosis, prognosis, disease stratification, or biomarker discovery[18-22]. However, these areas of work have generally remained separate: Environmental and exposomic studies have not typically incorporated longitudinal electronic health record (EHR)-derived clinical trajectories into predictive machine learning models, whereas machine learning studies have rarely incorporated residential-history-based spatial and contextual environmental exposures. Therefore, the incremental predictive value of spatial and contextual environmental variables when integrated with EHR-derived clinical and laboratory data remains unclear. To our knowledge, no prior study has integrated residential-history-based spatial and contextual environmental exposures with longitudinal EHR-derived clinical and laboratory data in a machine learning framework for pre-diagnostic identification of PBC or PSC.

In this study, we used two cohorts of chronic cholestatic liver disease patients (i.e., PBC and PSC) along with clinical data, spatial and contextual exposome (SCE) data, and water data to better understand the environmental contributors of these disorders. SCE data refer to air pollution exposure measures linked to residential ZIP codes. SPACESCANS is a data-integration framework designed to link longitudinal EHR-derived clinical information with residential histories, SCE environmental exposure data, and other project-specific exposure data sources. Water-related contextual variables were obtained separately from the Mayo Clinic PSC/PBC water survey. This approach enables assessment of cumulative and time-varying environmental context before diagnosis, which is particularly relevant for chronic immune-mediated diseases that may develop over prolonged preclinical periods. By integrating longitudinal EHR data with residential exposure histories, this study aimed to evaluate whether environmental exposome variables provide measurable pre-diagnostic predictive signals for patients who later received a diagnosis of PBC or PSC. We developed and compared machine learning models using demographic, water-related, air pollution, and laboratory-derived features to assess the complementary contribution of environmental exposome variables to pre-diagnostic disease identification.

MATERIALS AND METHODS
Study design and population

This was a retrospective observational study including patients with PBC and PSC. The study population comprised patients who received care at Mayo Clinic, including all three campuses in Rochester (Minnesota), Scottsdale/Phoenix (Arizona), and Jacksonville (Florida), United States. All patients met diagnostic criteria defined by the American Association for the Study of Liver Diseases and the European Association for the Study of the Liver. Diagnosis was confirmed by: (1) Biochemical evidence of cholestasis lasting at least six months; (2) Positive antimitochondrial antibody with compatible histology for PBC or characteristic cholangiographic or histologic findings for PSC; and (3) Exclusion of secondary causes of cholestasis. Medical records were reviewed to ensure diagnostic accuracy.

Eligible participants included adults aged 18 years to 85 years diagnosed with PBC or PSC according to standard criteria. Patients with prior orthotopic liver transplantation were eligible for enrollment. Women of childbearing potential, including pregnant women, were not excluded, as the study posed no risk to unborn children. Controls were recruited from the same source population and included adults aged 18 years to 85 years without a history of PBC, PSC, or other chronic liver disease.

Exclusion criteria applied to all subjects included inability to provide informed consent, incarceration, or institutionalization. Controls recruited through the Mayo Clinic Biobank were excluded if they had a history of IBD, colitis, colectomy, cancer (including melanoma), prior radiation or chemotherapy, or organ transplantation.

The study followed the strengthening the reporting of observational studies in epidemiology guideline. Data analysis was performed from March 1, 2025, to July 31, 2025. All research was conducted in accordance with both the Declarations of Helsinki and Istanbul, all research was approved by the appropriate ethics and/or institutional review committee(s), including the full name of the committees and approval number where possible, and written consent was given in writing by all subjects. The statistical methods used in this study were reviewed by a biomedical statistician before submission.

Window definitions and temporal ordering

For PBC and PSC cases, the index date was defined as the date of diagnosis. For controls, a pseudo-diagnosis date was assigned equal to the diagnosis date of the matched case to ensure temporal alignment. The prediction window was defined as the 12 months preceding the index date, during which the outcome of interest (diagnosis of PBC or PSC) was predicted.

All predictor variables were derived from a five-year observation period preceding the prediction window. Thus, features were constructed from data occurring between month -72 and month -13 relative to the index date. No features from within the prediction window (month -12 to month 0) were included in model development. This temporal separation was implemented to reduce potential information leakage from near-diagnostic clinical changes and to ensure that all predictors preceded the prediction window. This restriction applied to all feature domains, including laboratory-derived variables; therefore, laboratory features represented pre-diagnostic trajectories rather than tests obtained during diagnostic evaluation.

Data sources and feature construction

For each patient, EHR-derived clinical data, SCE-derived air pollution data, survey-derived water-related contextual data, and residential history information were extracted and linked. In this study, SCE data included air pollution exposure measures linked to residential ZIP codes. The SPACESCANS project incorporates SCE air pollution data and links patient residential ZIP code histories to spatially indexed environmental datasets to generate area-level exposure estimates over time. Air pollution measures included nitrogen dioxide (NO2), particulate matter10 (PM10), PM2.5, sulfur dioxide (SO2), ozone (O3), and carbon monoxide at the 5-digit ZIP code level from 1999 to 2024. Residential address histories were linked with SCE data to generate time-segmented air pollution exposure estimates for current and prior residences.

All clinical data were obtained from the EHR, which is housed in the Mayo Clinic Cloud dataset. The Mayo Clinic Cloud is a secure, cloud-based data warehouse that integrates EHRs, laboratory results, and administrative information across the Mayo Clinic system, covering both inpatient and outpatient encounters. It provides standardized and longitudinal access to patient-level data for research use under IRB approval. Clinical variables included demographics, comorbidities, laboratory tests, medications, and lifestyle factors. Specifically, demographic and clinical characteristics were determined before the index date for both PBC and PSC cases and their referent cohorts, and included age, race, ethnicity, body mass index, smoking status, and the Charlson comorbidity index (CCI). The CCI was calculated as a weighted score of 17 predefined comorbid conditions, including cardiovascular, pulmonary, renal, hepatic, endocrine, and oncologic diseases, with higher scores indicating greater comorbidity burden. All chronic conditions were assessed using ICD-9 or ICD-10 diagnosis codes before the index date.

Laboratory results within this period were summarized into static descriptors (mean, minimum, maximum) and temporal trends. Change was defined as the difference between the last and first available laboratory values within the observation window, while slope was defined as the change in laboratory value divided by the number of days between the first and last test dates, representing the rate of change over time.

Water data were obtained from the Mayo Clinic PSC/PBC water survey[23]. These survey-derived variables included water source, area of residence, and neighborhood type for current and prior residential addresses. Water source was categorized as private well, bottled water, or community supply. Area of residence was classified as urban, suburban, or rural. Neighborhood type was defined as industrial, agricultural, or residential. The water survey also captured residential history, including information on up to five prior addresses and the number of years lived at each location, enabling longitudinal assessment of water-related contextual exposures. These variables should be interpreted as proxies for potential water-related environmental context rather than direct measurements of specific water contaminants.

Residential history was ascertained using two complementary sources: Mayo Clinic registration records and the Mayo Clinic PSC/PBC water survey. Mayo Clinic registration records provided ZIP code information updated or confirmed during clinical encounters, while the survey collected self-reported residential history, including up to five prior addresses and the number of years lived at each ZIP code/address. Together, these data sources allowed us to incorporate current and prior residential histories and estimate address-specific exposure periods rather than assuming that participants lived in a single ZIP code throughout the entire observation window.

Data imputation and bias handling

Variables with more than 20% missing values were excluded from the analysis. According to the imputation strategies, the missing values (less than 20%) for binary and categorical variables were imputed as 0 and “unknown”, respectively[24]. Categorical variables were one-hot encoded prior to model training. For continuous variables, we used median imputation (the median of all values replaced, i.e., missing values). After preprocessing and imputation, a total of 73 features were retained, including 7 demographic and comorbidity variables, 12 water-related variables, 18 air pollution variables, and 36 laboratory-derived variables (Supplementary Table 1).

Statistical analysis

Descriptive characteristics at the index date were compared between the case and the referent cohorts using χ2 tests for the categorical variables and t-test or Wilcoxon test for the continuous variables based on the normality test. Patients without available laboratory data in the pre-diagnostic observation window were excluded from analyses involving laboratory-derived features. An inverse probability weights (IPW) were estimated from logistic regression with age at index date (continuous), race (white vs nonwhite), and sex (male vs female) as covariates. These adjustments were done overall to maximize the balance at the index date. The assumptions were satisfied for all of the analyses reported[25]. All tests were 2-sided likelihood ratio tests with a P value less than 0.05 considered statistically significant.

Modeling strategies

For machine learning algorithm development (Figure 1), the dataset was randomly divided into training (80%) and testing (20%) subsets using stratified sampling to preserve the case-control distribution. Hyperparameters for random forest (RF) and eXtreme Gradient Boosting (XGBoost) were optimized using stratified 5-fold cross-validation within the training set. The final optimized models were then evaluated on the held-out testing set. The resulting IPW values were incorporated into the machine learning models as observation-level sample weights during model training and were also used in model performance evaluation. IPW was not included as a predictor variable.

Figure 1
Figure 1 Design of machine learning algorithms. Overview of the machine learning pipeline used to predict primary biliary cholangitis and primary sclerosing cholangitis. Clinical variables and environmental exposome features were integrated as input variables. After data preprocessing and feature selection, the dataset was divided into training and testing sets. Multiple machine learning algorithms, including random forest and eXtreme Gradient Boosting, were applied to develop prediction models, and model performance was evaluated using standard classification metrics. PBC: Primary biliary cholangitis; PSC: Primary sclerosing cholangitis; RF: Random forest; XGBoost: EXtreme Gradient Boosting.

Case patients with PBC or PSC and control subjects without these diseases were included. Missing values were handled as described above, and categorical variables were one-hot encoded. Six feature sets were constructed: (1) Base (included sociodemographic and habits/comorbidities see Supplementary Table 1); (2) Base + water; (3) Base + air; (4) Base + lab; (5) Base + water + air; and (6) Base + water + air + lab. Beyond the “base” feature set, additional sets incorporated environmental variables, including air pollution measures and survey-derived water-related contextual variables, as well as laboratory data. (i.e., complete blood count, liver function tests, metabolic tests, see Supplementary Table1). Laboratory results were summarized into feature vectors that captured static properties such as mean, minimum, maximum, change, and slope.

Two machine learning algorithms, RF and XGBoost, were developed for each feature set. Compared with logistic regression, XGBoost can handle missing values and capture nonlinear relationships between features and outcomes. RF is an ensemble algorithm that constructs multiple decision trees on bootstrap samples of the dataset and aggregates their predictions. Each tree is grown using a random subset of features, which reduces overfitting and improves generalizability. Both methods are nonparametric, can capture nonlinear effects, and are suitable for heterogeneous datasets with mixed variable types.

Measuring model performance

The performance of each algorithm was evaluated using recall and F1 scores, with F1 defined as the harmonic mean of precision and recall. The area under the receiver operating characteristic curve (AUC) was used to assess model discrimination, defined as the ability to distinguish between patients with and without the outcome. Higher AUC values indicate better predictive performance in separating high-risk and low-risk patients[26]. Model calibration was assessed for the full RF and XGBoost models using calibration plots and Brier scores on the held-out testing set. Calibration plots compared the mean predicted probability within each bin with the observed case proportion. The Brier score was calculated as the mean squared difference between predicted probabilities and observed outcomes, with lower values indicating better probabilistic accuracy. Because inverse probability weighting was incorporated into model training and performance evaluation, both unweighted and IPW-weighted Brier scores were calculated.

Evaluation of feature importance

To evaluate model interpretability, feature importance was assessed separately for the RF and XGBoost models. For the RF models, feature importance was first quantified using impurity-based importance, measured as the mean decrease in the Gini index across all splits where the feature was used. This method identifies variables that reduce node impurity and therefore contribute most to the overall classification accuracy. However, impurity-based importance can be biased toward variables with more categories or higher variance. To address this limitation and provide a more interpretable estimate of variable contributions, we further applied SHapley Additive exPlanations (SHAP) to the RF and XGBoost models. SHAP values are derived from cooperative game theory and represent the average marginal contribution of a feature across all possible coalitions of features[27,28]. By computing SHAP values, we quantified both the direction (increase or decrease predicted probability) and the magnitude of each feature’s contribution to the predicted probability at both the individual and cohort levels[28]. SHAP summary plots were generated for each model to visualize feature contributions across patients. In these plots, each dot represents one patient-level observation for a given feature, the X-axis represents the SHAP value, and dot color indicates the original feature value, with red indicating higher values and blue indicating lower values. Features were ranked by mean absolute SHAP value, representing the average magnitude of each feature’s contribution across all observations. This approach improves interpretability beyond global feature rankings by enabling case-level explanations of model predictions. SHAP findings were interpreted as predictive, hypothesis-generating signals rather than causal effects.

Sensitivity analyses

We performed several sensitivity analyses to examine the robustness of our findings. First, we varied the definition of the observation window used to derive predictor variables. Instead of using the default five-year window prior to the prediction window (-72 months to -13 months relative to the index date), we restricted the observation period to two years (-36 months to -13 months) and, separately, to six months (-18 months to -13 months) before the index date. These analyses evaluated whether the predictive performance of the models was influenced by the length of historical data available before the prediction window. Second, given the strong association between liver enzyme abnormalities and PSC/PBC diagnosis, we repeated the analyses after excluding key liver-related laboratory variables, including alkaline phosphatase (ALP), aspartate aminotransferase (AST), alanine aminotransferase, and bilirubin-related features, to address potential concerns about circular reasoning or diagnostic leakage. Of note, all predictor variables in the primary analyses were derived from the observation window ending 12 months before the index date, and no data from the prediction window immediately preceding diagnosis were used for model training. Third, we performed a laboratory-first incremental analysis, in which models were first trained using laboratory features alone and then sequentially augmented with baseline demographic and behavioral variables, water-related variables, air pollution variables, and combined water and air exposure variables. This analysis was designed to evaluate the incremental contribution of environmental exposures in the presence of strong laboratory predictors. Fourth, to compare machine learning models with traditional statistical approaches, we additionally evaluated logistic regression and least absolute shrinkage and selection operator (LASSO) logistic regression using the same cross-validation framework. Bootstrap-based pairwise comparisons of full model AUCs were performed using RF as the reference model. For each comparison, the AUC of the reference model, AUC of the comparator model, AUC difference, 95% confidence interval (CI), and P value were reported. Fifth, for the PSC analysis, we quantified the prevalence of IBD among PSC cases and controls and performed exploratory subgroup analyses stratified by IBD status among PSC cases, comparing PSC-IBD cases and PSC-alone cases separately with controls. Finally, we compared the full models using bootstrap-based pairwise AUC comparisons to assess whether differences in predictive performance across modeling approaches were statistically supported.

All analyses were conducted using Python (version 3.12). Machine learning models were implemented with the scikit-learn and XGBoost libraries. Data management and preprocessing were performed using pandas and numpy. Feature importance analyses were conducted using the SHAP library.

RESULTS

Figure 2 shows detailed flow charts for the two cohorts, and Table 1 displays characteristics for both the PBC, PSC, and the referent cohorts. A total of 612 patients with PBC and 542 patients with PSC were compared with 636 controls for each disease. Significant differences were observed between cases and controls in both cohorts. Specifically, compared to the referent cohort, patients with PBC were older, more often female, more likely to use tobacco, less likely to consume alcohol, and had higher comorbidity scores (all P < 0.05). Patients with PSC, in contrast, were younger, more often male, had higher comorbidity scores, and reported higher tobacco but lower alcohol use (all P < 0.05). In both cohorts, racial differences were also observed. In summary, there were significant differences in demographic and clinical characteristics between PBC or PSC patients and their respective referent cohorts, as shown in Table 1.

Figure 2
Figure 2 Flowchart of the study cohorts. The primary biliary cholangitis and primary sclerosing cholangitis cohorts were selected by review of the electronic health record of patients who received care at Mayo Clinic. All patients met diagnostic criteria defined by the American Association for the Study of Liver Diseases and the European Association for the Study of the Liver. Diagnosis was confirmed by: (1) Biochemical evidence of cholestasis lasting at least six months; (2) Positive antimitochondrial antibody with compatible histology for primary biliary cholangitis or characteristic cholangiographic or histologic findings for primary sclerosing cholangitis; and (3) Exclusion of secondary causes of cholestasis. Controls were selected from the same source population without a history of primary biliary cholangitis, primary sclerosing cholangitis, or other chronic liver disease. Standard exclusion criteria were applied, including inability to provide informed consent, incarceration, data inconsistencies, and selected medical conditions among controls. PBC: Primary biliary cholangitis; PSC: Primary sclerosing cholangitis.
Table 1 Sample characteristics among patients with primary biliary cholangitis and primary sclerosing cholangitis, mean ± SD/n (%).
VariablesPBC
PSC
Case (n = 612)
Control (n = 636)
P value1
Case (n = 542)
Control (n = 636)
P value
Age at diagnosis55.6 ± 11.153.7 ± 12.20.00343.64 ± 10.453.7 ± 12.2< 0.0001
Gender< 0.0001< 0.0001
Female543 (88.7)467 (73.4)199 (36.7)467 (73.4)
Male69 (11.3)169 (26.6)343 (63.3)169 (26.6)
Race0.0040.002
White574 (93.8)621 (97.6)499 (92.1)621 (97.6)
Others238 (6.2)15 (2.4)43 (7.9)15 (2.4)
Tobacco use< 0.0001< 0.0001
Yes309 (50.5)180 (28.3)333 (61.4)180 (28.3)
No303 (49.5)456 (71.7)209 (38.6)456 (71.7)
Alcohol use< 0.0001< 0.0001
Yes166 (27.1)352 (55.3)185 (34.1)352 (55.3)
No446 (72.9)284 (44.7)357 (65.9)284 (44.7)
BMI28.1 ± 6.727.8 ± 6.20.64426.9 ± 4.927.8 ± 6.20.432
CCI2.1 ± 0.60.9 ± 1.0< 0.00011.6 ± 0.80.9 ± 1.0< 0.0001
IBD8 (1.3)10 (1.6)380 (70.1)10 (1.6)< 0.0001
Model performance for pre-diagnostic identification

Table 2 and Figure 3 show the performance of the PBC prediction models. Using baseline features alone, RF achieved an AUC of 0.58 (F1 score, 0.52; recall, 0.48; precision, 0.59), while XGBoost performed worse with an AUC of 0.56 (F1 score, 0.53; recall, 0.50; precision, 0.56). Adding water exposure improved performance, with RF reaching an AUC of 0.59 (F1 score, 0.54; recall, 0.51; precision, 0.59) and XGBoost an AUC of 0.57 (F1 score, 0.54; recall, 0.52; precision, 0.56). Air exposure alone yielded an AUC of 0.63 for RF (F1 score, 0.58; recall, 0.57; precision, 0.60) and 0.62 for XGBoost (F1 score, 0.58; recall, 0.57; precision, 0.59). When water and air exposures were combined, RF achieved an AUC of 0.62 (F1 score, 0.59; recall, 0.57; precision, 0.60), and XGBoost reached 0.61 (F1 score, 0.57; recall, 0.55; precision, 0.59). The inclusion of laboratory data substantially enhanced discrimination, with RF achieving an AUC of 0.91 (F1 score, 0.81; recall, 0.79; precision, 0.85) and XGBoost an AUC of 0.89 (F1 score, 0.80; recall, 0.78; precision, 0.82). The integrated model with all data sources performed best, with RF yielding an AUC of 0.90 (F1 score, 0.81; recall, 0.78; precision, 0.85) and XGBoost an AUC of 0.89 (F1 score, 0.80; recall, 0.78; precision, 0.82).

Figure 3
Figure 3 Receiver operating characteristic curves for primary biliary cholangitis and primary sclerosing cholangitis. Receiver operating characteristic curves illustrating the performance of machine learning models in predicting primary biliary cholangitis (PBC) and primary sclerosing cholangitis (PSC). Model discrimination was evaluated using the area under the curve. The curves demonstrate the predictive performance of models incorporating both clinical variables and environmental exposure features. Panels represent the following models: A: Random forest for PBC; B: EXtreme Gradient Boosting (XGBoost) for PBC; C: Random forest for PSC; D: XGBoost for PSC. AUC: Area under the curve.
Table 2 Comparison of prediction performance for primary biliary cholangitis and primary sclerosing cholangitis (1 year window period).
ModelRandom forest
XGBoost
AUC
F1
Recall
Precision
AUC
F1
Recall
Precision
PBC
Base0.5850.5260.4760.5910.5640.5270.5000.558
Base + water0.5870.5430.5070.5860.5680.5380.5220.555
Base + air0.6280.5800.5650.5970.6230.5830.5680.599
Base + lab0.9050.8180.7940.8450.8930.8030.7840.824
Base + water + air0.6230.5870.5710.6040.6130.5700.5530.589
Base + water + air +lab0.9010.8120.7760.8540.8920.7990.7820.818
PSC
Base0.5430.5160.5080.5310.5460.5110.5100.517
Base + water0.5880.4520.3920.5570.6070.5320.4960.607
Base + air0.6000.4930.4650.5340.5860.5170.4950.586
Base + lab0.7870.7680.9080.6660.7790.7680.8910.779
Base + water + air0.6480.5380.4820.6180.6310.5240.4850.631
Base + water + air +lab0.8030.7640.9010.6640.7850.7450.8270.680

In the PSC cohort, the models showed a broadly similar trajectory, although the incremental contribution of environmental variables appeared somewhat more apparent than in PBC (Table 2 and Figure 3). Baseline-only models had poor discrimination, with RF showing an AUC of 0.54 (F1 score, 0.52; recall, 0.51; precision, 0.53) and XGBoost an AUC of 0.55 (F1 score, 0.51; recall, 0.51; precision, 0.52). Incorporating water exposure improved RF to an AUC of 0.59 (F1 score, 0.45; recall, 0.39; precision, 0.56) and XGBoost to 0.61 (F1 score, 0.53; recall, 0.50; precision, 0.61). Air exposure provided additional but modest discrimination, with RF reaching an AUC of 0.60 (F1 score, 0.49; recall, 0.47; precision, 0.53) and XGBoost 0.59 (F1 score, 0.52; recall, 0.50; precision, 0.59). When both water and air were included, RF achieved an AUC of 0.65 (F1 score, 0.54; recall, 0.48; precision, 0.62), while XGBoost achieved 0.63 (F1 score, 0.52; recall, 0.49; precision, 0.63). The inclusion of laboratory variables further boosted model accuracy, with RF at an AUC of 0.79 (F1 score, 0.77; recall, 0.91; precision, 0.67) and XGBoost at 0.78 (F1 score, 0.77; recall, 0.89; precision, 0.78). The integrated model combining baseline, environmental, and laboratory features provided the best prediction, with RF yielding an AUC of 0.80 (F1 score, 0.76; recall, 0.90; precision, 0.66) and XGBoost 0.79 (F1 score, 0.75; recall, 0.83; precision, 0.79).

In addition, model calibration was assessed for the full RF and XGBoost models using calibration plots and Brier scores on the held-out testing set (Supplementary Figure 1 and Supplementary Table 2). For PBC, the IPW-weighted Brier scores were 0.16 for RF and 0.13 for XGBoost. For PSC, the IPW-weighted Brier scores were 0.20 for RF and 0.22 for XGBoost. These calibration analyses provide additional information on probabilistic model performance beyond discrimination metrics.

Overall, the models suggest that environmental variables may provide complementary information for pre-diagnostic identification, with a more apparent contribution observed in the PSC cohort.

Feature importance

Figure 4 shows SHAP value analyses for PBC using RF and XGBoost models. In the RF model, the most important features were slopes of AST, ALP, creatinine, hematocrit, potassium, and low density lipoprotein cholesterol. Several environmental exposures, including NO2 and SO2 at the current address and PM2.5 exposure, also contributed to model predictions. In the XGBoost model, similar patterns were observed. Laboratory slopes, especially AST, creatinine, hematocrit, potassium, and low density lipoprotein cholesterol, showed the largest SHAP values. Environmental variables had smaller but consistent effects.

Figure 4
Figure 4 SHapley Additive exPlanations value for primary biliary cholangitis. SHapley Additive exPlanations (SHAP) analysis illustrating the relative contribution of environmental and clinical features to the prediction models for primary biliary cholangitis (PBC). Each point represents the SHAP value for an individual observation. The X-axis shows the SHAP value, representing the contribution of that feature to the predicted probability of PBC for that patient. Positive SHAP values increase the predicted probability of PBC, whereas negative SHAP values decrease it. Dot color represents the original feature value, with red indicating higher values and blue indicating lower values. Blue does not indicate a negative effect by itself; the direction of contribution is determined by the dot’s position on the X-axis. Features are ranked by mean absolute SHAP value, reflecting their overall contribution to model predictions across the cohort. PBC: Primary biliary cholangitis; XGBoost: EXtreme Gradient Boosting; SHAP: SHapley Additive exPlanations; AST: Aspartate aminotransferase; ALP: Alkaline phosphatase; LDL: Low density lipoprotein; MCV: Mean corpuscular volume; PM: Particulate matter; SO2: Sulfur dioxide; NO2: Nitrogen dioxide; CO: Carbon monoxide.

Figure 5 presents SHAP value analyses for PSC using RF and XGBoost models. In the RF model, important predictors included age and slopes of hematologic markers such as monocytes, eosinophils, neutrophils, lymphocytes, leukocytes, and creatinine. Multiple air pollution exposures, including O3, PM10, NO2, carbon monoxide, and SO2 at current and prior addresses, were also identified as relevant features. In the XGBoost model, laboratory slopes remained the dominant predictors. Red cell distribution width (RDW), ALP, AST, erythrocyte, hemoglobin, and leukocyte slopes showed the largest SHAP values. Environmental exposures, including O3, PM2.5, PM10, NO2, and SO2, also contributed but with smaller effects. Overall, environmental exposures contributed to prediction in both diseases. Their effects appeared more diverse in PSC than in PBC.

Figure 5
Figure 5 SHapley Additive exPlanations value for primary sclerosing cholangitis. SHapley Additive exPlanations (SHAP) analysis illustrating the relative contribution of environmental and clinical features to the prediction models for primary sclerosing cholangitis (PSC). Each point represents the SHAP value for an individual observation. The X-axis shows the SHAP value, representing the contribution of that feature to the predicted probability of PSC for that patient. Positive SHAP values increase the predicted probability of PSC, whereas negative SHAP values decrease it. Dot color represents the original feature value, with red indicating higher values and blue indicating lower values. Blue does not indicate a negative effect by itself; the direction of contribution is determined by the dot’s position on the X-axis. Features are ranked by mean absolute SHAP value, reflecting their overall contribution to model predictions across the cohort. XGBoost: EXtreme Gradient Boosting; SHAP: SHapley Additive exPlanations; PSC: Primary sclerosing cholangitis; O3: Ozone; PM: Particulate matter; SO2: Sulfur dioxide; CO: Carbon monoxide; NO2: Nitrogen dioxide; AST: Aspartate aminotransferase; ALK: Anaplastic lymphoma kinase; RDW: Red cell distribution width.
Sensitivity analysis

For the sensitivity analyses, we first restricted the observation window to two years prior to diagnosis (Supplementary Table 3). Model performance was modestly attenuated compared with the main analysis. For PBC, the full RF and XGBoost models achieved AUCs of 0.82 and 0.80, respectively. For PSC, the corresponding AUCs were 0.79 and 0.77. We then restricted the window to six months prior to diagnosis (Supplementary Table 4), which resulted in slightly improved discrimination, particularly for models incorporating laboratory variables. In this analysis, the full RF and XGBoost models achieved AUCs of 0.90 and 0.89 for PBC and 0.82 and 0.80 for PSC, respectively.

To evaluate the potential influence of liver enzyme-related diagnostic signals, we repeated the analyses after excluding key liver enzyme variables, including AST and ALP (Supplementary Table 5). Although model performance decreased after exclusion of these variables, the models incorporating the remaining laboratory, demographic, and environmental features continued to demonstrate reasonable discrimination. For PBC, the full RF and XGBoost models achieved AUCs of 0.81 and 0.81, respectively. For PSC, the corresponding AUCs were 0.78 and 0.76. These findings suggest that model performance was reduced but not eliminated after removing major liver enzyme predictors.

We also performed a laboratory-first incremental analysis to better evaluate the additional contribution of demographic and environmental variables in the presence of strong laboratory predictors (Supplementary Table 6). For PBC, laboratory features alone achieved high discrimination, with AUCs of 0.88 for RF and 0.89 for XGBoost; adding baseline, water, and air variables resulted in only minimal additional changes. For PSC, laboratory features alone achieved AUCs of 0.75 and 0.75 for RF and XGBoost, respectively. Adding baseline variables improved performance, and further addition of water-related variables increased the AUCs to 0.81 for RF and 0.79 for XGBoost, suggesting that environmental variables, particularly water-related contextual exposures, may provide incremental predictive information for PSC beyond laboratory and baseline features.

We also compared the primary machine learning models with traditional statistical models, including logistic regression and LASSO logistic regression (Supplementary Table 7). In the full feature models, logistic regression and LASSO achieved AUCs of 0.64 and 0.65 for PBC, and 0.75 and 0.73 for PSC, respectively. Overall, RF and XGBoost outperformed these traditional statistical models, supporting the added value of nonlinear machine learning approaches.

Given the strong association between PSC and IBD, we quantified IBD prevalence and performed exploratory subgroup analyses stratified by IBD status among PSC cases (Supplementary Table 8). IBD was present in 380 of 542 PSC cases (70.1%) compared with 10 of 663 controls (1.5%). In the primary PSC analysis, patients with IBD were not excluded because IBD is highly prevalent in PSC and represents an important component of the real-world PSC population. For the sensitivity analysis, PSC-IBD was defined as PSC cases with IBD, whereas PSC-alone was defined as PSC cases without IBD. Each subgroup was compared separately with the full control group using propensity score-weighted 5-fold cross-validation. In the PSC-IBD subgroup, RF and XGBoost achieved AUCs of 0.77 and 0.77, respectively. After excluding PSC cases with IBD, the PSC-alone subgroup still showed discriminatory performance, with AUCs of 0.83 for RF and 0.82 for XGBoost. These findings suggest that PSC model performance was not solely driven by IBD-associated clinical patterns. However, the PSC-alone subgroup showed lower recall and F1 scores, indicating less balanced classification performance in this smaller subgroup. These findings suggest that PSC prediction was not solely driven by IBD-associated clinical patterns. However, these subgroup findings should be interpreted cautiously because of the smaller number of PSC-alone cases.

Finally, we performed bootstrap-based pairwise comparisons of full model AUCs using RF as the reference model (Supplementary Table 9). For PBC, RF and XGBoost showed comparable discrimination, with an AUC difference of 0.009 (95%CI: -0.002 to 0.020; P = 0.106). RF significantly outperformed logistic regression (AUC difference, 0.257; 95%CI: 0.104 to 0.410; P < 0.001) and LASSO regression (AUC difference, 0.256; 95%CI: 0.104 to 0.408; P < 0.001). For PSC, RF showed higher AUC than XGBoost (AUC difference, 0.018; 95%CI: 0.006 to 0.030; P = 0.004), logistic regression (AUC difference, 0.051; 95%CI: 0.021 to 0.081; P = 0.001), and LASSO regression (AUC difference, 0.074; 95%CI: 0.030 to 0.118; P < 0.001). Overall, the sensitivity analyses supported the robustness of our findings, demonstrated the strong contribution of longitudinal laboratory features, and showed that environmental variables provided modest complementary predictive information, particularly for PSC.

DISCUSSION

In this study, we evaluated whether environmental exposome data, particularly water- and air-related exposures linked to residential histories, provide pre-diagnostic predictive signals for patients who later received a diagnosis of PBC or PSC when integrated with EHR-derived clinical data. Our findings demonstrate the feasibility of combining SCE data with socio-demographic, behavioral, laboratory, and residential exposure information to study chronic cholestatic liver diseases. Importantly, the goal of incorporating environmental variables was not to replace established clinical predictors, such as laboratory tests, but to determine whether nonclinical environmental variables provide complementary information relevant to pre-diagnostic risk stratification. The use of SHAP values further enabled interpretation of feature contributions and helped identify both clinical and environmental factors associated with model predictions.

Overall, the contribution of environmental exposures differed by disease. Across both PBC and PSC, laboratory-derived dynamic features provided the strongest clinical signal when included, which is expected given the cholestatic nature of these diseases. However, water- and air-related variables provided modest but measurable incremental information beyond baseline demographic and behavioral features. This suggests that environmental variables may capture contextual, nonclinical signals that are not fully represented by standard EHR variables, although their incremental contribution was modest compared with laboratory-derived features. Therefore, the environmental exposome should be interpreted as a complementary layer of risk information rather than as a replacement for laboratory-based clinical predictors.

Specifically, for PBC, the environmental contribution was modest, which may reflect the relatively strong laboratory phenotype of PBC, limited sample size, and greater missingness in environmental variables. Nevertheless, the presence of a modest environmental signal suggests that spatial and contextual exposures may warrant further investigation in larger cohorts with more complete exposure ascertainment. In contrast, in PSC, environmental exposures such as PM10 and PM2.5, NO2, SO2, O3, and carbon monoxide consistently emerged as important contributors, and their inclusion provided modest incremental discrimination. These patterns may reflect disease-specific differences in the types of pre-diagnostic signals captured by the models. For PBC, model performance appeared to rely more heavily on laboratory and metabolic markers[29,30]. For PSC, environmental variables may have captured contextual signals related to immune-mediated or gut-liver axis pathways[31-33]. These findings suggest that environmental exposures, particularly water-related contextual exposures and air pollution measures, may provide modest complementary information for PSC beyond clinical laboratory trajectories alone.

Moreover, our findings are biologically plausible given the links between PSC, IBD, gut microbial dysregulation, and immune-mediated biliary injury. The more apparent environmental signal in PSC may be consistent with the broader gut-liver axis involvement described in PSC. Specifically, air pollutants such as PM, NO2, SO2, O3, and carbon monoxide have been linked to biological processes relevant to hepatobiliary injury, including oxidative stress, chronic inflammation[4-6], immune dysregulation[7-9], and perturbation of the gut-liver axis[10-12]. These pathways may be particularly relevant to PSC given its strong association with IBD, gut dysbiosis, microbial products, and systemic immune activation[13-16]. Prior exposomics and metabolomics studies have also linked pesticides, additives, persistent pollutants, and polychlorinated biphenyls with PBC and PSC, supporting the concept that environmental chemicals may influence cholestatic liver disease through immune, metabolic, microbial, and hepatobiliary pathways[17]. Therefore, even if environmental variables are not dominant predictors, their modest contribution may reflect contextual factors associated with disease-related heterogeneity and warrants further investigation.

SHAP-based analyses provided additional insight into the clinical and environmental signals captured by the models. For PBC, liver-related laboratory trajectories, particularly AST and ALP slopes, were among the strongest predictive contributors, consistent with the cholestatic nature of the disease[1]. Environmental variables, including air pollution measures linked to current residential address, also contributed to model predictions but generally ranked lower than laboratory-derived features, suggesting a complementary rather than dominant role for environmental exposures in PBC prediction. For PSC, environmental variables appeared more prominently among influential predictors. Air pollution measures, including O3, PM, NO2, SO2, and carbon monoxide from current and prior residential addresses, contributed to model predictions, supporting the relevance of cumulative and time-varying environmental context. In addition, several nontraditional laboratory features, such as RDW slope, emerged as important predictive signals. Although RDW is not a conventional diagnostic marker for PSC, longitudinal changes in RDW may reflect systemic inflammation, anemia, nutritional status, chronic disease burden, or IBD-associated inflammatory patterns[34,35]. These findings should be interpreted as hypothesis-generating predictive signals rather than causal effects and warrant future validation in independent cohorts.

Our study extends prior work by integrating environmental exposures with longitudinal EHR-derived clinical and laboratory data. Previous environmental survey, exposomic, and metabolomic studies have provided important evidence that environmental chemicals, pesticides, additives, persistent pollutants, and related metabolic pathways may be associated with PBC and PSC. Separately, prior machine learning studies in PBC and PSC have largely focused on clinical, laboratory, genetic, microbiome, or multi-omics predictors rather than residential-history-based environmental exposures[18-22]. By incorporating temporal residential exposure histories into interpretable machine learning models, our study provides evidence that environmental exposures retain modest complementary predictive information, even when combined with strong clinical predictors. This supports the potential value of incorporating environmental context into risk prediction frameworks for immune-mediated cholestatic liver diseases[17].

From a clinical and public health perspective, these findings suggest that environmental exposome data may help characterize risk context before formal diagnosis. Although environmental variables alone are unlikely to replace clinical predictors, they may support earlier risk stratification, generate hypotheses about modifiable exposures, and identify subgroups for future mechanistic or prospective studies. This is consistent with the emerging concept of precision environmental health, which leverages environmental and multi-level data to identify exposure-related disease mechanisms, biomarkers of exposure and response, and prevention or intervention strategies[36]. This is particularly relevant for rare cholestatic liver diseases, where large prospective cohorts are difficult to establish and environmental signals may be modest but informative when integrated across residential histories.

The major strength of this study lies in its innovative integration of environmental exposures, temporal residential histories, and EHR-derived clinical and laboratory data to predict cholestatic liver diseases. The explicit incorporation of the time dimension of environmental exposures represents an important step beyond static exposure assessments and provides new insights into the cumulative effects of long-term exposures. By linking residential exposure histories with longitudinal EHR features, our approach enabled evaluation of pre-diagnostic environmental signals and assessment of whether SCE variables provide complementary information beyond traditional clinical predictors. The use of interpretable machine learning methods further improved transparency by identifying both clinical and environmental contributors to model predictions. Nevertheless, the limitations of our study should be acknowledged. First, environmental exposures were estimated from residential addresses, which may not fully capture individual-level variability, occupational exposures, indoor exposures, daily mobility, or geographic relocation. To mitigate this limitation, we incorporated both current and prior residential histories to better approximate cumulative exposure before diagnosis. Second, water-related variables were derived from participant surveys and included only three categories: Water source (private well, bottled water, or community supply), area of residence (urban, suburban, or rural), and neighborhood type (industrial, agricultural, or residential). These variables serve as proxies for potential water-related exposures but do not capture direct measures of water quality or specific contaminants. Third, laboratory-derived features contributed substantially to model performance, particularly longitudinal liver-related trajectories. Because biochemical abnormalities are part of the clinical evaluation of PBC and PSC, these predictors require careful interpretation. However, our study design reduced the likelihood of direct diagnostic leakage by deriving predictor variables only from the observation window ending 12 months before the index date; no laboratory values from the prediction window immediately preceding diagnosis were used for model training. In addition, we performed sensitivity analyses excluding key liver enzyme variables, including AST and ALP. Although model performance decreased after exclusion of these variables, discrimination remained reasonable, suggesting that prediction was not entirely dependent on major liver enzyme markers. Accordingly, the models should be interpreted as tools for pre-diagnostic identification of patients who later received a diagnosis of PBC or PSC, rather than as models predicting de novo disease onset in otherwise disease-free individuals. Fourth, strong association between PSC and IBD represents an important consideration. In the primary PSC analysis, patients with IBD were not excluded because IBD is highly prevalent among patients with PSC and reflects the real-world clinical spectrum of PSC. To examine whether model performance was driven primarily by IBD-associated clinical patterns, we performed sensitivity analysis stratifying PSC cases by IBD status. The models retained discrimination both in PSC-IBD cases and in PSC-alone cases after excluding patients with IBD, suggesting that PSC prediction was not solely driven by IBD-associated patterns. However, residual IBD-related confounding cannot be fully excluded. In particular, the PSC-alone subgroup had lower recall and F1 scores despite relatively high AUCs, indicating less balanced classification performance. Future studies with larger PSC-alone cohorts and IBD-enriched disease control groups are needed to better distinguish PSC-specific signals from IBD-associated clinical patterns.

Fifth, unmeasured lifestyle, genetic, occupational, and healthcare-related confounders may contribute to residual bias. Although we included a wide range of demographic, behavioral, laboratory, and environmental variables, residual confounding cannot be excluded. Sixth, the retrospective case-control design limits causal inference and precludes estimation of incidence or absolute risk. To strengthen temporality, we anchored exposures and clinical features to pre-index observation windows, but we cannot fully exclude reverse causation, such as disease-related relocation or changes in healthcare utilization before diagnosis. Seventh, missing data across clinical, laboratory, and environmental variables represent another limitation. Although we applied imputation strategies to minimize data loss and preserve statistical power, residual bias due to non-random missingness cannot be excluded. We also conducted sensitivity analyses using different observation windows and feature constructions to evaluate robustness. Eight, the lacking of independent external validation. Although the models were evaluated using a held-out testing set, all data were derived from the Mayo Clinic system. Therefore, the held-out testing set represents internal validation and does not establish generalizability to other healthcare systems, geographic regions, or patient populations. Future studies should validate these models in independent temporal, geographic, and multicenter cohorts with comparable EHR, residential history, and environmental exposure data. Such validation should also assess model calibration, transportability, and performance across demographic and geographic subgroups before any clinical implementation. Finally, the modest sample size, particularly for PSC and subgroup analyses, limits statistical power. We applied machine learning models with cross-validation, propensity score weighting, and interpretable SHAP analysis to enhance robustness within the available data.

CONCLUSION

This study demonstrates the feasibility of integrating environmental exposures, temporal residential histories, and EHR-derived clinical and laboratory data using machine learning models for pre-diagnostic identification of PBC and PSC. Laboratory-derived trajectories provided the strongest predictive signals, likely reflecting early or subclinical disease-related changes, while environmental variables provided modest complementary information, particularly for PSC. These findings support further investigation of environmental exposome factors as contextual signals for risk stratification and early identification of cholestatic liver diseases.

References
1.  Lindor KD, Bowlus CL, Boyer J, Levy C, Mayo M. Primary Biliary Cholangitis: 2018 Practice Guidance from the American Association for the Study of Liver Diseases. Hepatology. 2019;69:394-419.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Cited by in Crossref: 758]  [Cited by in RCA: 593]  [Article Influence: 84.7]  [Reference Citation Analysis (10)]
2.  Bowlus CL, Arrivé L, Bergquist A, Deneau M, Forman L, Ilyas SI, Lunsford KE, Martinez M, Sapisochin G, Shroff R, Tabibian JH, Assis DN. AASLD practice guidance on primary sclerosing cholangitis and cholangiocarcinoma. Hepatology. 2023;77:659-702.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Cited by in Crossref: 301]  [Cited by in RCA: 328]  [Article Influence: 109.3]  [Reference Citation Analysis (4)]
3.  Hirschfield GM, Dyson JK, Alexander GJM, Chapman MH, Collier J, Hübscher S, Patanwala I, Pereira SP, Thain C, Thorburn D, Tiniakos D, Walmsley M, Webster G, Jones DEJ. The British Society of Gastroenterology/UK-PBC primary biliary cholangitis treatment and management guidelines. Gut. 2018;67:1568-1594.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 294]  [Cited by in RCA: 269]  [Article Influence: 33.6]  [Reference Citation Analysis (4)]
4.  Xu MX, Ge CX, Qin YT, Gu TT, Lou DS, Li Q, Hu LF, Feng J, Huang P, Tan J. Prolonged PM2.5 exposure elevates risk of oxidative stress-driven nonalcoholic fatty liver disease by triggering increase of dyslipidemia. Free Radic Biol Med. 2019;130:542-556.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Cited by in Crossref: 221]  [Cited by in RCA: 190]  [Article Influence: 27.1]  [Reference Citation Analysis (0)]
5.  Cho SH, Hwang SE, Kim HJ, Kim S, Kang YH, Yun JM, Park JH. Association between long-term exposure to ambient air pollution and an increased risk of steatotic liver disease. Sci Rep. 2025;15:21922.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in RCA: 1]  [Reference Citation Analysis (0)]
6.  Lan Y, Zhang H, Wu A, Huang J, Guo Z, Chen Y. Long-term exposure to air pollution and liver fibrosis in the elderly with MASLD. Sci Rep. 2025;15:29969.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in RCA: 2]  [Reference Citation Analysis (0)]
7.  Glencross DA, Ho TR, Camiña N, Hawrylowicz CM, Pfeffer PE. Air pollution and its effects on the immune system. Free Radic Biol Med. 2020;151:56-68.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Cited by in Crossref: 215]  [Cited by in RCA: 447]  [Article Influence: 74.5]  [Reference Citation Analysis (9)]
8.  Tuazon JA, Kilburg-Basnyat B, Oldfield LM, Wiscovitch-Russo R, Dunigan-Russell K, Fedulov AV, Oestreich KJ, Gowdy KM. Emerging Insights into the Impact of Air Pollution on Immune-Mediated Asthma Pathogenesis. Curr Allergy Asthma Rep. 2022;22:77-92.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 42]  [Cited by in RCA: 29]  [Article Influence: 7.3]  [Reference Citation Analysis (0)]
9.  van Voorhis M, Knopp S, Julliard W, Fechner JH, Zhang X, Schauer JJ, Mezrich JD. Exposure to atmospheric particulate matter enhances Th17 polarization through the aryl hydrocarbon receptor. PLoS One. 2013;8:e82545.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 95]  [Cited by in RCA: 119]  [Article Influence: 9.2]  [Reference Citation Analysis (0)]
10.  Mazumder MHH, Hussain S. Air-Pollution-Mediated Microbial Dysbiosis in Health and Disease: Lung-Gut Axis and Beyond. J Xenobiot. 2024;14:1595-1612.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Cited by in RCA: 18]  [Reference Citation Analysis (0)]
11.  Konturek PC, Harsch IA, Konturek K, Schink M, Konturek T, Neurath MF, Zopf Y. Gut⁻Liver Axis: How Do Gut Bacteria Influence the Liver? Med Sci (Basel). 2018;6:79.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 55]  [Cited by in RCA: 92]  [Article Influence: 11.5]  [Reference Citation Analysis (2)]
12.  Di Ciaula A, Baj J, Garruti G, Celano G, De Angelis M, Wang HH, Di Palo DM, Bonfrate L, Wang DQ, Portincasa P. Liver Steatosis, Gut-Liver Axis, Microbiome and Environmental Factors. A Never-Ending Bidirectional Cross-Talk. J Clin Med. 2020;9:2648.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 137]  [Cited by in RCA: 120]  [Article Influence: 20.0]  [Reference Citation Analysis (3)]
13.  Kaplan GG, Hubbard J, Korzenik J, Sands BE, Panaccione R, Ghosh S, Wheeler AJ, Villeneuve PJ. The inflammatory bowel diseases and ambient air pollution: a novel association. Am J Gastroenterol. 2010;105:2412-2419.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 226]  [Cited by in RCA: 203]  [Article Influence: 12.7]  [Reference Citation Analysis (0)]
14.  Olstrup H, Mohamed HAS, Honoré J, Schullehner J, Sigsgaard T, Forsberg B, Oudin A. Air pollution exposure and inflammatory bowel disease: a systematic literature review of epidemiological and mechanistic studies. Front Environ Health. 2024;3:1463016.  [PubMed]  [DOI]  [Full Text]
15.  Li FR, Wu KY, Fan WD, Chen GC, Tian H, Wu XB. Long-term exposure to air pollution and risk of incident inflammatory bowel disease among middle and old aged adults. Ecotoxicol Environ Saf. 2022;242:113835.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Cited by in Crossref: 1]  [Cited by in RCA: 34]  [Article Influence: 8.5]  [Reference Citation Analysis (0)]
16.  Adami G, Pontalti M, Cattani G, Rossini M, Viapiana O, Orsolini G, Benini C, Bertoldo E, Fracassi E, Gatti D, Fassio A. Association between long-term exposure to air pollution and immune-mediated diseases: a population-based cohort study. RMD Open. 2022;8:e002055.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 2]  [Cited by in RCA: 106]  [Article Influence: 26.5]  [Reference Citation Analysis (0)]
17.  Walker DI, Juran BD, Cheung AC, Schlicht EM, Liang Y, Niedzwiecki M, LaRusso NF, Gores GJ, Jones DP, Miller GW, Lazaridis KN. High-Resolution Exposomics and Metabolomics Reveals Specific Associations in Cholestatic Liver Diseases. Hepatol Commun. 2022;6:965-979.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 22]  [Cited by in RCA: 26]  [Article Influence: 6.5]  [Reference Citation Analysis (0)]
18.  Gerussi A, Verda D, Cappadona C, Cristoferi L, Bernasconi DP, Bottaro S, Carbone M, Muselli M, Invernizzi P, Asselta R;  On Behalf Of The Italian Pbc Genetics Study Group. LLM-PBC: Logic Learning Machine-Based Explainable Rules Accurately Stratify the Genetic Risk of Primary Biliary Cholangitis. J Pers Med. 2022;12:1587.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in RCA: 11]  [Reference Citation Analysis (1)]
19.  Zeng Z, Fang J, Chen L, Liang Y, Li D, Xia L, Xie L. Integrating Machine Learning and Multiomics Analyses to Identify Immune-Related Biomarkers and Mechanisms in Primary Biliary Cholangitis. Clin Transl Gastroenterol. 2025;16:e00907.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in RCA: 1]  [Reference Citation Analysis (2)]
20.  Wang Q, Tang X, Qiao W, Sun L, Shi H, Chen D, Xu B, Liu Y, Zhao J, Huang C, Jin R. Machine learning-based characterization of the gut microbiome associated with the progression of primary biliary cholangitis to cirrhosis. Microbes Infect. 2024;26:105368.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Cited by in RCA: 10]  [Reference Citation Analysis (1)]
21.  Shi H, Wang Q, Xu B, Liu Y, Zhao J, Yang X, Huang C, Jin R. Research on gut microbiota characteristics of PBC patients at different ALBI grades based on machine learning. Front Microbiol. 2024;15:1495170.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 3]  [Cited by in RCA: 3]  [Article Influence: 1.5]  [Reference Citation Analysis (5)]
22.  Shao W, Gong P, Wang Q, Ding F, Shen W, Zhang H, Huang A, Liu C. Association of exposure to multiple volatile organic compounds with ultrasound-defined hepatic steatosis and fibrosis in the adult US population: NHANES 2017-2020. Front Public Health. 2024;12:1437519.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 6]  [Cited by in RCA: 6]  [Article Influence: 6.0]  [Reference Citation Analysis (1)]
23.  Eaton JE, Juran BD, Atkinson EJ, Schlicht EM, Xie X, de Andrade M, Lammert CS, Luketic VA, Odin JA, Koteish AA, Kowdley KV, Chopra KB, Hirschfield GM, Chalasani NP, Lazaridis KN. A comprehensive assessment of environmental exposures among 1000 North American patients with primary sclerosing cholangitis, with and without inflammatory bowel disease. Aliment Pharmacol Ther. 2015;41:980-990.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Cited by in Crossref: 40]  [Cited by in RCA: 45]  [Article Influence: 4.1]  [Reference Citation Analysis (0)]
24.  Little R, Rubin D.   Statistical Analysis with Missing Data, Third Edition. Wiley Series in Probability and Statistics, 2019.  [PubMed]  [DOI]
25.  Therneau TM, Grambsch PM.   Modeling Survival Data: Extending the Cox Model. Springer New York, 2000.  [PubMed]  [DOI]
26.  Zou KH, O'Malley AJ, Mauri L. Receiver-operating characteristic analysis for evaluating diagnostic tests and predictive models. Circulation. 2007;115:654-657.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Cited by in Crossref: 788]  [Cited by in RCA: 881]  [Article Influence: 46.4]  [Reference Citation Analysis (0)]
27.  Lundberg SM, Nair B, Vavilala MS, Horibe M, Eisses MJ, Adams T, Liston DE, Low DK, Newman SF, Kim J, Lee SI. Explainable machine-learning predictions for the prevention of hypoxaemia during surgery. Nat Biomed Eng. 2018;2:749-760.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 1069]  [Cited by in RCA: 1032]  [Article Influence: 129.0]  [Reference Citation Analysis (5)]
28.  Lundberg S, Lee SI.   A Unified Approach to Interpreting Model Predictions. Available from: arXiv:1705.07874.  [PubMed]  [DOI]  [Full Text]
29.  Hao J, Yang T, Zhou Y, Gao GY, Xing F, Peng Y, Tao YY, Liu CH. Serum Metabolomics Analysis Reveals a Distinct Metabolic Profile of Patients with Primary Biliary Cholangitis. Sci Rep. 2017;7:784.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 38]  [Cited by in RCA: 37]  [Article Influence: 4.1]  [Reference Citation Analysis (1)]
30.  Kouroumalis E, Samonakis D, Voumvouraki A. Biomarkers for primary biliary cholangitis: current perspectives. Hepat Med. 2018;10:43-53.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 11]  [Cited by in RCA: 18]  [Article Influence: 2.3]  [Reference Citation Analysis (1)]
31.  Park JW, Kim JH, Kim SE, Jung JH, Jang MK, Park SH, Lee MS, Kim HS, Suk KT, Kim DJ. Primary Biliary Cholangitis and Primary Sclerosing Cholangitis: Current Knowledge of Pathogenesis and Therapeutics. Biomedicines. 2022;10:1288.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 51]  [Cited by in RCA: 49]  [Article Influence: 12.3]  [Reference Citation Analysis (1)]
32.  Juran BD, McCauley BM, Atkinson EJ, Schlicht EM, Bianchi JK, Vollenweider JM, Ye H, LaRusso NF, Gores GJ, Sun Z, Lazaridis KN. Epigenetic disease markers in primary sclerosing cholangitis and primary biliary cholangitis-methylomics of cholestatic liver disease. Hepatol Commun. 2024;8:e0496.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Cited by in RCA: 6]  [Reference Citation Analysis (0)]
33.  Hu J, Wu Y, Zhang D, Wang X, Sheng Y, Liao H, Ou Y, Chen Z, Shu B, Gui R. Regulatory T cells-related gene in primary sclerosing cholangitis: evidence from Mendelian randomization and transcriptome data. Genes Immun. 2024;25:492-513.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 3]  [Cited by in RCA: 2]  [Article Influence: 1.0]  [Reference Citation Analysis (0)]
34.  Yeşil A, Senateş E, Bayoğlu IV, Erdem ED, Demirtunç R, Kurdaş Övünç AO. Red cell distribution width: a novel marker of activity in inflammatory bowel disease. Gut Liver. 2011;5:460-467.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 107]  [Cited by in RCA: 102]  [Article Influence: 6.8]  [Reference Citation Analysis (11)]
35.  Katsaros M, Paschos P, Giouleme O. Red cell distribution width as a marker of activity in inflammatory bowel disease: a narrative review. Ann Gastroenterol. 2020;33:348-354.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 6]  [Cited by in RCA: 20]  [Article Influence: 3.3]  [Reference Citation Analysis (1)]
36.  Baccarelli A, Dolinoy DC, Walker CL. A precision environmental health approach to prevention of human disease. Nat Commun. 2023;14:2449.  [RCA]  [PubMed]  [DOI]  [Full Text]  [Full Text (PDF)]  [Cited by in Crossref: 43]  [Cited by in RCA: 88]  [Article Influence: 29.3]  [Reference Citation Analysis (0)]
Footnotes

Peer review: Externally peer reviewed.

Peer-review model: Single blind

Specialty type: Gastroenterology and hepatology

Country of origin: United States

Peer-review report’s classification

Scientific quality: Grade B, Grade B

Novelty: Grade B, Grade C

Creativity or innovation: Grade B, Grade C

Scientific significance: Grade B, Grade B

P-Reviewer: Ekong AH, PhD, Post Doctoral Researcher, Researcher, Senior Researcher, Nigeria; Luo JF, MD, PhD, China S-Editor: Fan M L-Editor: A P-Editor: Wang WB

Write to the Help Desk