Creates a horizontal barplot of top pathways from a Gene Set Enrichment Analysis (GSEA) result. Instead of the default dotplot, this function shows Normalized Enrichment Scores (NES) as bars with adjusted p-values as text labels and leading-edge gene annotations.
Usage
do_GseaPlot(
gsea_object,
analysis_name = "GSEA Analysis",
simplify_go = TRUE,
number_of_pathways = 10,
selection = NULL,
fill_scale = c("diverging", "viridis"),
show_padj = TRUE,
show_leading_edge = TRUE,
title = NULL
)Arguments
- gsea_object
A
gseaResultobject fromclusterProfiler::gseGO(),ReactomePA::gsePathway(), or similar, containing results in the@resultslot.- analysis_name
Character. Subtitle for the plot. Defaults to
"GSEA Analysis".- simplify_go
Logical. Whether to apply
clusterProfiler::simplify()to GO terms (default:TRUE). Only applies when GO term IDs are detected; silently skipped otherwise.- number_of_pathways
Integer. Number of top upregulated and downregulated pathways to display (default:
10). Ignored whenselectionis provided.- selection
Character vector of pathway descriptions to plot. Overrides automatic top/bottom selection. Defaults to
NULL.- fill_scale
Character. Color scale:
"diverging"(RdBu, 0-centered) or"viridis"(sequential viridis-C, original style). Defaults to"diverging"to emphasize the signed nature of NES.- show_padj
Logical. Show adjusted p-value labels on bars. Defaults to
TRUE.- show_leading_edge
Logical. Show leading-edge gene count and gene symbols in y-axis labels. Defaults to
TRUE.- title
Character. Custom plot title. If
NULL, auto-generated fromanalysis_name.
