Written and maintained by CASRAI Editorial Board
Last updated
clusterProfiler is a Bioconductor R package for functional enrichment of omics results: it takes a gene list or a ranked gene vector and tests it against Gene Ontology (GO), KEGG and other annotation sets. This page is for researchers and analysts who already have differential-expression or similar results in R and need to run, read and cite an enrichment analysis. It covers install, the choice between enrichGO (over-representation) and gseGO (GSEA), the arguments that most often go wrong, and free alternatives.
Facts on this page were read from the Bioconductor package page, the Bioconductor vignette and Guangchuang Yu’s online book on 2026-11-07. Package versions change with each Bioconductor release; check the package page for the current one.
What clusterProfiler is used for in research
The Bioconductor package page describes clusterProfiler as an enrichment tool for omics data, supporting over-representation analysis (ORA) and gene set enrichment analysis (GSEA) on coding and non-coding data from thousands of species, and comparison of multiple treatments or time points. The vignette lists three supported analyses: over-representation analysis, gene set enrichment analysis and biological theme comparison. It is an interpretation step that normally follows an upstream analysis such as differential gene expression analysis; it does not process raw sequencing data.
Supported annotation sources named in the vignette include Gene Ontology (many species, queried through AnnotationHub), KEGG pathways and modules, Reactome (via ReactomePA), Disease Ontology (via DOSE), the Molecular Signatures Database collections, and user-supplied annotations.
Install or access (official source only)
clusterProfiler is distributed through Bioconductor under the Artistic-2.0 licence. On the 2026-11-07 package page for Bioconductor release 3.23 the version was 4.20.3, and the package depends on R 4.2.0 or later. The official install commands are:
if (!require("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("clusterProfiler")
The package imports, among others, AnnotationDbi, enrichplot (plotting), GOSemSim, GO.db, gson, qvalue, igraph, ggplot2, dplyr and tidyr. Species annotation is supplied by an OrgDb package; the book’s human examples use org.Hs.eg.db. To open the vignette from R, run browseVignettes("clusterProfiler"). The vignette itself points to the full online book at yulab-smu.github.io/clusterProfiler-book for complete tutorials.
Step-by-step: GO enrichment with enrichGO and gseGO
The commands below follow the examples in Yu’s book chapter on GO enrichment. Replace gene, geneList and the organism database with your own objects.
Choose ORA or GSEA first
| Question | Over-representation (enrichGO) | GSEA (gseGO) |
|---|---|---|
| Input | gene: a vector of gene IDs you have already selected |
geneList: a named, ranked vector covering the tested genes |
| Background | Optional universe argument (the book passes names(geneList)) |
The ranked list itself |
| Set size control | Not used in the book example | minGSSize and maxGSSize; only sets in that range (after intersecting with your list) are tested |
| Cutoffs | pvalueCutoff, qvalueCutoff, pAdjustMethod |
pvalueCutoff |
For how the GSEA method itself works, see our guide to GSEA and how to read its output.
Run over-representation analysis (enrichGO)
- Load clusterProfiler and your organism annotation package:
library(clusterProfiler)andlibrary(org.Hs.eg.db). - Prepare
geneas a vector of IDs. If the IDs are not Entrez IDs, setkeyType. - Run the test. The book’s example is:
ego <- enrichGO(gene = gene, universe = names(geneList), OrgDb = org.Hs.eg.db, ont = "CC", pAdjustMethod = "BH", pvalueCutoff = 0.01, qvalueCutoff = 0.05, readable = TRUE)
ont selects the ontology: BP (biological process), CC (cellular component) or MF (molecular function). readable = TRUE converts gene IDs to gene symbols in the result.
Run gene set enrichment analysis (gseGO)
Supply a named, ranked geneList and the gene-set size limits. The book’s example is:
ego3 <- gseGO(geneList = geneList, OrgDb = org.Hs.eg.db, ont = "CC", minGSSize = 100, maxGSSize = 500, pvalueCutoff = 0.05, verbose = FALSE)
Other analyses: KEGG and comparing gene clusters
The vignette lists KEGG pathway and module analysis and biological theme comparison among its supported analyses. The book has separate chapters for KEGG, for comparing themes from multiple gene lists (the compareCluster function; the package’s original 2012 paper is titled “an R package for comparing biological themes among gene clusters”) and for enrichplot visualisation. Follow those chapters for exact arguments rather than adapting the GO calls above.
Output and how to read it
The result of enrichGO or gseGO is an object you can convert to a data frame. In the book’s GO chapter the result table includes these columns: ID, Description, GeneRatio, BgRatio, RichFactor, FoldEnrichment, zScore, pvalue, p.adjust, qvalue, geneID and Count. Filter on p.adjust or qvalue rather than the raw pvalue, because the analysis tests many terms at once. The book has a dedicated chapter, “How to read an enrichment result”, for the meaning of each column.
The vignette lists the plotting functions for results: barplot, dotplot, cnetplot, emapplot, gseaplot, goplot and upsetplot. The package imports enrichplot for this.
Troubleshooting
- No or few terms returned with non-Entrez IDs. The book states that
keyTypemust be set when your IDs are not Entrez IDs (for example gene symbols or Ensembl IDs). - Wrong species.
OrgDbmust match the organism of your IDs; the book’s example usesorg.Hs.eg.dbfor human. - Background choice. In ORA, the
universeargument sets the background gene set; the book’s example uses the names of the full ranked list. - GSEA returns nothing. Only gene sets whose size falls between
minGSSizeandmaxGSSize, counted after intersecting with yourgeneList, are tested; check those limits and that the vector is named and ranked. - Bugs and questions. The vignette directs users to the Bioconductor support site (tag the post clusterProfiler) and, for bugs with a reproducible example, to the GitHub issue tracker.
Free alternatives
| Tool | Form | Where to read more |
|---|---|---|
| Enrichr | Web-based gene list enrichment from the Ma’ayan Lab, with an API and an enrichR R package | Enrichr guide |
| GSEA (ranked-list method) | Also available in R through fgsea and in Python through GSEApy | GSEA guide |
For metabolite rather than gene data, see MetaboAnalyst.
FAQ
What is clusterProfiler?
A Bioconductor R package for statistical analysis and visualisation of functional profiles of genes and gene clusters, supporting over-representation analysis, GSEA and biological theme comparison.
What is clusterProfiler in R used for, and how do I install it?
It interprets gene lists from omics experiments. Install with BiocManager::install("clusterProfiler"); the 2026-11-07 release 3.23 page lists R 4.2.0 or later as a dependency.
What is the difference between enrichGO and gseGO?
enrichGO tests a selected gene vector (optionally against a universe); gseGO takes a named ranked list and tests gene sets within size limits. See the table above.
Where is the clusterProfiler tutorial or vignette?
Run browseVignettes("clusterProfiler"), or open the Bioconductor vignette; it links to the full online book at yulab-smu.github.io/clusterProfiler-book.
How do I cite clusterProfiler?
The vignette asks users to cite: G Yu, LG Wang, Y Han, QY He. clusterProfiler: an R package for comparing biological themes among gene clusters. OMICS: A Journal of Integrative Biology 2012, 16(5):284-287. doi:10.1089/omi.2011.0118.







