sce_to_anndata: Convert SingleCellExperiment objects to AnnData file stored...

View source: R/sce_to_anndata.R

sce_to_anndataR Documentation

Convert SingleCellExperiment objects to AnnData file stored as HDF5 file

Description

Convert SingleCellExperiment objects to AnnData file stored as HDF5 file

Usage

sce_to_anndata(
  sce,
  anndata_file,
  x_assay_name = "counts",
  compression = c("gzip", "none", "lzf"),
  ...
)

Arguments

sce

SingleCellExperiment object to be converted to AnnData as an HDF5 file

anndata_file

Path to output AnnData file. Must end in '.h5', '.hdf5', or '.h5ad'

x_assay_name

Name of assay in SCE object to save as X in AnnData. Default is "counts".

compression

Type of compression to use when exporting hdf5 files. Options are "none", "gzip", or "lzf". Default is "gzip".

...

Any arguments to be passed into zellkonverter::writeH5AD

Value

original SingleCellExperiment object used as input (invisibly) **Note that any columns present in the 'rowData' of an SCE object that contains duplicated information, e.g. duplicate gene identifiers, are converted to categorical data by the 'anndata' package.

Examples

## Not run: 
sce_to_anndata(
  sce = sce_object,
  anndata_file = "test_anndata.h5"
)

## End(Not run)

AlexsLemonade/scpcaTools documentation built on July 12, 2024, 8:34 a.m.