This function contains the complete pipeline for generating a dataset with dyngen. In order to have more control over how the dataset is generated, run each of the steps in this function separately.

generate_dataset(
  model,
  format = c("list", "dyno", "sce", "seurat", "anndata", "none"),
  output_dir = NULL,
  make_plots = FALSE,
  store_dimred = model$simulation_params$compute_dimred,
  store_cellwise_grn = model$simulation_params$compute_cellwise_grn,
  store_rna_velocity = model$simulation_params$compute_rna_velocity
)

Arguments

model

A dyngen initial model created with initialise_model().

format

Which output format to use, must be one of 'dyno' (requires dynwrap), 'sce' (requires SingleCellExperiment), 'seurat' (requires Seurat), 'anndata' (requires anndataR), 'list' or 'none'.

output_dir

If not NULL, then the generated model and dynwrap dataset will be written to files in this directory.

make_plots

Whether or not to generate an overview of the dataset.

store_dimred

Whether or not to store the dimensionality reduction constructed on the true counts.

store_cellwise_grn

Whether or not to also store cellwise GRN information.

store_rna_velocity

WHether or not to store the log propensity ratios.

Value

A list containing a dyngen model (li$model) and a dynwrap dataset (li$dataset).

Examples

model <-
  initialise_model(
    backbone = backbone_bifurcating()
  )
# \donttest{
# generate dataset and output as a list format
# please note other output formats exist: "dyno", "sce", "seurat", "anndata"
out <- generate_dataset(model, format = "list")
#> 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=00s, 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`).
#> Wrapping dataset as list

model <- out$model
dataset <- out$dataset
# }