For use with other packages compatible with dyno, anndata, SingleCellExperiment, or Seurat.

as_dyno(
  model,
  store_dimred = !is.null(model$simulations$dimred),
  store_cellwise_grn = !is.null(model$experiment$cellwise_grn),
  store_rna_velocity = !is.null(model$experiment$rna_velocity)
)

as_anndata(
  model,
  store_dimred = !is.null(model$simulations$dimred),
  store_cellwise_grn = !is.null(model$experiment$cellwise_grn),
  store_rna_velocity = !is.null(model$experiment$rna_velocity)
)

as_sce(
  model,
  store_dimred = !is.null(model$simulations$dimred),
  store_cellwise_grn = !is.null(model$experiment$cellwise_grn),
  store_rna_velocity = !is.null(model$experiment$rna_velocity)
)

as_seurat(
  model,
  store_dimred = !is.null(model$simulations$dimred),
  store_cellwise_grn = !is.null(model$experiment$cellwise_grn),
  store_rna_velocity = !is.null(model$experiment$rna_velocity)
)

as_list(
  model,
  store_dimred = !is.null(model$simulations$dimred),
  store_cellwise_grn = !is.null(model$experiment$cellwise_grn),
  store_rna_velocity = !is.null(model$experiment$rna_velocity)
)

wrap_dataset(
  model,
  format = c("list", "dyno", "sce", "seurat", "anndata", "none"),
  store_dimred = !is.null(model$simulations$dimred),
  store_cellwise_grn = !is.null(model$experiment$cellwise_grn),
  store_rna_velocity = !is.null(model$experiment$rna_velocity)
)

Arguments

model

A dyngen output model for which the experiment has been emulated with generate_experiment().

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.

format

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

Value

A dataset object.

Examples

data("example_model")
dataset <- wrap_dataset(example_model, format = "list")
# \donttest{
dataset <- wrap_dataset(example_model, format = "dyno")
#> Loading required namespace: dynwrap
dataset <- wrap_dataset(example_model, format = "sce")
#> Loading required namespace: SingleCellExperiment
dataset <- wrap_dataset(example_model, format = "seurat")
#> Loading required namespace: Seurat
dataset <- wrap_dataset(example_model, format = "anndata")
#> Loading required namespace: anndata
#> Error in py_module_import(module, convert = convert): ModuleNotFoundError: No module named 'anndata'
dataset <- wrap_dataset(example_model, format = "none")
# }