scverse Conference 2024

anndataR: easily interact with anndata in R
09-10, 11:45–12:00 (Europe/Berlin), Main conference room - MW 0350

anndataR aims to make it easy to work with anndata files in R, either by converting it to a SingleCellExperiment or Seurat object, or by interacting with them directly.

Existing single-cell tools and packages most often live in one of three pre-existing ecosystems. The underlying data structures and on-disk formats differ between these frameworks, making smooth interoperability difficult.
Community-based efforts exist to make this conversion process easier, but they rely on using reticulate and while they can make the conversion process easier, it is far from foolproof: due to the differences between the data structures and philosophies underlying the frameworks, lossless conversion is not possible in all cases.

That is where anndataR comes in: it aims to both make anndata a first-class citizen in R, and to provide conversion functions to and from SingleCellExperiment and Seurat classes. Using anndataR, you can read and write h5ad files in R without using reticulate and access anndata slots.


Existing single-cell tools and packages most often live in one of three pre-existing ecosystems. The underlying data structures and on-disk formats differ between these frameworks, making smooth interoperability difficult.

The frameworks, on-disk formats and underlying data structures are:
1) the scverse ecosystem, which uses anndata as a data structure, and writes h5ad files.
2) the Bioconductor ecosystem, which mostly uses SingleCellExperiment as a data structure, and writes rds files.
3) the Seurat ecosystem, which uses Seurat classes and writes rds files.

It is possible to directly read h5ad files in R and rds files in Python using packages like reticulate and rpy2, but they come with the added cost of setting up an environment in the second language and having more in-depth knowledge of the underlying data structures of the frameworks you're trying to convert to.
Community-based efforts exist to make this conversion process easier, but they rely on using reticulate and while they can make the conversion process easier, it is far from foolproof: due to the differences between the data structures and differing philosophies underlying the frameworks, lossless conversion is not possible in all cases.

That is where anndataR comes in: it aims to both make anndata a first-class citizen in R, and to provide conversion functions to SingleCellExperiment and Seurat classes.
By facilitating the reading and writing of h5ad files in R, you can interact easily with anndata without having to manage reticulate.
By allowing you access to the anndata object in R, recovery after potential conversion failure is smooth.


Prior Knowledge Expected

No previous knowledge expected