read_obsm#

static SingleCell.read_obsm(h5ad_file, *, keys=None, num_threads=-1)[source]#

Load just obsm from an .h5ad file as a dictionary of Numpy arrays or DataFrames.

Parameters:
  • h5ad_file : str | Path

    an .h5ad filename

  • keys : str | Iterable[str] | None

    the keys(s) of obsm to load; if None, load all keys

  • num_threads : int

    the number of threads to use when reading. By default (num_threads=-1), use all available cores, as determined by os.cpu_count().

Returns:

A dictionary of NumPy arrays and polars DataFrames of the data in obsm.

Return type:

dict[str, ndarray | DataFrame]