enrichmap.pl.signature_correlation_heatmap

enrichmap.pl.signature_correlation_heatmap#

enrichmap.pl.signature_correlation_heatmap(adata: AnnData, score_keys: list[str], library_key: str | None = None, library_id: str | list[str] | None = None, method: str = 'spearman', tile_size: float = 0.25, cmap: str | None = 'coolwarm', save: str | Path | None = None, **kwargs: dict[str, any])#

Plot a heatmap of correlations between gene set scores in adata.obs.

Parameters:
  • adata (AnnData) – Annotated data matrix with gene signature scores in adata.obs.

  • score_keys (list of str) – Column names in adata.obs corresponding to gene set signature scores.

  • library_key (str or None) – Key in adata.obs for library identifiers (e.g. patient ID).

  • library_id (str or None) – If set, filter adata for this library before plotting.

  • method (str) – Correlation method: “spearman” or “pearson”.

  • tile_size (float) – Size of each heatmap tile in inches. The figure dimensions are computed from this value and the number of signatures, so tiles remain a consistent size regardless of how many panels are drawn.

  • cmap (str or None) – Colormap for the heatmap. Defaults to “coolwarm”.

  • save (str or Path or None) – Path to save the figure.

  • **kwargs (dict) – Additional keyword arguments passed to sns.heatmap.