Interoperability between scverse data structures and other languages#

Here we provide a list of resources that can be used to work with scverse data structures from your language of choice.

A more detailed tutorial on interoperability with other languages can be found in the Single-cell analysis best-practices book.

Conversion between python and R structures for single-cell analysis#

Several toolkits for single-cell analysis in R build upon SingleCellExperiment objects or Seurat objects. The following table provides an indication of which objects slots store the same data in AnnData and R objects.

AnnData

SingleCellExperiment

Seurat

Active expression matrix

adata.X

assay(sce)

GetAssayData(seu)

Alternative expression matrices

adata.layers['counts']

counts(sce)

GetAssay(seu)@counts

Cell-level metadata

adata.obs

colData(sce)

seu@meta.data

Gene-level metadata

adata.var

rowData(sce)

GetAssay(seu)@meta.features

Dimensionality reductions

adata.obsm

reducedDim(sce)

seu@reductions

cell IDs

adata.obs_names

colnames(sce)

colnames(seu)

gene IDs

adata.var_names

rownames(sce)

rownames(seu)

Cell-cell similarity graphs

adata.obsp

seu@graphs

AnnData ⇄ Seurat objects#

See Seurat documentation for more details about Seurat objects.

  • MuDataSeurat - R package to read and write h5ad files to and from Seurat objects

  • sceasy - R package to convert between objects within a session or saving h5ad or rds files

  • Using reticulate - tutorial for conversion within R/Rmd sessions

AnnData ⇄ SingleCellExperiment objects#

See OSCA book for more details about SingleCellExperiment objects.

  • zellconverter - R/Bioconductor package to read and write h5ad files and to convert objects within R sessions using basilisk

  • anndata2ri - python package to convert between objects within python sessions using rpy2

  • sceasy - R package to convert between objects within a session or saving h5ad or rds files

  • Using reticulate - tutorial for conversion within R/Rmd sessions

AnnData ⇄ Loom objects#

See Loompy documentation for more details about Loom objects.

  • Using anndata - function to read loom files as AnnData objects

  • sceasy - R package to convert between objects within a session or saving h5ad or loom files

MuData ⇄ Seurat objects#

See Seurat documentation for more details about Seurat objects.

  • MuDataSeurat - R package to read and write h5mu files to and from Seurat objects

MuData ⇄ MultiAssayExperiment objects#

See documentation for more details about MultiAssayExperiment objects.

MuData ⇄ ArchR objects#

See ArchR documentation for more details about ArchR objects.

  • Using chame - python package providing functionality to read Arrow files

Read h5ad/h5mu in other languages#

Julia#

  • Muon.jl provides Julia implementations of AnnData and MuData objects, as well as IO for the HDF5 format

  • scVI.jl provides a Julia implementation of AnnData as well as IO for the HDF5 format.

Javascript#

  • Vitessce -contains loaders from AnnDatas stored as Zarr

Rust#

  • anndata-rs provides a Rust implementation of AnnData as well as advanced IO support for the HDF5 storage format.