scanpy.tl.sim#
- scanpy.tl.sim(model, *, params_file=True, tmax=None, branching=None, nrRealizations=None, noiseObs=None, noiseDyn=None, step=None, rng=None, writedir=None, seed=None)[source]#
Simulate dynamic gene expression data [Wittmann et al., 2009, Wolf et al., 2018].
Sample from a stochastic differential equation model built from literature-curated boolean gene regulatory networks, as suggested by Wittmann et al. [2009]. The Scanpy implementation can be found in Wolf et al. [2018].
- Parameters:
- model
Literal['krumsiek11','toggleswitch'] Model file in ‘sim_models’ directory.
- params_file
bool(default:True) Read default params from file.
- tmax
int|None(default:None) Number of time steps per realization of time series.
- branching
bool|None(default:None) Only write realizations that contain new branches.
- nrRealizations
int|None(default:None) Number of realizations.
- noiseObs
float|None(default:None) Observatory/Measurement noise.
- noiseDyn
float|None(default:None) Dynamic noise.
- step
int|None(default:None) Interval for saving state of system.
- rng
int|integer|Sequence[int] |SeedSequence|Generator|BitGenerator|None(default:None) Random number generation to control stochasticity.
If a type:
SeedLikevalue, it’s used to seed a new random number generator; If anumpy.random.Generator,rng’s state will be directly advanced; IfNone, a non-reproducible random number generator is used. Seenumpy.random.default_rng()for more details.The default value matches legacy scanpy behavior and will change to
Nonein scanpy 2.0.- writedir
Path|str|None(default:None) Path to directory for writing output files.
- model
- Return type:
- Returns:
Annotated data matrix.
Examples
See this use case