The central class:

AnnData([X, obs, var, uns, obsm, varm, raw, …]) An annotated data matrix.


Reading anndata’s native file format .h5ad.

read_h5ad(filename[, backed]) Read .h5ad-formatted hdf5 file.

Reading other file formats.

read_csv(filename[, delimiter, …]) Read .csv file.
read_excel(filename, sheet) Read .xlsx (Excel) file.
read_hdf(filename, key) Read .h5 (hdf5) file.
read_loom(filename[, sparse]) Read .loom-formatted hdf5 file.
read_mtx(filename[, dtype]) Read .mtx file.
read_text(filename[, delimiter, …]) Read .txt, .tab, .data (text) file.
read_umi_tools(filename) Read a gzipped condensed count matrix from umi_tools.


Writing to anndata’s native file format .h5ad.

AnnData.write([filename, compression, …]) Write .h5ad-formatted hdf5 file and close a potential backing file.

Writing to other formats.

AnnData.write_csvs(dirname[, skip_data, sep]) Write annotation to .csv files.
AnnData.write_loom(filename) Write .loom-formatted hdf5 file.


Independent of AnnData, the submodule anndata.h5py provides a thin wrapper of h5py that is able to handle sparse matrices in addition to the standard functionality.

h5py Wraps h5py to handle sparse matrices.