The central class:

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


Reading anndata’s native file format .h5ad.

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

Reading other file formats.

read_csv(filename[, delimiter, …]) Read .csv file.
read_excel(filename, sheet[, dtype]) Read .xlsx (Excel) file.
read_hdf(filename, key) Read .h5 (hdf5) file.
read_loom(filename[, sparse, cleanup, …]) 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[, dtype]) Read a gzipped condensed count matrix from umi_tools.
read_zarr(store) Read from a hierarchical Zarr array store.


Writing to anndata’s native file format .h5ad.

AnnData.write([filename, compression, …]) Write .h5ad-formatted hdf5 file.

Writing to other formats.

AnnData.write_csvs(dirname[, skip_data, sep]) Write annotation to .csv files.
AnnData.write_loom(filename[, write_obsm_varm]) Write .loom-formatted hdf5 file.
AnnData.write_zarr(store, chunks) Write a hierarchical Zarr array store.


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.