In order to save & share multimodal data,
.h5mu file format has been designed.
.h5mu files are the default storage for
MuData objects. These are HDF5 files with a standardised structure, which is similar to the one of
.h5ad files where
AnnData objects are stored. The most noticeable distinction is
.mod group presence where individual modalities are stored — in the same way as they would be stored in the
Inspect the contents of the file in the terminal:
> h5ls mudata.h5mu mod Group obs Group obsm Group var Group varm Group > h5ls data/mudata.h5mu/mod atac Group rna Group
Individual modalities in the
.h5mu file are stored in exactly the same way as AnnData objects. This, together with the hierarchical nature of HDF5 files, makes it possible to read individual modalities from
.h5mu files as well as to save individual modalities to the
adata = mu.read("mudata.h5mu/rna") mu.write("mudata.h5mu/rna", adata)
muon.read() automatically decides based on the input if
muon.read_h5mu() or rather
muon.read_h5ad() should be called.