exportSCEtoAnnData: Export a SingleCellExperiment R object as Python annData...

Description Usage Arguments Value Examples

View source: R/exportSCEtoAnndata.R

Description

Writes 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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
exportSCEtoAnnData(
  sce,
  useAssay = "counts",
  outputDir = "./",
  prefix = "sample",
  overwrite = TRUE,
  compression = c("None", "lzf", "gzip"),
  compressionOpts = NULL,
  forceDense = c("False", "True")
)

Arguments

sce

SingleCellExperiment R object to be exported.

useAssay

Character. The name of assay of interests that will be set as the primary matrix of the output AnnData. Default "counts".

outputDir

Path to the directory where .h5ad outputs will be written. Default is the current working directory.

prefix

Prefix to use for the name of the output file. Default "sample".

overwrite

Boolean. Default TRUE.

compression

If output file compression is required, this variable accepts 'gzip' or 'lzf' as inputs. Default None.

compressionOpts

Integer. Sets the compression level

forceDense

Default False Write sparse data as a dense matrix. Refer anndata.write_h5ad documentation for details. Default NULL.

Value

Generates a Python anndata object containing data from inSCE.

Examples

1
2
3
4
5
data(sce_chcl, package = "scds")
## Not run: 
exportSCEtoAnnData(sce=sce_chcl, compression="gzip")

## End(Not run)

singleCellTK documentation built on Nov. 8, 2020, 5:21 p.m.