The 'enrichplot' package implements several visualization methods for interpreting functional enrichment results obtained from ORA or GSEA analysis. It is mainly designed to work with the 'clusterProfiler' package suite. All the visualizati
Start a fresh conversation. Replace the highlighted placeholders.
Use bioconductor-enrichplot to create publication-ready enrichment visualizations from [enrichment result object], including a gene-concept network using [named fold-change vector] where applicable.
Required inputs
[enrichment result object]
[named fold-change vector]
User-approved starter prompt based on a pinned source version; check current skill requirements before running. Task evidence ↗
SKILL.md
name: bioconductor-enrichplotdescription: The 'enrichplot' package implements several visualization methods for interpreting functional enrichment results obtained from ORA or GSEA analysis. It is mainly designed to work with the 'clusterProfiler' package suite. All the visualizatiwhen_to_use: "Use when: Enrichment Visualization: Visualizing functional enrichment results (Over-Representation Analysis [ORA] or Gene Set Enrichment Analysis [GSEA]) generated by clusterProfiler, DOSE, meshes, or ReactomePA.; Network Plots: Creating advanced network plots (e.g., cnetplot to show gene-concept networks, emapplot for enrichment map plots).; GSEA Running Scores: Generating publication-ready GSEA running sc. Not for: For performing the actual enrichment calculations, use clusterProfiler or fgsea instead because enrichplot is strictly a visualization package.; For generic, non-biological network visualizations, use ggraph or igraph directly to avoid enrichment-spe"user-invocable: false
enrichplot
Dependencies & Environment
Package-intrinsic requirements from the Bioconductor landing page — reproduce in any R environment.
Enrichment Visualization: Visualizing functional enrichment results (Over-Representation Analysis [ORA] or Gene Set Enrichment Analysis [GSEA]) generated by clusterProfiler, DOSE, meshes, or ReactomePA.
Network Plots: Creating advanced network plots (e.g., cnetplot to show gene-concept networks, emapplot for enrichment map plots).
GSEA Running Scores: Generating publication-ready GSEA running score plots (gseaplot2) showing the distribution of enrichment scores across ranked gene lists.
Functional Clustering: Visualizing functional similarities and clustering of enriched terms using tree plots (treeplot) or heatplots (heatplot).
When NOT to Use
For performing the actual enrichment calculations, use clusterProfiler or fgsea instead because enrichplot is strictly a visualization package.
For generic, non-biological network visualizations, use ggraph or igraph directly to avoid enrichment-specific object constraints.
Data Requirements
Enrichment Result: An enrichment result object (typically of class enrichResult or gseaResult from clusterProfiler or related packages).
Fold Changes: For gene-concept networks, a named vector of fold changes (numeric) is highly recommended to color gene nodes.
Key Parameters
showCategory (5): Number of enriched terms/categories to display in the plot.
color ("p.adjust"): Variable used to color nodes or bars (e.g., "pvalue", "p.adjust", "qvalue").
layout ("kk"): Layout algorithm for network plots like cnetplot or emapplot.
foldChange (NULL): Numeric vector of fold changes to color gene nodes in cnetplot or heatplot.
geneSetID: Numeric index or character ID of the gene set to plot in gseaplot2.
Best Practices
Calculate Similarities: Calculate pairwise term similarities using pairwise_termsim() before running emapplot() or treeplot().
Identify Hub Genes: Use cnetplot to identify hub genes that contribute to multiple enriched pathways.
Avoid Overcrowding: Adjust the showCategory parameter to avoid overcrowded plots when dealing with many enriched terms.
Customize with ggplot2: Leverage ggplot2 functions (e.g., theme(), labs()) to customize the output plots since all enrichplot figures are standard ggplot objects.
Common Pitfalls
Missing Similarity Matrix: Running emapplot or treeplot throws an error about missing term similarity; fix this by running x <- pairwise_termsim(x) on your enrichment object first.
Overlapping Labels: Node labels in network plots overlap and are unreadable; fix this by setting cex_label_category or using ggrepel options if supported.
Mismatched Gene IDs: Gene names in cnetplot are displayed as cryptic Entrez IDs; fix this by using setReadable() from clusterProfiler to translate IDs to gene symbols before plotting.
This skill is the knowledge layer — when, why, and how to use enrichplot. To run this analysis on your own data with managed compute, automated QC, and reproducible outputs, use BioMate — free to start.