| name | bioconductor-enrichplot |
| description | 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 |
| when_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.
- Version: 1.32.0 · Bioconductor: 3.23 · R: ≥ 4.6
- Imports: aplot, DOSE, dplyr, enrichit, ggfun, ggnewscale, ggplot2, ggrepel, ggtangle, ggtree, GOSemSim, igraph, purrr, RColorBrewer, reshape2, rlang, scatterpie, tidydr, yulab.utils
- Install:
BiocManager::install("enrichplot")
When to Use
- 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.
Alternatives
- clusterProfiler: Contains basic built-in plotting functions (barplots, dotplots) but lacks advanced network visualizations.
- pathfindR: Offers active-subnetwork-oriented enrichment and visualization.
- enrichViewNet: Specifically designed for visualizing enrichment networks using interactive layouts.
Citations
- Yu, G. (2020). yulab-smu.top/biomedical-knowledge-mining-book/.
References
Run this on BioMate
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.
▶ Open enrichplot on BioMate →