Garfield.plot.niches_enrichment_barplot

Garfield.plot.niches_enrichment_barplot(enrichments, niche, type='enrichr', figsize=(10, 5), n_enrichments=5, qval_cutoff=0.05, title='auto')[source]

Create a barplot for the enrichment results (either from Enrichr or GSEA).

Parameters:
  • enrichments (dict) – Dictionary of enrichment results where the key is the niche name and the value is a dataframe of enrichment results.

  • niche (str) – The niche (cluster) to visualize enrichment for.

  • type (str, optional) – The type of enrichment analysis (‘enrichr’ or ‘gsea’). Default is ‘gsea’.

  • figsize (tuple, optional) – Figure size for the plot.

  • n_enrichments (int, optional) – Number of top enrichment terms to display (default is 5).

  • qval_cutoff (float, optional) – Adjusted p-value or FDR cutoff to filter enrichment terms (default is 0.05).

  • title (str, optional) – Title of the plot (default is ‘auto’, which uses the first gene set’s name).

Returns:

ax – The matplotlib axis containing the plot.

Return type:

matplotlib.axes.Axes