ggml_ot.gene.enrichment

Contents

ggml_ot.gene.enrichment#

ggml_ot.gene.enrichment(adata, n_genes=50, components=None, gene_symbols=None, up_regulated=False, down_regulated=False, ordered=False, alpha=0.05, organism='hsapiens', max_terms=None, log_axis=False, orient='v', wrap_width=35, figsize=None, font_size=None, save=None, show=None, **kwargs)[source]#

Performs enrichment analysis on top-ranked genes and visualizes the enriched biological terms.

Parameters:
adata

Anndata object

n_genes default: 50

Number of considered top-ranked genes

components default: None

One-based component IDs. For example, '1,2,3' means the first, second, and third GGML component. Defaults to all GGML components.

gene_symbols Optional[str] (default: None)

Key for field in .var that stores gene symbols if you do not want to use .var_names.

up_regulated default: False

If True, run enrichment on genes with the largest positive loadings.

down_regulated default: False

If True, run enrichment on genes with the largest negative loadings. When both flags are equal, absolute loadings are used.

ordered default: False

Whether the gene lists are ordered by importance

alpha default: 0.05

Threshold for significance in enrichment

organism default: 'hsapiens'

Organism ID for g:Profiler

max_terms Optional[int] (default: None)

Maximum number of enriched terms shown per component. None shows all enriched terms.

log_axis default: False

Whether to plot -log10(p_value) instead of raw p-values.

orient default: 'v'

Whether to layout the plots horizontally ("h") or vertically ("v").

wrap_width Optional[int] (default: 35)

Maximum number of characters per line for term names. Long names are wrapped at word boundaries to fit within this width. None disables wrapping.

figsize Optional[tuple[float, float]] (default: None)

Figure size (width, height) in inches. None uses a default that scales with the number of components.

font_size Optional[float] (default: None)

Base font size in points applied to ticks, labels, titles, and the alpha annotation. None keeps matplotlib defaults. Use this together with figsize to tune the text-to-plot ratio.

show Optional[bool] (default: None)

Whether to display the plot. None (default) automatically shows in interactive environments (notebooks, IPython) and suppresses in scripts. True/False override explicitly.

save UnionType[str, bool, None] (default: None)

Whether to save the figure to disk. None/False skip saving. True saves under the default name into settings.figdir. A str is used as the filename.

kwargs

Passed to sns.barplot