kaleidocell.plot_mp_scores_on_umap#

kaleidocell.plot_mp_scores_on_umap(mp_scores_df, adata, recompute_umap_if_missing=True, ncols=3, weighted=False, results_mp=None)[source]#

Overlay MP module scores on a UMAP embedding.

Parameters:
  • mp_scores_df (pd.DataFrame) – Per-cell module scores from compute_mp_scores(). Ignored when weighted is True — scores are recomputed from results_mp instead.

  • adata (AnnData) – Dataset containing obsm["X_umap"].

  • recompute_umap_if_missing (bool, default True) – Recompute UMAP when not found in adata.

  • ncols (int, default 3) – Number of columns in the scanpy panel plot.

  • weighted (bool, default False) – When True, replace the pre-computed module scores with weight-scaled scores: each gene’s expression is multiplied by its normalised loading from results_mp before summing. This gives high-specificity genes more influence than low-weight genes that happen to be included in the gene set. Requires results_mp to be provided.

  • results_mp (dict or None) – Output of derive_nmf_metaprograms(). Required when weighted is True; ignored otherwise.

Return type:

None