tfmindi.load_h5ad

Contents

tfmindi.load_h5ad#

tfmindi.load_h5ad(filename, backed=None, **kwargs)#

Load AnnData object from H5AD format with restoration of numpy arrays in .obs and .var.

This function wraps AnnData.read_h5ad() with additional postprocessing to restore numpy arrays that were stored in .obs and .var columns using save_h5ad().

Parameters:
  • filename (str | Path) – Path to the H5AD file to load

  • backed (str | None (default: None)) – Load in backed mode to save memory. Use ‘r’ for read-only access.

  • **kwargs – Additional arguments passed to AnnData.read_h5ad()

Return type:

AnnData

Returns:

AnnData object with numpy arrays restored in .obs columns

Examples

>>> import tfmindi as tm
>>> adata = tm.load_h5ad("my_data.h5ad")
>>> print(type(adata.obs["seqlet_matrix"].iloc[0]))
<class 'numpy.ndarray'>
>>> # Memory-efficient loading for large files
>>> adata = tm.load_h5ad("my_data.h5ad", backed="r")