Skip to contents

convertSeuratToH5ad is a wrapper function to convert a given Seurat Object into an AnnData object (for use in python with e.g. scanpy) and write out into a .h5ad file.

Usage

convertSeuratToH5ad(SeuratObj, assays, h5ad_filename, conda_env = "scicsr")

Arguments

SeuratObj

Seurat Object

assays

A vector of assay names from SeuratObj to be exported

h5ad_filename

Filename of the output .h5ad file. Note that the final output filenames will have the assay names appended to this (see examples).

conda_env

character, if not NULL this named conda environment is used. (Default: 'scicsr'). If NULL, no conda environment will be used, the program assumes the python packages scanpy and scvelo are installed in the local python)

Value

A vector of .h5ad filenames which are outputted. Each file correspond to one Seurat assay, as indicated in the suffix inside the filename (see examples).

Details

convertSeuratToH5ad simply wraps around the R SeuratDisk package to perform the stated conversion. Included her for ease of use for the user. Each assay in the Seurat Object is written into separate .h5ad files.