x3cflux.run_uniform_sampling
- class x3cflux.run_uniform_sampling(simulator, num_samples: int, bounds: Dict[str, Tuple[float, float]] | None = None, rounding: bool | None = True, random_seed: int | None = 42, **kwargs)
Bases:
Run uniform sampling of the polytope induced by the metabolic model.
Markov chain Monte Carlo (MCMC), as implemented in the polytope sampling toolbox hopsy, is used and can be configured by passing appropriate keyword arguments. See Paul, R. et al. (2024), https://doi.org/10.1093/bioinformatics/btae430.
- Parameters:
simulator (Simulator) – Labeling simulator from which to obtain the inequality system.
num_samples (int) – Number of samples to generate.
bounds (dict[str, tuple[float, float], optional) – Parameter boundary constraints.
rounding (bool, default=True) – Whether to round the polytope before sampling. Rounding significantly increases sampling efficiency, but might take some time for large models.
random_seed (int, default=42) – Random seed used to initialize the Markov chain.
**kwargs – hopsy options. See https://modsim.github.io/hopsy/generated/hopsy.sample.html.
- Returns:
Generated samples as an
(N, M)matrix, whereNandMare the numbers of parameters and samples, respectively.- Return type:
numpy.ndarray