limix.io.hdf5.fetcher

class limix.io.hdf5.fetcher(filename)[source]

Fetch datasets from HDF5 files.

Parameters:filename (str) – Filename to an HDF5 file.

Examples

>>> from limix.io import hdf5
>>> from limix.example import file_example
>>> from limix.sh import extract
>>>
>>> with file_example("data.h5.bz2") as filepath:
...     filepath = extract(filepath, verbose=False)
...     with hdf5.fetcher(filepath) as df:
...         X = df.fetch('/group/dataset')
...         print('%.4f' % X[0, 0].compute())
-0.0453
__init__(filename)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(filename) Initialize self.
fetch(data_path) Fetch a HDF5 dataset.
fetch(data_path)[source]

Fetch a HDF5 dataset.

Parameters:data_path (str) – Path to a dataset.
Returns:X
Return type:dask array