Skip to contents

anndataR is designed to offer the combined functionality of the following packages:

  • theislab/zellkonverter: Convert AnnData files to/from SingleCellExperiment objects.
  • mtmorgan/h5ad: Read/write *.h5ad files natively using rhdf5.
  • dynverse/anndata: An R implementation of the AnnData data structures, uses reticulate to read/write *.h5ad files.

Ideally, this package will be a complete replacement for all of these packages, and will be the go-to package for working with AnnData files in R.

Desired feature list

  • Provide an R6 class to work with AnnData objects in R (either in-memory or on-disk).
  • Read/write *.h5ad files natively
  • Convert to/from SingleCellExperiment objects
  • Convert to/from Seurat objects

Class diagram

Here is a diagram of the main R6 classes provided by the package:

Notation:

  • X: Matrix - variable X is of type Matrix
  • *X: Matrix - variable X is abstract
  • as_SingleCellExperiment(): SingleCellExperiment - function as_SingleCellExperiment returns object of type SingleCellExperiment
  • *as_SingleCellExperiment() - function as_SingleCellExperiment is abstract

Session info

sessionInfo()
R version 4.5.1 (2025-06-13)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

time zone: UTC
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] digest_0.6.37     desc_1.4.3        R6_2.6.1          fastmap_1.2.0    
 [5] xfun_0.52         cachem_1.1.0      knitr_1.50        htmltools_0.5.8.1
 [9] rmarkdown_2.29    lifecycle_1.0.4   cli_3.6.5         sass_0.4.10      
[13] pkgdown_2.1.3     textshaping_1.0.1 jquerylib_0.1.4   systemfonts_1.2.3
[17] compiler_4.5.1    tools_4.5.1       ragg_1.4.0        evaluate_1.0.4   
[21] bslib_0.9.0       yaml_2.3.10       jsonlite_2.0.0    rlang_1.1.6      
[25] fs_1.6.6          htmlwidgets_1.6.4