A toolkit for generating synthetic single cell data.

Step 2, generate TF network

Step 3, add more genes to the gene network

Step 4, generate gene kinetics

Step 5, simulate the gold standard

Step 6, simulate the cells

Step 7, simulate cell and transcripting sampling

Step 8, convert to dataset

One-shot function

Data objects

  • example_model: A (very) small toy dyngen model, used for documentation and testing purposes

  • realcounts: A set of real single-cell expression datasets, to be used as reference datasets

  • realnets: A set of real gene regulatory networks, to be sampled in step 3

Varia functions

Examples

model <- initialise_model(
  backbone = backbone_bifurcating()
)
# \dontshow{
# actually use a smaller example 
# to reduce execution time during
# testing of the examples
model <- initialise_model(
  backbone = model$backbone,
  num_cells = 5,
  num_targets = 0,
  num_hks = 0,
  gold_standard_params = gold_standard_default(census_interval = 1, tau = 0.1),
  simulation_params = simulation_default(
    burn_time = 10,
    total_time = 10,
    census_interval = 1,
    ssa_algorithm = ssa_etl(tau = 0.1),
    experiment_params = simulation_type_wild_type(num_simulations = 1)
  )
)
# }
# \donttest{
model <- model %>%
  generate_tf_network() %>%
  generate_feature_network() %>%
  generate_kinetics() %>%
  generate_gold_standard() %>%
  generate_cells() %>%
  generate_experiment()
#> Generating TF network
#> Sampling feature network from real network
#> Generating kinetics for 33 features
#> Generating formulae
#> Generating gold standard mod changes
#> Precompiling reactions for gold standard
#> Running gold simulations
#> 
  |                                                  | 0 % elapsed=00s   
  |========                                          | 14% elapsed=00s, remaining~00s
  |===============                                   | 29% elapsed=00s, remaining~00s
  |======================                            | 43% elapsed=00s, remaining~00s
  |=============================                     | 57% elapsed=00s, remaining~00s
  |====================================              | 71% elapsed=00s, remaining~00s
  |===========================================       | 86% elapsed=00s, remaining~00s
  |==================================================| 100% elapsed=01s, remaining~00s
#> Precompiling reactions for simulations
#> Running 1 simulations
#> Mapping simulations to gold standard
#> Warning: Simulation does not contain all gold standard edges. This simulation likely suffers from bad kinetics; choose a different seed and rerun.
#> Performing dimred
#> Simulating experiment
#> Warning: Certain backbone segments are not covered by any of the simulations. If this is intentional, please ignore this warning.
#>   Otherwise, increase the number of simulations (see `?simulation_default`) or decreasing the census interval (see `?simulation_default`).
  
dataset <- wrap_dataset(model, format = "dyno")
# format can also be set to "sce", "seurat", "anndata" or "list"

# library(dynplot)
# plot_dimred(dataset)
# }