diff --git a/R/bioc_to_zarr.R b/R/bioc_to_zarr.R index 9c08ee9..9b271e2 100644 --- a/R/bioc_to_zarr.R +++ b/R/bioc_to_zarr.R @@ -9,7 +9,7 @@ #' obj <- get_sce_obj() #' sce_to_anndata_zarr(obj, out_path = "data/sce.zarr") #' @importFrom SingleCellExperiment reducedDims reducedDims<- -sce_to_anndata_zarr <- function(sce_obj, out_path) { +sce_to_anndata_zarr <- function(sce_obj, out_path, to_dense = TRUE) { obsm_keys <- names(as.list(reducedDims(sce_obj))) for(obsm_key in obsm_keys) { # If there are column names, then the obsm element will be stored as a data.frame, @@ -19,7 +19,7 @@ sce_to_anndata_zarr <- function(sce_obj, out_path) { } store <- pizzarr::DirectoryStore$new(out_path) - anndataR::from_SingleCellExperiment(sce_obj, "ZarrAnnData", store = store, to_dense = TRUE) + anndataR::from_SingleCellExperiment(sce_obj, "ZarrAnnData", store = store, to_dense = to_dense) return(TRUE) }