sainsc.lazykde.LazyKDE.load_local_maxima

sainsc.lazykde.LazyKDE.load_local_maxima(genes=None, *, spatialdata=False, img_genes=None)

Load the gene expression (KDE) of the local maxima.

The local maxima (sainsc.LazyKDE.local_maxima) are calculated and returned as anndata.AnnData object.

Parameters:
  • genes (Iterable[str], optional) – List of genes for which the KDE of the local maxima will be calculated.

  • spatialdata (bool, optional) – If True will load the data as a SpatialData object including the totalRNA projection and cell-type map if available. If False an AnnData object is returned.

  • spatialdata – If True will load the data as a SpatialData object including the totalRNA projection and cell-type map if available. If False an AnnData object is returned.

  • img_genes (Iterable[str], optional) – List of genes for which the KDE is calculated and loaded as multi-channel Image in SpatialData. Only available if spatialdata is set to True.

Return type:

AnnData | SpatialData

Raises:
  • ModuleNotFoundError – If spatialdata is set to True but the package is not installed.

  • ValueError – If local_maxima have not been identified.

  • ValueError – If not all img_genes exist in self.genes.