exportSCEtoAnnData {singleCellTK} | R Documentation

## Export a SingleCellExperiment R object as Python annData object

### 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

    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

    data(sce_chcl, package = "scds")
    ## Not run:
    exportSCEtoAnnData(sce=sce_chcl, compression="gzip")

    ## End(Not run)

[Package singleCellTK version 2.0.0 Index]