loki.preprocess.get_scalefactors

loki.preprocess.get_scalefactors(adata, library_id=None)

Retrieves the scalefactors from the AnnData object for a given library ID. If no library ID is provided, the function will automatically retrieve the first available library ID.

Parameters:
  • adata – AnnData object containing spatial data and scalefactors in adata.uns[‘spatial’].

  • library_id – The library ID for which the scalefactors are to be retrieved. If not provided, it defaults to the first available ID.

Returns:

A dictionary containing scalefactors for the specified library ID.