enrichmap.pl.cross_moran_scatter

enrichmap.pl.cross_moran_scatter#

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

Plot cross-Moran scatterplots: score_x vs spatial lag of score_y, per library or globally.

Parameters:
  • adata (AnnData) – Annotated data matrix with spatial coordinates in adata.obsm[“spatial”].

  • score_x (str) – Column in adata.obs for X-axis variable.

  • score_y (str) – Column in adata.obs for which the spatial lag is computed (Y-axis).

  • library_key (str or None) – Key in adata.obs indicating batch/sample/library identifiers. If None, computes a single plot using the entire dataset.

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

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

  • save (str or None) – If provided, saves the figure to the given file name.