, backup_url=None, download_dataset_name=None, archive_format=None)[source]#

Reads or downloads a desired directory of h5ad files or a single h5ad file.

  • dataset_path (Path | str) – Path to the file or directory to read.

  • download_dataset_name (str | None) – Name of the file or directory in case the dataset is downloaded

  • backup_url (str | None) – URL to download the data file(s) from if not yet existing.

Return type:

AnnData | dict[str, AnnData]


An AnnData object or a dict with an identifier (the filename, without extension) for each AnnData object in the dict


>>> import ehrapy as ep
>>> adata = ep.dt.mimic_2(encoded=True)
>>>"mimic_2.h5ad", adata)
>>> adata_2 ="mimic_2.h5ad")