compareCluster cross-cell-type plotNote
Mental model.
| Method | Question | Input |
|---|---|---|
| Over-Representation Analysis (ORA) | Among my significant genes, are any biological terms over-represented relative to a background? | A list (set) of significant gene IDs + a “universe” |
| Gene-Set Enrichment Analysis (GSEA) | When my genes are ranked by direction-and-strength of change, do any term’s genes cluster at the top or bottom? | A ranked vector of all tested genes |
Tip
Decision rule.
padj < 0.05 & |log2FC| > 1) and the list is moderate-sized (50–500), start with ORA. - If your effect is broad-but-modest (the entire ISG family slightly up, no single super-significant gene), GSEA is more sensitive.For each gene set \(S\), count:
Compute \(P(X \ge k)\) under the hypergeometric null, then adjust for multiple sets with BH.
| Scenario | ORA | GSEA |
|---|---|---|
Strong, well-separated effect (a few hits with log2FC > 4) |
✅ | ✅ |
| Coordinated, modest effect across a whole pathway (e.g. ISGs slightly up) | weak | ✅ |
| Threshold sensitivity matters (results jump when you change the FDR cutoff) | ❌ | ✅ |
| Your list of “significant” genes is short (<20) | ❌ | ✅ |
| You want a “the X genes are enriched in Y” headline | ✅ | ❌ |
| Database | Strength | When to start here |
|---|---|---|
| GO BP (biological process) | Comprehensive, hierarchical, well-curated | Always run as a baseline |
| GO MF / CC (molecular function / cellular component) | Function & localization | When BP is dominated by generic terms |
| Reactome | Curated signaling pathways; modern | Immune / signaling biology |
| KEGG | Classic metabolic + signaling | Metabolism; legacy comparison |
| MSigDB Hallmark | 50 well-known, broad biological states | Headline figures, low-noise summaries |
| WikiPathways | Community-curated, fast updates | Niche pathways missing elsewhere |
| Cell Ontology / Cell Marker DB | Cell-type marker enrichment | When testing “is this an X-type cell?” |
GO BP has ~30,000 terms; many overlap heavily. After ORA you’ll see 50 hits like:
response to virus / type I interferon signaling pathway / cellular response to type I interferon / regulation of type I interferon signaling pathway / response to interferon-beta / …
These are the same biology described eight ways.
enrichplot::pairwise_termsim() + treeplot() — collapse the tree into themespvalueCutoff = 0.01, qvalueCutoff = 0.05) so the top 5 terms aren’t 50 redundant onesReading rules:
Tip
compareCluster plot is a very informative figure in cross-cell-type functional analysis.p.adjust (BH) or q-value.bitr() (Step 0 above) — build both the significant list and the universe from the mapped genespadj < 0.05 & |log2FC| > 0.5) and a universe (all tested genes that mapped)compareCluster dot plot across cell types for ORA-significant termsclusterProfiler (R) — the workshop default. Handles ORA + GSEA + Reactome + KEGG + MSigDB in one API.enrichplot — the visualization companion to clusterProfiler. dotplot, cnetplot, emapplot, treeplot, gseaplot2.fgsea — extremely fast pure-GSEA implementation; useful when clusterProfiler is too slow.gprofiler2 (R / Python) — alternative web API; multi-organism support out of the box.compareCluster dot plot across cell types is the single best summary figurecompareCluster plot, on three databases, with a careful read of top hits — that’s the full functional-analysis pipelineifnb STIM-vs-CTRL pseudobulk DE tableclusterProfiler paper, doi:10.1089/omi.2011.0118Single Cell RNA-seq Workshop · Lecture 07