R/exportSCEtoAnndata.R
exportSCEtoAnnData.RdWrites all assays, colData, rowData, reducedDims, and altExps objects in a SingleCellExperiment to a Python annData object in the .h5ad format All parameters of Anndata.write_h5ad function (https://icb-anndata.readthedocs-hosted.com/en/stable/anndata.AnnData.write_h5ad.html) are available as parameters to this export function and set to defaults. Defaults can be overridden at function call.
exportSCEtoAnnData(
sce,
useAssay = "counts",
outputDir = "./",
prefix = "sample",
overwrite = TRUE,
compression = c("gzip", "lzf", "None"),
compressionOpts = NULL,
forceDense = FALSE
)SingleCellExperiment R object to be exported.
Character. The name of assay of
interests that will be set as the primary matrix of the output AnnData.
Default "counts".
Path to the directory where .h5ad outputs will be written. Default is the current working directory.
Prefix to use for the name of the output file. Default "sample".
Boolean. Default TRUE.
If output file compression is required, this variable accepts
'gzip', 'lzf' or "None" as inputs. Default "gzip".
Integer. Sets the compression level
Default False Write sparse data as a dense matrix.
Refer anndata.write_h5ad documentation for details. Default NULL.
Generates a Python anndata object containing data from inSCE.
data(sce_chcl, package = "scds")
if (FALSE) {
exportSCEtoAnnData(sce=sce_chcl, compression="gzip")
}