read

Contents

read#

mudata.read(filename: PathLike, **kwargs) MuData | AnnData#

Read MuData object from HDF5 file or AnnData object (a single modality) inside it

This function is designed to enhance I/O ease of use. It recognises the following formats:

  • FILE.h5mu

  • FILE.h5mu/MODALITY

  • FILE.h5mu/mod/MODALITY

  • FILE.h5ad

OpenFile and BufferedReader from fsspec are supported for remote storage, e.g.:
  • mdata = read(fsspec.open(“s3://bucket/file.h5mu”)))

  • with fsspec.open(“s3://bucket/file.h5mu”) as f:

    mdata = read(f)

  • with fsspec.open(”https://server/file.h5ad”) as f:

    adata = read(f)