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 usingrhdf5
. -
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
- variableX
is of typeMatrix
-
*X: Matrix
- variableX
is abstract -
to_SingleCellExperiment(): SingleCellExperiment
- functionto_SingleCellExperiment
returns object of typeSingleCellExperiment
-
*to_SingleCellExperiment()
- functionto_SingleCellExperiment
is abstract
Feature tracking
The following tables show the status of the implementation of each feature in the package:
AnnData
Slot | Getter | Getter test | Setter | Setter test |
---|---|---|---|---|
layers | NA | NA | NA | ✓ |
obsm | NA | NA | NA | ✓ |
varm | NA | NA | NA | ✓ |
X | NA | NA | NA | ✓ |
HDF5AnnData
Slot | Getter | Getter test | Setter | Setter test |
---|---|---|---|---|
layers | ✓ | ✓ | ✓ | ✓ |
obs | ✓ | ✓ | ✓ | ✓ |
obs_names | ✓ | ✓ | ✓ | ✓ |
obsm | ✓ | ✓ | ||
obsp | ✓ | ✓ | ||
uns | ✓ | ✓ | ||
var | ✓ | ✓ | ✓ | ✓ |
var_names | ✓ | ✓ | ✓ | ✓ |
varm | ✓ | ✓ | ||
varp | ✓ | ✓ | ||
X | ✓ | ✓ | ✓ | ✓ |
InMemoryAnnData
Slot | Getter | Getter test | Setter | Setter test |
---|---|---|---|---|
layers | ✓ | ✓ | ✓ | ✓ |
obs | ✓ | ✓ | ✓ | ✓ |
obs_names | ✓ | ✓ | ✓ | ✓ |
obsm | ✓ | ✓ | ||
obsp | ✓ | ✓ | ||
uns | ✓ | ✓ | ||
var | ✓ | ✓ | ✓ | ✓ |
var_names | ✓ | ✓ | ✓ | ✓ |
varm | ✓ | ✓ | ||
varp | ✓ | ✓ | ||
X | ✓ | ✓ | ✓ | ✓ |