generate_cells() runs simulations in order to determine the gold standard of the simulations. simulation_default() is used to configure parameters pertaining this process.

generate_cells(model)

simulation_default(
  burn_time = NULL,
  total_time = NULL,
  ssa_algorithm = ssa_etl(tau = 30/3600),
  census_interval = 4,
  experiment_params = bind_rows(simulation_type_wild_type(num_simulations = 32),
    simulation_type_knockdown(num_simulations = 0)),
  store_reaction_firings = FALSE,
  store_reaction_propensities = FALSE,
  compute_cellwise_grn = FALSE,
  compute_dimred = TRUE,
  compute_rna_velocity = FALSE,
  kinetics_noise_function = kinetics_noise_simple(mean = 1, sd = 0.005)
)

simulation_type_wild_type(
  num_simulations,
  seed = sample.int(10 * num_simulations, num_simulations)
)

simulation_type_knockdown(
  num_simulations,
  timepoint = runif(num_simulations),
  genes = "*",
  num_genes = sample(1:5, num_simulations, replace = TRUE, prob = 0.25^(1:5)),
  multiplier = runif(num_simulations, 0, 1),
  seed = sample.int(10 * num_simulations, num_simulations)
)

Arguments

model

A dyngen intermediary model for which the gold standard been generated with generate_gold_standard().

burn_time

The burn in time of the system, used to determine an initial state vector. If NULL, the burn time will be inferred from the backbone.

total_time

The total simulation time of the system. If NULL, the simulation time will be inferred from the backbone.

ssa_algorithm

Which SSA algorithm to use for simulating the cells with GillespieSSA2::ssa()

census_interval

A granularity parameter for the outputted simulation.

experiment_params

A tibble generated by rbinding multiple calls of simulation_type_wild_type() and simulation_type_knockdown().

store_reaction_firings

Whether or not to store the number of reaction firings.

store_reaction_propensities

Whether or not to store the propensity values of the reactions.

compute_cellwise_grn

Whether or not to compute the cellwise GRN activation values.

compute_dimred

Whether to perform a dimensionality reduction after simulation.

compute_rna_velocity

Whether or not to compute the propensity ratios after simulation.

kinetics_noise_function

A function that will generate noise to the kinetics of each simulation. It takes the feature_info and feature_network as input parameters, modifies them, and returns them as a list. See kinetics_noise_none() and kinetics_noise_simple().

num_simulations

The number of simulations to run.

seed

A set of seeds for each of the simulations.

timepoint

The relative time point of the knockdown

genes

Which genes to sample from. "*" for all genes.

num_genes

The number of genes to knockdown.

multiplier

The strength of the knockdown. Use 0 for a full knockout, 0<x<1 for a knockdown, and >1 for an overexpression.

Value

A dyngen model.

See also

dyngen on how to run a complete dyngen simulation

Examples

library(dplyr) model <- initialise_model( backbone = backbone_bifurcating(), simulation = simulation_default( ssa_algorithm = ssa_etl(tau = .1), experiment_params = bind_rows( simulation_type_wild_type(num_simulations = 4), simulation_type_knockdown(num_simulations = 4) ) ) ) # \donttest{ data("example_model") model <- example_model %>% generate_cells()
#> | | 0 % ~calculating |+ | 1 % ~01m 36s |+ | 2 % ~01m 36s |++ | 3 % ~01m 34s |++ | 4 % ~01m 33s |+++ | 5 % ~01m 31s |+++ | 6 % ~01m 30s |++++ | 7 % ~01m 29s |++++ | 8 % ~01m 28s |+++++ | 9 % ~01m 27s |+++++ | 10% ~01m 26s |++++++ | 11% ~01m 25s |++++++ | 12% ~01m 24s |+++++++ | 13% ~01m 23s |+++++++ | 14% ~01m 22s |++++++++ | 15% ~01m 21s |++++++++ | 16% ~01m 20s |+++++++++ | 17% ~01m 19s |+++++++++ | 18% ~01m 18s |++++++++++ | 19% ~01m 17s |++++++++++ | 20% ~01m 16s |+++++++++++ | 21% ~01m 15s |+++++++++++ | 22% ~01m 14s |++++++++++++ | 23% ~01m 13s |++++++++++++ | 24% ~01m 12s |+++++++++++++ | 25% ~01m 11s |+++++++++++++ | 26% ~01m 10s |++++++++++++++ | 27% ~01m 09s |++++++++++++++ | 28% ~01m 08s |+++++++++++++++ | 29% ~01m 07s |+++++++++++++++ | 30% ~01m 06s |++++++++++++++++ | 31% ~01m 05s |++++++++++++++++ | 32% ~01m 05s |+++++++++++++++++ | 33% ~01m 04s |+++++++++++++++++ | 34% ~01m 03s |++++++++++++++++++ | 35% ~01m 02s |++++++++++++++++++ | 36% ~01m 01s |+++++++++++++++++++ | 37% ~60s |+++++++++++++++++++ | 38% ~59s |++++++++++++++++++++ | 39% ~58s |++++++++++++++++++++ | 40% ~57s |+++++++++++++++++++++ | 41% ~56s |+++++++++++++++++++++ | 42% ~55s |++++++++++++++++++++++ | 43% ~54s |++++++++++++++++++++++ | 44% ~53s |+++++++++++++++++++++++ | 45% ~52s |+++++++++++++++++++++++ | 46% ~51s |++++++++++++++++++++++++ | 47% ~50s |++++++++++++++++++++++++ | 48% ~49s |+++++++++++++++++++++++++ | 49% ~48s |+++++++++++++++++++++++++ | 50% ~47s |++++++++++++++++++++++++++ | 51% ~47s |++++++++++++++++++++++++++ | 52% ~46s |+++++++++++++++++++++++++++ | 53% ~45s |+++++++++++++++++++++++++++ | 54% ~44s |++++++++++++++++++++++++++++ | 55% ~43s |++++++++++++++++++++++++++++ | 56% ~42s |+++++++++++++++++++++++++++++ | 57% ~41s |+++++++++++++++++++++++++++++ | 58% ~40s |++++++++++++++++++++++++++++++ | 59% ~39s |++++++++++++++++++++++++++++++ | 60% ~38s |+++++++++++++++++++++++++++++++ | 61% ~37s |+++++++++++++++++++++++++++++++ | 62% ~36s |++++++++++++++++++++++++++++++++ | 63% ~35s |++++++++++++++++++++++++++++++++ | 64% ~34s |+++++++++++++++++++++++++++++++++ | 65% ~33s |+++++++++++++++++++++++++++++++++ | 66% ~32s |++++++++++++++++++++++++++++++++++ | 67% ~31s |++++++++++++++++++++++++++++++++++ | 68% ~30s |+++++++++++++++++++++++++++++++++++ | 69% ~29s |+++++++++++++++++++++++++++++++++++ | 70% ~28s |++++++++++++++++++++++++++++++++++++ | 71% ~28s |++++++++++++++++++++++++++++++++++++ | 72% ~27s |+++++++++++++++++++++++++++++++++++++ | 73% ~26s |+++++++++++++++++++++++++++++++++++++ | 74% ~25s |++++++++++++++++++++++++++++++++++++++ | 75% ~24s |++++++++++++++++++++++++++++++++++++++ | 76% ~23s |+++++++++++++++++++++++++++++++++++++++ | 77% ~22s |+++++++++++++++++++++++++++++++++++++++ | 78% ~21s |++++++++++++++++++++++++++++++++++++++++ | 79% ~20s |++++++++++++++++++++++++++++++++++++++++ | 80% ~19s |+++++++++++++++++++++++++++++++++++++++++ | 81% ~18s |+++++++++++++++++++++++++++++++++++++++++ | 82% ~17s |++++++++++++++++++++++++++++++++++++++++++ | 83% ~16s |++++++++++++++++++++++++++++++++++++++++++ | 84% ~15s |+++++++++++++++++++++++++++++++++++++++++++ | 85% ~14s |+++++++++++++++++++++++++++++++++++++++++++ | 86% ~13s |++++++++++++++++++++++++++++++++++++++++++++ | 87% ~12s |++++++++++++++++++++++++++++++++++++++++++++ | 88% ~11s |+++++++++++++++++++++++++++++++++++++++++++++ | 89% ~10s |+++++++++++++++++++++++++++++++++++++++++++++ | 90% ~09s |++++++++++++++++++++++++++++++++++++++++++++++ | 91% ~09s |++++++++++++++++++++++++++++++++++++++++++++++ | 92% ~08s |+++++++++++++++++++++++++++++++++++++++++++++++ | 93% ~07s |+++++++++++++++++++++++++++++++++++++++++++++++ | 94% ~06s |++++++++++++++++++++++++++++++++++++++++++++++++ | 95% ~05s |++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~04s |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~03s |+++++++++++++++++++++++++++++++++++++++++++++++++ | 98% ~02s |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~01s |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01m 36s
#> Warning: Simulation does not contain all gold standard edges. This simulation likely suffers from bad kinetics; choose a different seed and rerun.
# }