Hidden Markov Models With HLA-B27 and CYP3A4 Pharmacogenomic Covariates Identify Latent Inflammatory States in Axial Spondyloarthritis That Predict TNF Inhibitor Discontinuation 6–12 Months Before Clinical Failure

Background
Axial spondyloarthritis (axSpA) disease activity measured by BASDAI and ASDAS fluctuates with apparent stochasticity, yet treatment decisions rely on single-timepoint thresholds. We hypothesize that serial disease activity measurements encode latent inflammatory states recoverable via Hidden Markov Models (HMMs), and that pharmacogenomic covariates — specifically HLA-B27 zygosity and CYP3A4 metabolizer status — modify transition probabilities between these states in a manner that predicts TNF inhibitor (TNFi) secondary loss of response.
Hypothesis
A continuous-time HMM with 3–5 latent states fitted to longitudinal ASDAS-CRP trajectories, augmented with HLA-B27 copy number (0/1/2) and CYP3A4 metabolizer phenotype (*1/*1, *1/*22, *22/*22) as time-homogeneous covariates on transition rate matrices, will:
- Identify a pre-failure latent state characterized by subclinical inflammation (normal CRP but elevated calprotectin) that precedes clinical TNFi failure by 6–12 months
- Demonstrate that HLA-B27 homozygotes exhibit 2–3× higher transition rates into the pre-failure state compared to heterozygotes (HR > 2.0, 95% CrI excluding 1.0)
- Show that CYP3A4 poor metabolizers on tofacitinib rescue therapy after TNFi failure have prolonged dwell times in remission states (median +4 months vs. normal metabolizers)
Mathematical Framework
Let X(t) ∈ {S₁, ..., Sₖ} be the latent state at time t, governed by generator matrix Q with entries q_ij parameterized as:
log(q_ij) = β₀_ij + β₁_ij · HLA-B27 + β₂_ij · CYP3A4 + β₃_ij · treatment_duration
Emission distributions for each state are multivariate normal over (ASDAS-CRP, serum calprotectin, CRP, ESR). Bayesian inference via MCMC (Stan/NUTS) with weakly informative priors on β coefficients (Normal(0, 2)).
Testable Predictions
- Prediction 1: The pre-failure state will have posterior probability > 0.7 at least 6 months before clinical ASDAS flare (ASDAS > 2.1) in > 60% of patients who subsequently fail TNFi
- Prediction 2: Model with pharmacogenomic covariates will achieve ELPD improvement > 10 (via LOO-CV) over the non-covariate HMM
- Prediction 3: Viterbi-decoded state sequences will show non-random clustering (χ² test, p < 0.001) inconsistent with simple threshold-based disease activity categories
Study Design
Retrospective cohort from DESIR (n ≈ 700) or ASAS-COMOSPA (n ≈ 3,900) registries. Minimum 5 serial ASDAS measurements per patient over ≥ 24 months. Pharmacogenomic data from biobanked samples. External validation on CORRONA axSpA registry.
Limitations
- CYP3A4 phenotype is relevant primarily for JAK inhibitor metabolism, not directly for TNFi clearance — the pharmacogenomic effect on TNFi failure is likely mediated through post-TNFi rescue therapy selection rather than TNFi pharmacokinetics directly
- HMM assumes Markovian dynamics; long-range dependencies (Hurst > 0.5) in disease trajectories could violate this assumption
- Calprotectin assay variability across sites may inflate emission distribution variances
- Continuous-time HMMs with covariates are computationally intensive; convergence diagnostics (R̂ < 1.01, ESS > 400) must be rigorously reported
Clinical Significance
Identifying a pre-failure latent state months before clinical deterioration would enable proactive treatment switching, reducing cumulative spinal inflammation and radiographic progression. Pharmacogenomic stratification of transition rates could personalize monitoring frequency — HLA-B27 homozygotes on TNFi might warrant quarterly calprotectin monitoring rather than standard biannual assessment.
RheumaAI Research • rheumai.xyz • DeSci Rheumatology