Abstract
Motivation
Cancer progresses through the accumulation of genomic events. Cancer progression models such as Mutual Hazard Networks (MHNs) describe this dynamic, enabling prediction of temporal event positions and patient-specific risks of acquiring mutations. However, current MHN analyses rely on single most likely models and do not quantify the uncertainty inherent to parameter estimation. Assessing forecast stability is essential before using them to anticipate treatment-relevant mutations, adapt targeted therapies, or prioritize monitoring of patients at elevated progression risk.
Results
We address a key prerequisite for the responsible clinical use of cancer progression models by making MHN-derived predictions uncertainty-aware. We present a Bayesian framework for MHN that uses Markov Chain Monte Carlo to sample from the posterior distributions of model parameters and derived predictions. For practical use we implemented the Random-Walk Metropolis, Metropolis-Adjusted Langevin Algorithm (MALA), and simplified manifold MALA samplers as part of the existing mhn Python package. Only MALA and smMALA were successful in sampling from MHN posteriors, with MALA performing best. While most MHN parameters and predictions showed low posterior variance, a small subset displayed greater variability across the posterior distribution. This differentiation cannot be obtained from a single most likely model, emphasizing the need for uncertainty quantification, especially in clinical contexts. As an illustrative example, posterior sampling identified a subgroup of STK11$-$, KRAS$+$ lung adenocarcinoma patients with a high predicted short-term risk—with low variance across posterior samples—to develop an STK11 mutation. This subgroup exhibited poorer survival under immunotherapy, resembling patterns observed in STK11+ patients.
Availability and implementation
Our implementation is part of version 1.2.0 of the mhn package (https://github.com/spang-lab/LearnMHN). All analyses including the code to produce all figures in this article can be found under https://github.com/huy29433/MCMC-sampling-for-MHN (https://doi.org/10.5281/zenodo.21160219).
1 Introduction
Cancer progresses through the accumulation of somatic genomic alterations. These alterations interact, shape tumor behavior, and influence treatment response and disease progression. Understanding how such events accumulate over time is therefore central to both cancer biology and clinical oncology.
Cancer progression models describe this process by modeling the dependencies between the genomic events that drive tumor development. These dependencies reflect both positive and negative synergies between the events. Moreover cancer progression models reveal frequently occurring mutational patterns and, in some cases, predict events that are likely to occur soon (Diaz-Colunga and Diaz-Uriarte 2021).
Direct validation of predicted future mutations, e.g. by repeat tissue sampling, is currently not feasible as repeated invasive biopsies raise ethical and clinical concerns (Mannelli 2019). Instead, predictions can be assessed indirectly by testing whether patients who are currently mutation-negative but predicted to acquire a mutation soon show similar prognosis or treatment response as patients who already carry that mutation.
From a clinical perspective, such forecasts are potentially valuable. Anticipating treatment-relevant mutations could inform therapy adaptation, risk stratification, or intensified monitoring.
State-of-the-art cancer progression models include but are not limited to, Conjunctive Bayesian Networks (Gerstung et al. 2009, 2011, Montazeri et al. 2016), Hidden Extended Suppes-Bayes Causal Networks (Angaroni et al. 2022), Network Aberration Models (Hjelm et al. 2006), Hypercubic Transition Path Sampling (Johnston and Williams 2016, Aga et al. 2024), Hypercubic inference of hidden Markov models (Moen and Johnston 2023), and Mutual Hazard Networks (MHNs):
MHNs model tumor progression as a continuous process in which mutations accumulate irreversibly. (Other genomic events, like copy number alterations, are also possible.) Each mutation accumulates according to a specific rate that is modulated by the presence of other mutations (Schill et al. 2019). Since an extension by Schill et al. (2024), MHNs additionally model the observation of the tumor as a random event dependent on the genomic profile. Further MHN variants describe the forming of metastases (Rupp et al. 2024), infer dynamics from phylogenetic trees (Luo et al. 2023), enable training on large datasets through approximation (Pfahler et al. 2026), or incorporate timing information (Chen 2023).
From a trained MHN we can infer key properties of tumor dynamics: It reconstructs tumor histories by inferring the most likely order in which mutations occurred. It can generate artificial tumor trajectories showing temporal trends. Moreover, an MHN can predict the next mutation to occur in patients, given their current genotype. Finally, to patients who do not yet have a certain mutation, it assigns the risks of developing it in the near future.
For cancer progression models to gain practical and clinical credibility, it is essential to assess the uncertainty associated with both the model parameters and the predictions derived from them. So far, only the single most likely MHN with respect to a dataset has been considered, which provides no insight into the robustness and reliability of the inferred tumor dynamics. Without this distinction, model-derived predictions cannot be used with confidence in clinical decision making.
This motivates a Bayesian perspective on the model: Here, the parameters are random variables that depend on the modeled data. Their distribution—the posterior distribution—holds uncertainty information beyond a single most likely point estimate. This uncertainty naturally propagates to uncertainty in model predictions.
Here, we analyze the full posterior distribution of MHNs and propagate parameter uncertainty to simulated tumor trajectories and patient-specific forecasts. Because MHNs’ parameter space is high-dimensional and highly correlated, efficient sampling methods are required. We therefore implement and compare Markov Chain Monte Carlo (MCMC) algorithms tailored to MHNs, including Random-Walk Metropolis (RWM), the Metropolis-Adjusted Langevin Algorithm (MALA), and simplified manifold MALA (smMALA), and identify MALA as a practical approach for posterior inference. Using posterior samples, we assess the stability of model parameters and derived predictions.
Bayesian inference and uncertainty quantification have already previously been applied to other cancer progression models: Angaroni et al. (2022), Johnston and Williams (2016), and Aga et al. (2024) leverage MCMC for model training. Moen and Johnston (2023) investigate uncertainty from data sampling using bootstrap resampling. For Hypercubic Transition Path Sampling models, posterior uncertainty has been investigated and propagated to predictions like event acquisition orderings, likely progression paths (Johnston and Williams 2016, Greenbury et al. 2020, Aga et al. 2024), and risk stratification (Johnston et al. 2019).
In this work, we extend uncertainty quantification via posterior analysis to MHN, which are not inherently Bayesian. We investigate how this uncertainty propagates to forecasts with potential clinical implications. Finally, we show that uninformative penalties can lead to ambiguous posteriors.
2 Methods and resources
We first describe Mutual Hazard Networks, originally introduced by Schill et al. (2019, 2024) as cancer progression models fitted via regularized maximum likelihood estimation. We then provide a brief introduction to Markov Chain Monte Carlo and the sampling algorithms used in this article. Finally, we describe how this Bayesian framework is applied to Mutual Hazard Networks and introduce the datasets used throughout the article.
2.1 Mutual hazard networks
Mutual Hazard Networks (MHNs) are machine-learning models that are trained on cross-sectional genomic data. Each tumor in the dataset is represented as a binary vector that encodes presence or absence of n irreversible cancer progression events such as point mutations in certain oncogenes.
MHNs were originally introduced by Schill et al. (2019). During training an MHN fits parameters (see Fig. 1) that can be interpreted as follows:
Figure 1.

Schematic of an MHN parameter matrix for four events. Base rates of events are plotted in the left column in green. The main matrix shows influence rates between events. Orange cells visualize promoting and blue cells visualize inhibiting effects between events. For example, Event 3 promotes the accumulation of Event 1 (), while Event 1 inhibits the accumulation of Event 2 (). The bottom row visualizes the effect of events on the clinical observation of a tumor.
The logarithmic base rates represent the spontaneous accumulation rate of an event.
The logarithmic influence factors represent the influence of the presence of event j on the accumulation of event i.
Schill et al. (2024), extended MHN by additionally modeling the observation of a tumor, introducing an extra set of parameters (see Fig. 1):
The logarithmic observation effects represent the influence of the presence of event i on the observation rate of the tumor.
The parameters are fitted using regularized maximum likelihood estimation by maximizing
| (1) |
with a dataset D and a penalty term that is weighted by a factor found via cross-validation.
2.1.1 Penalties
For MHN, usually the sparsity-enforcing L1 penalty
| (2) |
or, more recently, a symmetry-favoring variant of it, the symsparse penalty
| (3) |
is used (Schill et al. 2019, 2024).
Here we introduce an L2 variant of (3) that additionally penalizes the base rates:
| (4) |
It corresponds to a generic L2 penalty on the base rates and observation rates but favors reciprocal effects with the same strength and sign. Here, we will call it the symL2 penalty.
The optimal regularization strength for MHN training is usually found through cross-validation. We will follow the strategy from Schill et al. (2024) and perform 5-fold cross validation on 9 logarithmically spaced from to with the size of the dataset. The final used for training will be picked according to the one-standard error rule (Hastie et al. 2009).
2.1.2 Chronological event positions and event risks
Based on the parameters of a fitted MHN, we can use the efficient simulation algorithm from the mhn package (Vocht et al. 2026), based on Gillespie’s algorithm (Gillespie 1977) to simulate artificial tumor trajectories. We can use this to analyze patterns of the tumors and make predictions about the genotypes according to the model: By simulating a large number of tumors from onset to observation, we can investigate whether specific events tend to happen earlier or later in a tumor’s development. Further, by simulating tumors starting from a patient’s genotype, we can estimate the risks of additional events happening within a certain timeframe.
These predictions may have clinical relevance and therefore require rigorous uncertainty quantification. To this end, we adopt a Bayesian perspective by viewing the inferred parameters as a random variable conditioned on the observed dataset.
From this perspective, the regularized maximum likelihood estimate of an MHN corresponds to the maximum of its posterior distribution and the penalty corresponds to a prior distribution. Using this, we can go beyond the maximum likelihood point estimate and sample from the full posterior of an MHN.
Since this posterior distribution is high-dimensional and highly correlated, we approximate it using samples drawn via Markov Chain Monte Carlo. We can then analyze the distribution of the samples and of predictions derived from them.
2.2 Markov Chain Monte Carlo
Markov Chain Monte Carlo (MCMC) algorithms are used to sample from (probability) distributions p that cannot easily be sampled from directly. They construct a discrete-time Markov chain on the sample space whose stationary distribution equals p.
The simplest and most commonly used MCMC algorithm, the Random-Walk Metropolis (RWM), transitions between states of the Markov chain in two steps: In the proposal step, a candidate is proposed based on the current state and some proposal distribution , commonly a Gaussian distribution centered around the current value. (In multi-dimensional space, one value corresponds to one parameter vector, or in our case one MHN.) Then, in the acceptance step, this candidate is accepted if the acceptance ratio is greater than a uniformly random number between 0 and 1. Otherwise the candidate is rejected and the old value is reused as the new value [see Tierney (1994)]. While this algorithm is robust and easy to implement, in high dimensions it can be very slow to converge and can produce highly correlated samples [see Roberts and Rosenthal (1998); Girolami and Calderhead (2011)].
The Metropolis-Adjusted Langevin Algorithm (MALA) exploits information about the distribution in order to make better proposals. It is based on discretized approximations of Langevin diffusions. The Gaussian from which the new proposed value is drawn here is not centered at the current value, but instead is shifted in the direction of the gradient of , scaled by a step size :
| (5) |
This will produce more informed proposals drawn from “higher probability regions,” which will then be more often accepted. In fact, Roberts and Rosenthal (2001) showed that, while an acceptance rate of around 23% of the proposals is optimal for convergence of the Random-Walk Metropolis, for MALA the optimal acceptance rate is around . [While Roberts and Rosenthal (2001) only prove these results for very specific probability distributions, they suggest that they can be still be useful guidelines for more general distributions.] Therefore MALA will in general require less steps to converge to p, especially in higher dimensions. For MHN, the gradient can efficiently be calculated in one step together with the likelihood. In fact, in the current implementation (Vocht et al. 2026), this happens by default, which is why upgrading from Random-Walk Metropolis to MALA does not add significant computational complexity. See Algorithm SA1, available as supplementary data at Bioinformatics online for pseudocode of MALA applied to MHN.
Manifold MALA (mMALA), introduced by Girolami and Calderhead (2011), extends MALA by a proposal that adapts to some geometry at the current value. Distances for the proposal function are not measured via the usual Euclidean metric, but via a Riemannian metric which is induced by some Riemannian metric tensor . In its simplified version (smMALA), that assumes constant curvature, the proposal function becomes
| (6) |
As a metric tensor for sampling from a posterior distribution with prior pr (as its Bayesian counterpart, the prior is directly induced by the penalty), Girolami and Calderhead (2011) suggest the Fisher information matrix of minus the Hessian of the log-prior:
| (7) |
with
| (8) |
The reason for this choice is that the Fisher information matrix (FIM) encodes the distance of two densities on the statistical manifold of parametrized probability density functions. In simpler terms, instead of considering two values similar if their parameters are close to each other, under the FIM as a metric tensor they are considered similar, if they induce similar probability densities. The induced metric is then also independent from reparameterization. In order to also capture prior informativeness in the metric tensor, the negative Hessian of the log-prior is added. See Algorithm A2, available as supplementary data at Bioinformatics online for pseudocode of smMALA applied to MHN.
However, there are some disadvantages to (s)mMALA: For each step, the FIM has to be computed. Even though this can be done analytically for MHNs (see Supplementary 1.1, available as supplementary data at Bioinformatics online), this introduces significant overhead, possibly rendering sampling impossible for big models. Also, it can only be applied with somewhat “well-behaved” priors for which is positive definite, excluding the L1 and symsparse priors induced by Equations (2) and (3). For a detailed explanation of this see Supplementary 1.3, available as supplementary data at Bioinformatics online.
2.2.1 MCMC diagnostics
In MCMC algorithms, the sampled distribution converges to the desired distribution as the number of steps tends to infinity. In practice, however, one wants to have an estimate of how many steps are needed to get close enough to this distribution. One diagnostic of this is the potential scale reduction factor (Gelman and Rubin 1992). It is based on starting multiple chains from different initializations and comparing the variance of the samples of all chains with the variance of the samples within the chains. It is always >1 and suggests better convergence the closer it is to 1. Vehtari et al. (2021) improved it to detect bad convergence for more general distributions and samplers. They recommend to run the sampling until .
Within one MCMC chain, samples are usually autocorrelated. Roughly speaking, the effective sample size (ESS) describes this autocorrelation by estimating how many uncorrelated draws from the distribution would contain the same amount of information.
For both and the ESS we use the arviz Python package by Kumar et al. (2019). (We use the default method for both functions, which for arviz.rhat is "rank" and for arviz.ess is "bulk".)
2.3 MCMC sampling with the mhn.mcmc module
We implemented the three MCMC algorithms RWM, MALA, and smMALA as a submodule of the mhn package (Vocht et al. 2026). Penalties, like the symsparse or the L1 penalty, whose strengths are found in cross-validation, are translated into the corresponding Bayesian priors. (Tuning in cross-validation is standard in machine learning, but not in a classical Bayesian framework, where would be treated as a hyperparameter with its own prior. We chose to keep this optimization-based calibration to ensure that MCMC quantifies uncertainty for MHN models as originally defined.) The implementation includes automatic tuning of the step size and automatic halting as soon as, e.g. the desired is reached.
While other RWM and MALA implementations exist (e.g. Abadi et al. 2015, Clerx et al. 2019), our implementation also includes smMALA, which to our knowledge does not exist as open source code so far. Moreover, our implementation is tailored to MHN and uses its joint likelihood- and gradient evaluation and therefore enables faster sampling than out-of-the-box solutions can. See Supplementary S3, available as supplementary data at Bioinformatics online for a benchmark analysis of the scaling of one MALA step. Finally, this integration allows users to benefit from MCMC sampling for MHN without requiring in-depth knowledge of the underlying mathematics or implementation details.
In this article, we sampled 10 chains for each trained MHN. To reduce memory usage and the cost of downstream predictions, we applied thinning, i.e. storing only every 100th sample. (We found the resulting ESS to be sufficiently large, see Table 1.) We sampled until either a maximal of , or a total of 1 000 000 steps was reached. The initial values for the Markov chains were drawn from either a Laplace distribution (for models trained with the L1 or symsparse penalty) or a Gaussian distribution (for models trained with the symL2 penalty), approximating the priors induced by the penalties. For all diagnostics and analyses we discarded the first 20% of the steps as burn-in. (We chose this as a starting heuristic and saw that it produced sufficiently small , see Table 1).
Table 1.
Effective sample size (ESS) and diagnostic per parameter and number of steps for the MCMC sampling runs from the posteriors of two MHNs trained on the LUAD and COAD dataset, respectively.
| Dataset | ESS median [min, max] | median [min, max] | Steps (without burn-in) |
|---|---|---|---|
| LUAD | 5702.39 [1190.78, 10873.37] | 1.00106 [0.99971, 1.00970] | 146 400 |
| COAD | 4359.84 [1034.83, 9662.62] | 1.00134 [0.99992, 1.00997] | 108 800 |
The bold values show the minimum for ESS and the maximum for R hat.
2.4 Datasets
The results we show in this article are based on MHNs that were trained on the same datasets as in Schill et al. (2024): Somatic mutation data of 3662 lung adenocarcinoma (LUAD) and of 2269 colon adenocarcinoma (COAD), respectively. These datasets were collected by the Memorial Sloan Kettering Cancer Center (Nguyen et al. 2022) and retrieved through AACR GENIE (Sweeney et al. 2017). We selected the 12 most commonly affected genes and followed Schill et al. (2024)’s preprocessing steps.
3 Results
3.1 MHN posterior sampling enabled by gradient-based MCMC
In order to attempt posterior sampling with Markov Chain Monte Carlo, we applied the three sampling algorithms RWM, MALA, and smMALA to an MHN trained on the LUAD dataset with the symL2 penalty given by Equation (4).
We chose this penalty because, as noted above, smMALA requires a sufficiently “well-behaved” prior in our setting. This excludes priors induced by penalties that do not penalize all parameters or that involve L1 regularization. Consequently, unlike the other two samplers, smMALA cannot be used in combination with the standard MHN penalties given by Equations (2) and (3).
Even after 1 000 000 steps, RWM failed to reach satisfactory convergence (Fig. 2A). Its maximal remained at 2.6047, showing that the chains did not mix sufficiently to approximate the posterior distribution.
Figure 2.

Mean, minimum, and maximum and effective sample size (ESS) of all parameters from MCMC samplers applied to an MHN trained on the LUAD dataset with the symL2 penalty [Equation (4)]. The metrics for RWM, MALA and smMALA are plotted against number of steps and time. Diagnostics were evaluated after discarding the first 20% of the steps as burn-in.
In contrast, we were able to achieve MCMC posterior sampling with the two gradient-based samplers, MALA and smMALA. Both reached satisfactory convergence within a few tens of thousands of steps: MALA reached a maximal of after 38 000 steps, and smMALA after only 32 000 steps.
Samples from the gradient-based samplers were also considerably less autocorrelated (Fig. 2C): Even after 1 000 000 steps, the minimal ESS for RWM was only 11.86. In contrast, after 32 000 steps, MALA achieved a minimal ESS of 953.49 and smMALA a minimal ESS of 987.21.
However, in the case of smMALA, this performance came at a substantially increased computational cost: A single RWM or MALA step took 0.0676s and 0.0684s, respectively, whereas a single smMALA took 1.21s, as in our case the FIM has to be computed for each step.
In the following analysis of MHN posteriors, we exclusively use MALA.
3.2 Parameter uncertainty
We analyzed the posteriors of MHNs trained on the LUAD and the COAD dataset with the symsparse penalty, as discussed in Schill et al. (2024).
In Table 1, we report the convergence and autocorrelation diagnostics of the runs and the number of steps to achieve them.
For both datasets, posterior standard deviation of the parameters was very low, especially in the base rates (Figs 3A and 4A). The standard deviation of influence factors and observation rates was higher when their posterior distributions were farther from zero. Parameters with comparatively high standard deviation in the lung cancer model were primarily influences that connected the EGFR mutation to other events or the observation. In the colon cancer model, posterior standard deviations were uniformly small across parameters and no mutation exhibited comparable variability.
Figure 3.

(A) Distribution and standard deviation of the parameter matrix for MHNs trained on the LUAD dataset. Each cell in the left plot shows the 90% posterior interval of the corresponding parameter as a color gradient. For example, the leftmost color in a cell corresponds to the 5% quantile of the parameter’s distribution, the middle color to its 50% quantile, the rightmost color to its 95% quantile. Influence factors and observation rates are shown in blue/orange and base rates are shown in green. Each cell in the right plot shows the standard deviation of the corresponding parameter. (B) Posterior distributions of relative event accumulation times (x-axis), shown as median and 90% posterior intervals. For every 100th MCMC sample, 50 000 artificial tumor trajectories were simulated, and the relative accumulation time of each event was recorded. This yields, for each event and every 100th MCMC sample, a distribution describing when the event tends to occur. The figure summarizes the posterior distribution of these event-specific accumulation-time curves. (C) Predicted short-term mutation risks (median and 90% posterior interval) across patients of the LUAD dataset, predicted by the MCMC samples (x-axis broken and rescaled for high-risk patients). For every 100th MCMC sample, 10 000 artificial tumors were sampled for 1 time unit in Markov time to infer a mutation risk. Only patients who do not exhibit this mutation at the time of sequencing are shown and patients are ordered by median risk. (D) Kaplan–Meier estimate of the survival of immuno-treated, KRAS-positive patients from the LUAD dataset. Survival estimates are stratified by median STK11 risk across MCMC samples.
Figure 4.

(A) Distribution and standard deviation of the parameter matrix for MHNs trained on the COAD dataset. Each cell in the left plot shows the 90% posterior interval of the corresponding parameter as a color gradient. For example, the leftmost color in a cell corresponds to the 5% quantile of the parameter’s distribution, the middle color to its 50% quantile, the rightmost color to its 95% quantile. Influence factors and observation rates are shown in blue/orange and base rates are shown in green. Each cell in the right plot shows the standard deviation of the corresponding parameter. (B) Posterior distributions of relative event accumulation times (x-axis), shown as median and 90% posterior intervals. For every 100th MCMC sample, 50 000 artificial tumor trajectories were simulated, and the relative accumulation time of each event was recorded. This yields, for each event and every 100th MCMC sample, a distribution describing when the event tends to occur. The figure summarizes the posterior distribution of these event-specific accumulation-time curves. (C) Predicted short-term mutation risks (median and 90% posterior interval) across patients of the COAD dataset, predicted by the MCMC samples (x-axis broken and rescaled for high-risk patients). For every 100th MCMC sample, 10 000 artificial tumors were sampled for 1 time unit in Markov time to infer a mutation risk. Only patients who do not exhibit this mutation at the time of sequencing are shown and patients are ordered by median risk. (D) Kaplan–Meier estimate of the survival of immunotherapy-treated patients from the COAD dataset. Survival estimates are stratified by median ARID1A risk across MCMC samples.
3.3 Temporal event positions across posterior samples
We derived the relative temporal positions of events according to the posterior samples. To do so, we simulated 50 000 artificial tumor trajectories for every 100th MCMC sample and recorded the relative accumulation time of each event along the tumor development timeline. For each event and every 100th MCMC sample we thus obtained a distribution over the tumor development, describing when the event tends to occur.
In the posterior of the LUAD model, TP53 was consistently placed early, while EGFR was placed late (Fig. 3B). In the posterior of the COAD model, APC was placed early, KRAS a bit later and TP53 rather late (Fig. 4B). Event position distributions showed little variation, with narrow posterior intervals for these mutations.
3.4 Predicted high-risk and mutation-positive patients with similar prognosis
For each mutation and each patient who did not yet exhibit this mutation at sequencing time, we used the posterior samples to predict the short-term risk of mutation occurrence. To this end, for every 100th MCMC sample and each patient, we simulated 10 000 times from the patient’s genotype forward over a horizon of 1 time unit in Markov time. We recorded the proportion of simulations in which an event occurred as the event’s mutation risk.
Figures 3C and 4C show the median risks for a subset of the mutations and their 90% posterior intervals predicted from the MCMC samples for all LUAD and COAD patients, respectively.
For many mutations in both datasets, the predicted risks ranged from almost 0% to almost 100% across patients, reflecting the heterogeneity in individual risk predictions.
For the lung cancer model, TP53 and KRAS risk predictions showed wide posterior intervals for patients with an intermediate median predicted risk, with posterior intervals spanning up to almost 50 percentage points. In contrast, high- and low-risk predictions exhibited narrower intervals ( and percentage points, respectively). For STK11, both low- and high-risk predictions were comparatively stable, with high-risk posterior intervals spanning <35 percentage points and never dropping below 60%.
We stratified KRAS-mutated, STK11-negative lung cancer patients who received immunotherapy into risk groups according to their posterior median predicted STK11 risk. Figure 3D shows the corresponding Kaplan–Meier survival estimates. High-risk patients exhibited poorer survival compared to medium-risk patients. This observation is in line with STK11-positive patients, that also exhibit poorer survival under immunotherapy (Skoulidis et al. 2018, Ricciuti et al. 2022), suggesting that STK11-positive and STK11-negative high-risk patients form a clinically homogenous group.
In the COAD model, APC and TP53 risk predictions showed wide posterior intervals for patients with an intermediate median predicted risk (posterior intervals spanning up to >55 percentage points), while for very high predicted risks (median ), the posterior interval shrunk to <9 percentage points. For ARID1A, medium-risk patients again showed notable variance in their predicted risk (posterior interval up to almost 46 percentage points), whereas high-risk predictions were comparatively stable with posterior intervals smaller than 40 percentage points and shrinking to <9 percentage points for patients with median risk above 97%.
We stratified ARID1A-negative colon cancer patients who had received immunotherapy according to their median predicted posterior risk. Figure 4D shows their Kaplan–Meier survival estimates. Patients with high predicted AIRD1A risk exhibited better survival compared to the medium-risk group. Again, this was comparable to the prognosis of ARID1A-positive patients (Jiang et al. 2020, Okamura et al. 2020, Tokunaga et al. 2020).
3.5 Multimodal posterior caused by uninformative penalties
Models trained with less informative penalties, that do not promote symmetry, can exhibit ambiguous posteriors:
We sampled from the posteriors of MHNs trained on the LUAD and the COAD dataset with the L1 penalty given by Equation (2). Even after 1 000 000 steps, we could not achieve satisfactory convergence for either of those models—in contrast to the models trained with the symsparse or symL2 penalty. Analyzing the distribution of the produced samples suggests the presence of multiple modes in the models’ posterior distributions. Chains often got stuck in one of these, preventing proper exploration of the probability distribution. Some chains in fact stayed confined within one of the modes for the entire sampling process. In Fig. 5, we show the first two principal components of all MCMC samples, where the modes are clearly visible.
Figure 5.

First two principal components of posterior samples from MHNs trained on the (A) LUAD and (B) COAD dataset with a non-symmetrizing L1 penalty. Every 10th sample is shown and colored by cluster. Cluster identities were assigned by applying HDBSCAN to a 2D UMAPping.
The modes in the LUAD L1 model differed primarily in how they resolved the co-occurrences of STK11 with KEAP1 and KEAP1 with SMARCA4: Two modes explained this with a positive influence of KEAP1 on STK11, while the third reversed this influence. Similar behavior was observed for KEAP1 and SMARC4.
In the same way, the modes in the COAD L1 model reversed directions of KMT2D and RNF43 or ARID1A and KMT2D. See Supplementary S6, available as supplementary data at Bioinformatics online for a detailed description of the modes.
However, many dynamics in cancer are due to positive or negative epistatic (i.e. synergistic) effects (El Tekle et al. 2021, Iranzo et al. 2022) and might instead best be explained symmetrically.
4 Discussion
In this work, we enabled posterior analysis of Mutual Hazard Networks (MHNs) and their predictions through the use of gradient-based MCMC samplers. For this the Metropolis-Adjusted Langevin Algorithm represented the best balance of geometrically informed but computationally efficient steps.
Posterior analysis for models trained on different datasets revealed differences in the stability of MHN-based predictions with respect to parameter estimation.
In the LUAD and COAD model, base rates showed low posterior standard deviation, whereas influence factors between mutations and on the observation exhibited comparably higher variability. Many influence factors from or to the EGFR mutation in lung cancers displayed elevated posterior standard deviation, indicating a slight uncertainty in the role of this mutation. Despite this variability in EGFR-parameters, the derived temporal positions and mutation risks remained stable. This indicates that parameter uncertainties do not necessarily propagate to model predictions.
The temporal event positions remained stable across the posterior in both datasets. They were in line with the orderings reported by Schill et al. (2024) and, in the case of COAD, the sequence APC KRAS TP53 aligned with the established adenoma-to-carcinoma progression model by Vogelstein et al. (2013).
In both dataset, posterior sampling identified subgroups that exhibited a stable risk to develop a certain mutation and that showed similar survival patterns as mutation-positive patients. This suggests that a high predicted mutation risk may anticipate the disease progression and potentially inform early treatment adjustments.
For models trained with less informative penalties, posterior sampling revealed multiple modes in the posterior distribution. These were due to ambiguous directions in influences between two events, where symmetric effects (as encouraged by the symsparse penalty) might be more plausible.
While posterior sampling allows us to identify predictions that are stable with respect to parameter estimation, this is not the only source of uncertainty: Model and penalty choices, as well as feature selection, introduce additional uncertainty. Even earlier, cohort selection, mutation calling, filtering, and data imputation can affect the estimated parameters and resulting predictions. For a comprehensive assessment of uncertainty, all of these steps need to be considered.
Taken together, these observations emphasize the importance of cautious interpretation of cancer progression model predictions. While they are not yet ready for clinical practice, they provide a structured framework for anticipating tumor evolution. Our results highlight the benefits of incorporating uncertainty-awareness into cancer progression modeling. In particular, differentiating between stable and unstable predictions represents a crucial step toward responsible interpretation and, eventually, practical application in clinical contexts.
Supplementary Material
Acknowledgements
Generative AI was used in editing code and text. The authors take full responsibility for the content of both.
Contributor Information
Yanren Linda Hu, Department for Statistical Bioinformatics, University of Regensburg, Regensburg 93053, Germany.
Simon Pfahler, Department of Physics, University of Regensburg, Regensburg 93040, Germany.
Andreas Lösch, Department for Statistical Bioinformatics, University of Regensburg, Regensburg 93053, Germany.
Stefan Vocht, Department for Statistical Bioinformatics, University of Regensburg, Regensburg 93053, Germany.
Stefan Hansch, Department for Statistical Bioinformatics, University of Regensburg, Regensburg 93053, Germany.
Kevin Rupp, Department of Biosystems Science and Engineering, ETH Zürich, Basel 4056, Switzerland.
Niko Beerenwinkel, Department of Biosystems Science and Engineering, ETH Zürich, Basel 4056, Switzerland.
Tilo Wettig, Department of Physics, University of Regensburg, Regensburg 93040, Germany.
Rudolf Schill, Department of Biosystems Science and Engineering, ETH Zürich, Basel 4056, Switzerland.
Rainer Spang, Department for Statistical Bioinformatics, University of Regensburg, Regensburg 93053, Germany.
Author contributions
Yanren Linda Hu (Conceptualization [lead], Data curation [supporting], Formal analysis [lead], Software [lead], Validation [lead], Visualization [lead], Writing—original draft [lead], Writing—review & editing [lead]), Simon Pfahler (Formal analysis [supporting], Writing—original draft [supporting], Writing—review & editing [supporting]), Andreas Lösch (Data curation [lead], Formal analysis [supporting], Writing—original draft [supporting], Writing—review & editing [supporting]), Stefan Vocht (Software [supporting], Writing—review & editing [supporting]), Stefan Hansch (Formal analysis [supporting], Writing—review & editing [supporting]), Kevin Rupp (Formal analysis [supporting], Writing—review & editing [supporting]), Niko Beerenwinkel (Formal analysis [supporting], Writing—review & editing [supporting]), Tilo Wettig (Formal analysis [supporting], Writing—review & editing [supporting]), Rudolf Schill (Conceptualization [equal], Formal analysis [supporting], Supervision [supporting], Writing—review & editing [supporting]), and Rainer Spang (Conceptualization [supporting], Formal analysis [supporting], Supervision [lead], Writing—original draft [equal], Writing—review & editing [equal])
Supplementary material
Supplementary material is available at Bioinformatics online.
Conflict of interests
None declared.
Funding
This work was supported by the German Research Foundation [TRR-305]; the Swiss National Science Foundation [179518]; the Swiss Cancer League [KFS-2977-08-2012]; and the Free State of Bavaria [Marianne-Plehn-Program].
Data availability
The data underlying this article are available at https://github.com/huy29433/MCMC-sampling-for-MHN.
References
- Abadi M, Agarwal A, Barham P et al. TensorFlow: large-scale machine learning on heterogeneous systems[Tensorflow Software], 2015. https://www.tensorflow.org/about/bib
- Aga ONL, Brun M, Dauda KA et al. HyperTraPS-CT: inference and prediction for accumulation pathways with flexible data and model structures. PLoS Comput Biol 2024;20:e1012393. 10.1371/journal.pcbi.1012393 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Angaroni F, Chen K, Damiani C et al. PMCE: efficient inference of expressive models of cancer evolution with high prognostic power. Bioinformatics 2022;38:754–62. 10.1093/bioinformatics/btab717 [DOI] [PubMed] [Google Scholar]
- Chen J. Timed hazard networks: incorporating temporal difference for oncogenetic analysis. PLoS One 2023;18:e0283004. 10.1371/journal.pone.0283004 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Clerx M, Robinson M, Lambert B et al. Probabilistic inference on noisy time series (PINTS). JORS 2019;7:23. 10.5334/jors.252 [DOI] [Google Scholar]
- Diaz-Colunga J, Diaz-Uriarte R. Conditional prediction of consecutive tumor evolution using cancer progression models: what genotype comes next? PLoS Comput Biol 2021;17:e1009055. 10.1371/journal.pcbi.1009055 [DOI] [PMC free article] [PubMed] [Google Scholar]
- El Tekle G, Bernasocchi T, Unni AM et al. Co-occurrence and mutual exclusivity: what cross-cancer mutation patterns can tell us. Trends Cancer 2021;7:823–36. 10.1016/j.trecan.2021.04.009 [DOI] [PubMed] [Google Scholar]
- Gelman A, Rubin DB. Inference from iterative simulation using multiple sequences. Statist Sci 1992;7:457–72. 10.1214/ss/1177011136 [DOI] [Google Scholar]
- Gerstung M, Baudis M, Moch H et al. Quantifying cancer progression with conjunctive Bayesian networks. Bioinformatics 2009;25:2809–15. 10.1093/bioinformatics/btp505 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Gerstung M, Eriksson N, Lin J et al. The temporal order of genetic and pathway alterations in tumorigenesis. PLoS One 2011;6:e27136. 10.1371/journal.pone.0027136 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Gillespie DT. Exact stochastic simulation of coupled chemical reactions. J Phys Chem 1977;81:2340–61. 10.1021/j100540a008 [DOI] [Google Scholar]
- Girolami M, Calderhead B. Riemann manifold Langevin and Hamiltonian Monte Carlo methods. J R Stat Soc Ser B Stat Methodol 2011;73:123–14. 10.1111/j.1467-9868.2010.00765.x [DOI] [Google Scholar]
- Greenbury SF, Barahona M, Johnston IG. Hypertraps: inferring probabilistic patterns of trait acquisition in evolutionary and disease progression pathways. Cell Syst 2020;10:39–51.e10. 10.1016/j.cels.2019.10.009 [DOI] [PubMed] [Google Scholar]
- Hastie T, Tibshirani R, Friedman J. The Elements of Statistical Learning. Springer Series in Statistics. New York, NY: Springer, 2009. 10.1007/978-0-387-84858-7 [DOI] [Google Scholar]
- Hjelm M, Höglund M, Lagergren J. New probabilistic network models and algorithms for oncogenesis. J Comput Biol 2006;13:853–65. 10.1089/cmb.2006.13.853 [DOI] [PubMed] [Google Scholar]
- Iranzo J, Gruenhagen G, Calle-Espinosa J et al. Pervasive conditional selection of driver mutations and modular epistasis networks in cancer. Cell Rep 2022;40:111272. 10.1016/j.celrep.2022.111272 [DOI] [PubMed] [Google Scholar]
- Jiang T, Chen X, Su C et al. Pan-cancer analysis of ARID1A alterations as biomarkers for immunotherapy outcomes. J Cancer 2020;11:776–80. 10.7150/jca.41296 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Johnston IG, Hoffmann T, Greenbury SF et al. Precision identification of high-risk phenotypes and progression pathways in severe malaria without requiring longitudinal data. NPJ Digit Med 2019;2:63. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Johnston IG, Williams BP. Evolutionary inference across eukaryotes identifies specific pressures favoring mitochondrial gene retention. Cell Syst 2016;2:101–11. 10.1016/j.cels.2016.01.013 [DOI] [PubMed] [Google Scholar]
- Kumar R, Carroll C, Hartikainen A et al. Arviz a unified library for exploratory analysis of Bayesian models in python. JOSS 2019;4:1143. 10.21105/joss.01143 [DOI] [Google Scholar]
- Luo XG, Kuipers J, Beerenwinkel N. Joint inference of exclusivity patterns and recurrent trajectories from tumor. Nat Commun 2023;14:3676. 10.1038/s41467-023-39400-w [DOI] [PMC free article] [PubMed] [Google Scholar]
- Mannelli C. Tissue vs liquid biopsies for cancer detection: ethical issues. J Bioeth Inq 2019;16:551–7. 10.1007/s11673-019-09944-y [DOI] [PubMed] [Google Scholar]
- Moen MT, Johnston IG. Hyperhmm: efficient inference of evolutionary and progressive dynamics on hypercubic transition graphs. Bioinformatics 2023;39:btac803. 10.1093/bioinformatics/btac803 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Montazeri H, Kuipers J, Kouyos R et al. ; Swiss HIV Cohort Study. Large-scale inference of conjunctive Bayesian networks. Bioinformatics 2016;32:i727–35. 10.1093/bioinformatics/btw459 [DOI] [PubMed] [Google Scholar]
- Nguyen B, Fong C, Luthra A et al. Genomic characterization of metastatic patterns from prospective clinical sequencing of 25,000 patients. Cell 2022;185:563–75.e11. 10.1016/j.cell.2022.01.003 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Okamura R, Kato S, Lee S et al. ARID1A alterations function as a biomarker for longer progression-free survival after anti-pd-1/pd-l1 immunotherapy. J Immunother Cancer 2020;8:1–6. 10.1136/jitc-2019-000438 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Pfahler S, Lösch A, Hu YL et al. A scalable framework for pan-cancer tumor evolution analysis enables transfer of progression mechanisms across tumor entities. bioRxiv, 10.64898/2026.01.20.700556, 2026, preprint: not peer reviewed. [DOI]
- Ricciuti B, Arbour KC, Lin JJ et al. Diminished efficacy of programmed death-(ligand)1 inhibition in STK11- and KEAP1-mutant lung adenocarcinoma is affected by KRAS mutation status. J Thorac Oncol 2022;17:399–410. 10.1016/j.jtho.2021.10.013 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Roberts GO, Rosenthal J. Optimal scaling for various metropolis-hastings algorithms. Statist Sci 2001;16:11. 10.1214/ss/1015346320 [DOI] [Google Scholar]
- Roberts GO, Rosenthal JS. Optimal scaling of discrete approximations to Langevin diffusions. J R Stat Soc Ser B Stat Methodol 1998;60:255–68. 10.1111/1467-9868.00123 [DOI] [Google Scholar]
- Rupp K, Lösch A, Hu YL et al. Modeling metastatic progression from cross-sectional cancer genomics data. Bioinformatics 2024;40:i140–50. 10.1093/bioinformatics/btae250 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Schill R, Klever M, Lösch A et al. Correcting for observation bias in cancer progression modeling. J Comput Biol 2024;31:927–45. 10.1089/cmb.2024.0666 [DOI] [PubMed] [Google Scholar]
- Schill R, Solbrig S, Wettig T et al. Modelling cancer progression using mutual hazard networks. Bioinformatics 2019;36:241–9. 10.1093/bioinformatics/btz513 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Skoulidis F, Goldberg M, Greenawalt D et al. STK11/LKB1 mutations and PD-1 inhibitor resistance in KRAS-mutant lung adenocarcinoma. Cancer Discov 2018;8:822–35. 10.1158/2159-8290.CD-18-0099 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Sweeney S, Cerami E, Baras A et al. ; The AACR Project GENIE Consortium. Aacr project genie: powering precision medicine through an international consortium. Cancer Discov 2017;7:818–31. 10.1158/2159-8290.CD-17-0151 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Tierney L. Markov chains for exploring posterior distributions. Ann Statist 1994;22:1701–28. 10.1214/aos/1176325750 [DOI] [Google Scholar]
- Tokunaga R, Xiu J, Goldberg RM et al. The impact of arid1a mutation on molecular characteristics in colorectal cancer. Eur J Cancer 2020;140:119–29. 10.1016/j.ejca.2020.09.006 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Vehtari A, Gelman A, Simpson D et al. Rank-normalization, folding, and localization: an improved for assessing convergence of MCMC (with discussion). Bayesian Anal 2021;16:667–718. 10.1214/20-BA1221 [DOI] [Google Scholar]
- Vocht S, Hu YL, Lösch A et al. mhn: a python package for analyzing cancer progression with mutual hazard networks. Bioinform Adv 2026;6:vbaf283. 10.1093/bioadv/vbaf283 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Vogelstein B, Papadopoulos N, Velculescu VE et al. Cancer genome landscapes. Science 2013;339:1546–58. 10.1126/science.1235122 [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
The data underlying this article are available at https://github.com/huy29433/MCMC-sampling-for-MHN.
