enrichmap.pl.morans_correlogram

enrichmap.pl.morans_correlogram#

enrichmap.pl.morans_correlogram(adata: AnnData, score_key: str, library_key: str | None = None, library_id: str | list[str] | None = None, n_neighbours: int = 6, save: str | None = None) None#

Plot Moran scatterplots (spatial correlograms) for one or multiple spatial libraries.

Parameters:
  • adata (AnnData) – Annotated data matrix with scores in adata.obs[score_key].

  • score_key (str) – Column in adata.obs containing the variable to assess spatial autocorrelation.

  • library_key (str or None, optional) – Column in adata.obs identifying spatial libraries. If None, computes a single plot using the entire dataset.

  • library_id (str, list of str, or None, optional) – Specific library or libraries to plot. If None, all libraries are used.

  • n_neighbours (int, default 6) – Number of nearest neighbours for spatial weights.

  • save (str or None, optional) – If provided, saves figure to figures/{save}.