anndict.adata_dict.read_adata_dict_from_h5ad#
- anndict.adata_dict.read_adata_dict_from_h5ad(paths, *, keys=None)[source]#
Read
.h5adfiles from a list of paths and return them in a dictionary.For each element in the provided list of paths, if the element is a directory, it reads all
.h5adfiles in that directory. If the element is an.h5adfile, it reads the file directly.For auto-generated keys, if there are duplicate filenames, the function will include parent directory names from right to left until keys are unique. For example,
dat/heart/fibroblast.h5adwould generate the key('heart', 'fibroblast')if disambiguation is needed.- Parameters:
- paths
str|list[str] A string path or list of paths to directories or
.h5adfiles.- keys
list[str] |None(default:None) A list of strings to use as keys for the adata_dict. If provided, must be equal in length to the number of
.h5adfiles read.
- paths
- Return type:
- Returns:
A flat
AdataDict(with hierarchy set to('keys',)).