An AnnData object. This class can either be an in-memory
AnnData (InMemoryAnnData) or an HDF5-backed AnnData (HDF5AnnData). The
AnnData object stores a data matrix X
together with annotations of
observations obs
(obsm
, obsp
) and variables var
(varm
, varp
).
Additional layers of data can be stored in layers
and unstructured
annotations in uns
.
Functions that can be used to create AnnData objects
AnnData()
: Create an in-memory AnnData object.read_h5ad()
: Read an HDF5-backed AnnData file from disk.from_SingleCellExperiment()
: Convert a SingleCellExperiment object to an AnnData object.from_Seurat()
: Convert a Seurat object to an AnnData object.
An AnnData object has the following slots
Access them by using the $
operator. Example: adata$obs
.
X
: A matrix of observations by variables.obs
: A data frame of observations.var
: A data frame of variables.obs_names
: Names of observations (alias forrownames(obs)
).var_names
: Names of variables (alias forrownames(var)
).layers
: A named list of matrices with the same dimensions asX
.obsm
: A named list of matrices with the same number of rows asobs
.varm
: A named list of matrices with the same number of rows asvar
.obsp
: A named list of sparse matrices with the same number of rows and columns as the number of observations.varp
: A named list of sparse matrices with the same number of rows and columns as the number of variables.uns
: A named list of unstructured annotations.
An AnnData object has the following methods
Access them by using the $
operator. Example: adata$write_h5ad()
.
print()
: Print a summary of the AnnData object.shape()
: Dimensions (observations x variables) of the AnnData object.n_obs()
: Number of observations in the AnnData object.n_vars()
: Number of variables in the AnnData object.obs_keys()
: Column names ofobs
.var_keys()
: Column names ofvar
.layers_keys()
: Element names oflayers
.obsm_keys()
: Element names ofobsm
.varm_keys()
: Element names ofvarm
.obsp_keys()
: Element names ofobsp
.varp_keys()
: Element names ofvarp
.uns_keys()
: Element names ofuns
.write_h5ad()
: Write the AnnData object to an HDF5 file.
Conversion methods
Access them by using the $
operator. Example: adata$to_Seurat()
.
to_SingleCellExperiment()
: Convert to SingleCellExperiment.to_Seurat()
: Convert to Seurat.to_InMemoryAnnData()
: Convert to an InMemory AnnData.to_HDF5AnnData()
: Convert to an HDF5 Backed AnnData.
Author
Maintainer: Robrecht Cannoodt robrecht@data-intuitive.com (ORCID) (rcannood)
Authors:
Luke Zappia luke@lazappi.id.au (ORCID) (lazappi)
Martin Morgan mtmorgan.bioc@gmail.com (ORCID) (mtmorgan)
Louise Deconinck louise.deconinck@gmail.com (ORCID) (LouiseDck)
Other contributors:
Danila Bredikhin danila.bredikhin@embl.de (ORCID) (gtca) [contributor]
Isaac Virshup (ORCID) (ivirshup) [contributor]
Brian Schilder brian_schilder@alumni.brown.edu (ORCID) (bschilder) [contributor]
Chananchida Sang-aram (ORCID) (csangara) [contributor]
Data Intuitive info@data-intuitive.com [funder, copyright holder]
Chan Zuckerberg Initiative [funder]