Skip to content

Commit

Permalink
Disable blitzgsea interactive plotting
Browse files Browse the repository at this point in the history
Signed-off-by: zethson <[email protected]>
  • Loading branch information
Zethson committed Jan 19, 2024
1 parent 83f4c82 commit e1d6bc4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pertpy/tools/_enrichment.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,12 @@ def plot_dotplot(
return sc.pl.dotplot(enrichment_score_adata, groupby=groupby, swap_axes=True, **plot_args, **kwargs)

def plot_gsea(
self, adata: AnnData, enrichment: dict[str, pd.DataFrame], n: int = 10, key: str = "pertpy_enrichment_gsea"
self,
adata: AnnData,
enrichment: dict[str, pd.DataFrame],
n: int = 10,
key: str = "pertpy_enrichment_gsea",
interactive_plot: bool = False,
) -> None:
"""Generates a blitzgsea top_table plot.
Expand All @@ -378,13 +383,15 @@ def plot_gsea(
enrichment: Cluster names as keys, blitzgsea's ``gsea()`` output as values.
n: How many top scores to show for each group. Defaults to 10.
key: GSEA results key in `uns`. Defaults to "pertpy_enrichment_gsea".
interactive_plot: Whether to plot interactively or not. Defaults to False.
"""
for cluster in enrichment:
fig = blitzgsea.plot.top_table(
adata.uns[key]["scores"][cluster],
adata.uns[key]["targets"],
enrichment[cluster],
n=n,
interactive_plot=interactive_plot,
)
fig.suptitle(cluster)
fig.show()

0 comments on commit e1d6bc4

Please sign in to comment.