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)
)
A dyngen output model for which the experiment has been emulated with generate_experiment()
.
Whether or not to store the dimensionality reduction constructed on the true counts.
Whether or not to also store cellwise GRN information.
WHether or not to store the log propensity ratios.
Which output format to use, must be one of 'dyno' (requires dynwrap
), 'sce' (requires SingleCellExperiment
), 'seurat' (requires Seurat
), 'anndata' (requires anndata
), 'list' or 'none'.
A dataset object.
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")
# }