enrichmap.pl.spatial_metrics

enrichmap.pl.spatial_metrics#

enrichmap.pl.spatial_metrics(adata: AnnData, score_keys: Sequence[str], metric: str = "Moran's I", n_neighbors: int = 6, figsize: tuple[int, int] = (4, 4), save=None) None#

Compute and visualise spatial metrics for different scoring methods in a given dataset.

Parameters:
  • adata (AnnData) – Annotated data matrix containing spatial and gene expression information.

  • score_keys (sequence of str) – A list of method names for which to compute the spatial metric. These methods should correspond to columns in adata.obs.

  • metric (str, optional) – The spatial metric to compute, e.g., “Moran’s I” or “Geary’s C”. Defaults to “Moran’s I”.

  • n_neighs (int, optional) – Number of neighbours to use when computing spatial weights. Defaults to 6.

  • figsize (tuple of int, optional) – The size of the figure to be generated for the bar plot. Defaults to (4, 4).

  • save (str or None, optional) – If specified, the plot will be saved to the file with the given filename. If None, the plot will not be saved.

Return type:

None