Pathway Enrichment Analysis and Visualization of Omics Data
A step-by-step protocol using g:Profiler, GSEA, Cytoscape and EnrichmentMap
Introduction: Why Pathway Enrichment Analysis
Comprehensive quantification of DNA, RNA and proteins in biological samples is now routine, and the resulting data are growing exponentially. Their analysis helps researchers discover novel biological functions, genotype–phenotype relationships and disease mechanisms, but analysis and interpretation remain a major challenge. Omics analyses often produce long lists of genes that would require an impractically large amount of manual literature searching to interpret.
A standard approach to this problem is pathway enrichment analysis, which summarizes a large gene list as a smaller, more interpretable list of pathways. Pathways are statistically tested for over-representation in the experimental gene list relative to what is expected by chance, using tests that consider the number of genes detected, their relative ranking and the number of genes annotated to a pathway. For instance, experimental data containing 40% cell cycle genes are surprisingly enriched given that only about 8% of human protein-coding genes are involved in that process.
The authors illustrate the value of the method with real discoveries. Pathway enrichment analysis helped identify histone and DNA methylation by the polycomb repressive complex (PRC2) as the first rational therapeutic target for ependymoma, a prevalent childhood brain cancer; this pathway is targetable by the drug 5-azacytidine. In a separate study of rare copy-number variants (CNVs) in autism, pathway analysis revealed several significant pathways affected by gene deletions, whereas single-gene case–control tests found few significant hits.
- Omics experiments generate gene lists too long to interpret by manual literature search.
- Pathway enrichment analysis condenses long gene lists into a smaller set of interpretable biological pathways.
- Pathways are tested for statistical over-representation relative to chance expectation.
- The method has yielded real therapeutic and mechanistic insights in cancer and autism studies.
Development and Scope of the Protocol
This protocol covers pathway enrichment analysis of large gene lists typically derived from genome-scale technology. It is intended for experimental biologists interested in interpreting their omics data and requires only the ability to use point-and-click software, although advanced users can benefit from the automated analysis scripts provided as Supplementary Protocols 1–4.
The worked examples analyze previously published human gene expression and somatic mutation data, but the conceptual framework applies to gene lists from any organism derived from large-scale data, including proteomics, genomics, epigenomics and gene-regulation studies. Each data type may require specific pre-processing.
The four tools were selected for ease of use, free access, advanced features, extensive documentation and up-to-date databases: g:Profiler (https://biit.cs.ut.ee/gprofiler/), GSEA (http://software.broadinstitute.org/gsea/), Cytoscape (http://www.cytoscape.org/) and EnrichmentMap (http://www.baderlab.org/Software/EnrichmentMap). All are freely available online.
- Designed for experimental biologists with no bioinformatics training; only point-and-click skills required.
- Uses four free, frequently updated tools: g:Profiler, GSEA, Cytoscape and EnrichmentMap.
- Worked examples use human RNA-seq and somatic mutation data but the framework generalizes to any organism and omics type.
- Supplementary Protocols 1–4 provide automated scripts for advanced users.
Overview of the Procedure: Three Major Stages
Pathway enrichment analysis involves three major stages. Stage 1 is definition of a gene list of interest using omics data: a raw omics dataset generally requires computational processing such as normalization and scoring to identify genes of interest, considering the experimental design. For example, a list of genes differentially expressed between two groups of samples can be derived from RNA-seq data.
Stage 2 is pathway enrichment analysis itself: a statistical method identifies pathways enriched in the gene list relative to chance. All pathways in a given database are tested for enrichment, and the choice of method depends on the type of gene list.
Stage 3 is visualization and interpretation of the results: because many enriched pathways are identified, often including redundant versions of the same pathway, visualization helps identify the main biological themes and their relationships for in-depth study and experimental evaluation.
- Stage 1: define a gene list (flat/unranked) or ranked gene list from omics data.
- Stage 2: determine statistically enriched pathways using an appropriate statistical test.
- Stage 3: visualize and interpret enriched pathways as a network to reveal biological themes.
- The whole protocol runs in about 4.5 hours, most of it spent on interpretation.
Stage 1: Defining a Gene List from Omics Data
Genome-scale experiments generate raw data that must be processed to obtain gene-level information suitable for pathway enrichment analysis. Processing steps are specific to the omics experiment type; standard methods exist for established technologies and are most conveniently performed by the core facility that generates the data.
There are two major ways to define a gene list. Some omics data naturally produce a flat (unranked) list, such as all somatically mutated genes in a tumor identified by exome sequencing, or all proteins that interact with a bait in a proteomics experiment; such lists are suitable for direct input into g:Profiler (Step 6A). Other data naturally produce ranked lists, for example genes ranked by differential expression score or by sensitivity in a genome-wide CRISPR screen. GSEA is designed to analyze whole-genome ranked lists without a threshold (Step 6B), whereas a partial (non-whole-genome) ranked list should be analyzed with g:Profiler.
As a worked example, the protocol describes deriving a ranked gene list from raw ovarian cancer RNA-seq data. DNA sequence reads are quality-filtered and mapped to a genome-wide reference set of transcripts to count reads per transcript; counts are aggregated per gene. Read counts across multiple biological replicates and conditions are normalized to remove technical variation, then tested for differential expression using packages such as edgeR, DESeq, limma/voom or Cufflinks.
Differential expression analysis yields (i) the P value of the significance of differential expression, (ii) the related Q value (adjusted P value) corrected for multiple testing across all genes (e.g., by the Benjamini–Hochberg FDR procedure), and (iii) the effect size and direction of change (upregulated genes positive/top, downregulated negative/bottom), often expressed as log-transformed fold-change. The gene list is then ranked by one or more of these values, for example -log10 P value multiplied by the sign of the log fold-change.
- Raw omics data must be normalized and scored before pathway analysis, usually by the core facility.
- Flat gene lists (e.g., mutated genes) go to g:Profiler; whole-genome ranked lists go to GSEA.
- RNA-seq processing: quality-filter reads, map to transcripts, count per gene, normalize, then test differential expression.
- A common rank statistic combines significance and direction, e.g., -log10(P) multiplied by the sign of the log fold-change.
- edgeR, DESeq, limma/voom and Cufflinks are standard tools for RNA-seq normalization and differential expression.
Stage 2A: Enrichment of a Gene List with g:Profiler
The default analysis in g:Profiler and similar web tools searches for pathways whose genes are significantly over-represented in the fixed list of genes of interest, compared to all genes in the genome. The P value of enrichment is computed using a Fisher's exact test (based on the hypergeometric distribution), and multiple-test correction is applied.
g:Profiler also offers an ordered enrichment test, suitable for lists of up to a few thousand genes ordered by a score while the rest of the genome lacks meaningful ranking signal (for example, significantly mutated genes ranked by a cancer-driver prediction score). This analysis repeats a modified Fisher's exact test on incrementally larger sub-lists and reports the sub-list with the strongest enrichment P value for each pathway. g:Profiler searches a collection of gene sets representing GO terms, pathways, networks, regulatory motifs and disease phenotypes, and major categories can be selected to customize the search.
Methods based on Fisher's exact test require a defined set of background genes for comparison. All annotated protein-coding genes are often used by default, but this inflates P values and produces false positives if the experiment can only measure a subset of genes. Setting a custom background is important for targeted sequencing or phosphoproteomics experiments; the appropriate background would be all genes in the sequencing panel or all known phosphoproteins, respectively.
- g:Profiler uses Fisher's exact test to find over-representation in a fixed (unranked) gene list.
- Its 'ordered query' uses a modified Fisher's test on incrementally larger sub-lists of a ranked input.
- It searches GO terms, pathways, networks, regulatory motifs and disease phenotypes.
- Choosing an appropriate custom background gene set is critical for targeted assays to avoid inflated P values.
Stage 2B: Enrichment of a Ranked Gene List with GSEA
GSEA is a threshold-free method that analyzes all genes on the basis of their differential expression rank (or another score) without prior filtering. It is particularly recommended when ranks are available for all or most genes in the genome, such as for RNA-seq data, but it is not suitable when only a small portion of genes have ranks (e.g., significantly mutated cancer genes, which suit g:Profiler instead).
GSEA searches for pathways whose genes are enriched at the top or bottom of the ranked list more than expected by chance. To compute an enrichment score (ES), it walks the ranked list from top to bottom, increasing a running sum when a gene belongs to the pathway and decreasing it otherwise. The running sum is weighted so enrichment among the very top- and bottom-ranking genes is amplified. The ES is the maximum of the running sum, normalized relative to pathway size to give a normalized enrichment score (NES); positive and negative NES values represent enrichment at the top and bottom of the list. A permutation-based P value is computed and corrected to a permutation-based FDR Q value from 0 (highly significant) to 1 (not significant). The 'leading edge' identifies the specific genes contributing most to the enrichment signal.
GSEA offers two ways to assess significance of the ES: gene set permutation and phenotype permutation. Gene set permutation requires only a ranked list and compares the observed ES to scores from randomly sampled gene sets of matching size; it is recommended for studies with limited replication (two to five per condition), with differential expression computed outside GSEA using variance-stabilizing methods. Phenotype permutation requires expression data for all samples and shuffles sample labels, preserving biologically important gene correlations; it is recommended with larger numbers of replicates (at least ten per condition) but is computationally expensive. This protocol covers only gene set permutation.
By default the GSEA desktop software searches the MSigDB gene set database. Users can supply a custom database as a tab-delimited GMT (Gene Matrix Transposed) file, in which each line defines a pathway with its name, identifier and member genes; the gene identifiers must match those in the input gene list.
- GSEA is threshold-free and analyzes the entire ranked gene list, ideal for RNA-seq.
- The enrichment score is a weighted running sum, normalized by pathway size to give the NES.
- Positive NES = enrichment at the top (upregulated); negative NES = enrichment at the bottom (downregulated).
- Leading-edge genes are those contributing most to a pathway's enrichment signal.
- Gene set permutation suits few replicates (2–5); phenotype permutation suits many replicates (≥10) but is costly.
- Custom gene sets are supplied as a GMT file whose gene IDs must match the input.
Stage 3: Visualization and Interpretation with EnrichmentMap
Pathway information is inherently redundant because genes participate in multiple pathways and databases organize pathways hierarchically (e.g., 'cell cycle' and 'M-phase of cell cycle'). Consequently, enrichment analysis often highlights several versions of the same pathway, and collapsing these into a single biological theme simplifies interpretation. The recommended solution is a network visualization; EnrichmentMap is the Cytoscape application that creates an 'enrichment map'.
In an enrichment map, pathways are nodes (circles) connected by edges (lines) when they share many genes. Nodes are colored by enrichment score and edges are sized by the number of shared genes. Network layout and clustering algorithms automatically group similar pathways into major biological themes. EnrichmentMap takes a text file of enrichment results plus a text file of the pathway gene sets used in the original analysis. Users can interactively filter nodes by enrichment score and edges by connection strength. Multiple result sets can be shown in one map using different node colors, and, if expression data are loaded, clicking a node shows a gene expression heat map of the pathway's genes.
Interpretation proceeds in steps. First, expected themes should be identified as positive controls to validate results (e.g., growth-related pathways and hallmarks of cancer in cancer datasets). Second, pathways not previously associated with the context are examined more carefully as potential discoveries, starting with the strongest enrichment scores. Third, interesting pathways are examined in detail through expression heat maps and GSEA leading-edge genes.
Further analysis can overlay gene expression values on a pathway diagram (from Pathway Commons, Reactome, KEGG or WikiPathways) using tools such as PathVisio. When no diagram exists, STRING or GeneMANIA can build an interaction network among pathway genes within Cytoscape. Master regulators can be sought by integrating gene sets of miRNA or transcription factor targets with the EnrichmentMap post-analysis tool. Results can support scientific conclusions or generate hypotheses for follow-up experiments.
- Enrichment analysis produces redundant, overlapping pathways; an enrichment map collapses them into themes.
- Nodes are pathways (colored by ES); edges connect pathways that share genes (sized by overlap).
- EnrichmentMap needs the enrichment results file plus the pathway gene set (GMT) file.
- Interpretation: validate expected themes first, then evaluate novel pathways strongest-first, then inspect genes.
- Expression can be overlaid on pathway diagrams (PathVisio) or interaction networks (STRING, GeneMANIA).
Advantages and Limitations
Pathway enrichment analysis has several advantages over single-gene analysis. It improves statistical power by aggregating counts across all genes in a mechanism and by reducing dimensionality from tens of thousands of genes to a smaller number of pathways, lowering the multiple-testing burden. Results are easier to interpret because they use familiar concepts such as 'cell cycle', can help identify causal mechanisms and drug targets, make results from different data more comparable by projecting them onto a shared feature space, and facilitate integration of diverse data types that map to the same pathways.
Several limitations apply. Enrichment analysis works best for pathways in which multiple genes carry strong signals; pathways controlled by few genes or by post-translational regulation may never appear enriched. Pathway boundaries are somewhat arbitrary and databases disagree about membership, so using multiple databases helps. Some tests (e.g., Fisher's exact) are biased toward finding larger pathways significant, addressable by capping gene set size. Multi-functional genes ranked highly can drive enrichment of many irrelevant pathways, so repeating the analysis after excluding them tests robustness.
Pathway databases are biased toward well-known pathways, and enrichment analysis ignores genes with no annotations, the so-called 'dark matter of the genome' (e.g., non-coding RNA genes), which should be studied separately. Finally, most methods unrealistically assume statistical independence among genes and pathways, so standard FDRs may be more or less conservative than ideal; they should still be used for filtering and hypothesis generation, and custom permutation tests may give better false-discovery estimates.
- Boosts statistical power and reduces dimensionality and multiple-testing burden.
- Improves interpretability, aids identification of drug targets, and enables data integration.
- Blind to pathways controlled by few genes or by non-transcriptional regulation.
- Databases are incomplete and biased; unannotated genes ('dark matter') are ignored.
- Independence assumptions make FDR estimates imperfect but still useful for hypothesis generation.
Experimental Design Considerations
Pathway enrichment analysis benefits greatly from careful experimental design; otherwise apparently meaningful results may arise from biases or confounders. Experimental conditions must be well defined so that the major observed variation reflects the biological question (e.g., tumor versus normal, treated versus untreated, time series).
Biological replicates (independently processed samples from distinct organisms or cell lines) are required to measure variability and compute significance. At least three to four replicates per condition are recommended for low-variability systems using variance-stabilization normalization, while higher-variability systems such as tumor samples need more, ideally guided by a pilot experiment and power calculations. Technical replicates are usually unnecessary for established techniques like RNA-seq.
Confounding factors unrelated to the biological question (sequencing batch, extraction protocol, subject age, etc.) should be avoided or balanced so that statistical models can correct for them; PCA or clustering can reveal unknown factors, and cases and controls should cluster separately rather than by batch. Outlier samples, identifiable by PCA or clustering, may reflect technical problems or extreme biology; analyses should be run with and without outliers to confirm robustness.
Experimental sensitivity matters: quantifying gene expression with variance stabilization needs at least three to five replicates and about 10 million mapped reads, while 50–100 million reads are required to study splice isoforms, detect poorly expressed genes, or handle complex cellular mixtures.
- Define experimental conditions so observed variation reflects the biological question.
- Use at least 3–4 biological replicates per condition (more for high-variability samples like tumors).
- Balance or correct for confounders such as batch, protocol and age; check with PCA/clustering.
- Identify and test robustness against outliers; run analyses with and without them.
- RNA-seq needs ~10 million mapped reads for basic differential expression, 50–100 million for isoforms and rare transcripts.
Choosing Databases, Identifiers and Gene Set Sizes
The authors recommend searching pathway gene sets only at first, because they capture familiar normal cellular processes that are easy to interpret. GO biological process terms and manually curated pathways from Reactome, Panther, HumanCyc and NetPath are good human resources. GO biological process annotations mix manually curated and electronically inferred sources.
A large fraction of GO annotations come from automatic analysis and carry the evidence code 'inferred from electronic annotation' (IEA). For well-studied human and model organisms, comparing analyses with and without IEA filtering verifies robustness, but IEA annotations dominate less-studied species and should be kept there; removing them can bias results toward well-studied biology.
Non-pathway gene sets such as microRNA and transcription factor targets can reveal important regulators, but analyzing all gene set types together reduces interpretability and increases the multiple-testing penalty; pathway and non-pathway gene sets should be analyzed separately. It is generally beneficial to exclude very small pathways (redundant, and stringent for multiple testing) and very large pathways (overly general, e.g., 'metabolism', and inflated by tests like Fisher's). For human gene expression data, the authors often exclude gene sets with fewer than 10–15 or more than 200–500 genes, though other bounds appear in the literature.
For reproducibility, investigators should report the analysis date, software versions, gene set database versions and all parameters, and should keep pathway gene sets up to date since outdated resources strongly impact results. Recommended gene identifiers are stable, unambiguous IDs: Entrez Gene IDs (e.g., 4193 for MDM2) or official HUGO gene symbols for human genes, maintaining both since symbols change; UniProt accessions for proteins (e.g., Q00987 for MDM2) and Human Metabolome Database IDs for metabolites (e.g., HMDB00538 for ATP). Unexpected themes (e.g., apoptosis) may signal problems in design or sample handling and warrant review.
- Start with pathway gene sets (GO biological process, Reactome, Panther, HumanCyc, NetPath).
- Compare analyses with and without IEA (electronic) GO annotations to check robustness.
- Analyze pathway and non-pathway (miRNA/TF target) gene sets separately.
- Filter out very small (<10–15) and very large (>200–500) gene sets for human expression data.
- Use stable IDs (Entrez, HUGO symbols, UniProt, HMDB) and report versions, dates and parameters.
Application to Diverse Omics Data
Although the protocol uses RNA-seq and somatic mutation data as examples, the concepts apply to single-cell transcriptomics, CNVs, proteomics, phosphoproteomics, DNA methylation and metabolomics. Most data types need modifications: some require specialized computation to produce a suitable gene list, others need a specialized enrichment test.
Certain data types need specific identifiers (UniProt for proteins, HMDB for metabolites). Assays that capture only a subset of genes or proteins require a custom background; for example, phosphoproteomics measures only phosphoproteins, so the background must be the set of phosphoprotein-encoding genes, otherwise P values for general processes like kinase signaling are inflated.
Short non-coding genomic regions such as transcription factor binding sites from ChIP-seq must be mapped to protein-coding genes and corrected for biases such as increased signal in longer genes; tools like GREAT do both automatically. Large genomic intervals spanning multiple genes (from genome-wide associations, CNVs, differentially methylated regions) require specialized burden tests such as the PLINK CNV gene set burden test or INRICH, because standard tests inflate signals from clustered genes (e.g., olfactory receptors, histones, MHC members, homeobox transcription factors). Selecting one representative gene per genomic cluster is a simple fix. For rare genetic variants, case–control pathway burden tests are most appropriate.
- The framework extends to proteomics, phosphoproteomics, methylation, metabolomics, CNVs and single-cell data.
- Use data-type-appropriate identifiers (UniProt, HMDB) and custom backgrounds for partial-coverage assays.
- Map genomic regions (ChIP-seq) to genes with length-bias correction using tools like GREAT.
- Large intervals and clustered genes need burden tests (PLINK CNV, INRICH) or one-gene-per-cluster selection.
- Rare variants are best handled with case–control pathway burden tests.
Comparison to Alternative Methods
The protocol recommends g:Profiler and GSEA. g:Profiler analyzes gene lists with Fisher's exact test and ordered lists with a modified Fisher's test, offering a web interface and R/Python access, with a downloadable GMT gene set database. GSEA analyzes ranked lists with a permutation-based test and runs as a desktop application. Hundreds of other tools exist, many relying on outdated databases or lacking unique features.
Recommended alternatives for enrichment include Enrichr (web-based, Fisher's exact test, over 100 gene set libraries and rich interactive reporting), Camera (an R/Bioconductor package that corrects for inter-gene correlation), GOseq (an R/Bioconductor package correcting for covariates such as gene length in RNA-seq), and GREAT (analyzes genomic regions rather than gene lists).
For visualization, EnrichmentMap is recommended, with two alternatives: ClueGO, a Cytoscape app conceptually similar to EnrichmentMap that also performs GO enrichment but supports only GO gene sets, and PathVisio, a desktop application that colors genes within a specific pathway diagram according to user omics data.
Topology-aware methods explicitly model gene interactions rather than treating pathway genes uniformly. CePa, GANPA and THINK-Back weight genes by network importance (e.g., degree, betweenness centrality). SPIA, Pathway-Express and EnrichNet generate a pathway-level score considering regulatory interactions such as activation and inhibition. These are potentially more accurate but limited by the sparse availability of detailed regulatory interaction data, so the gene-set methods in this protocol will likely remain the most widely used for the foreseeable future. Next-generation methods are expected to integrate more pathway detail and multi-sample models, potentially predicting drug combinations from single-cell RNA-seq.
- g:Profiler (Fisher's test, web/R/Python) and GSEA (permutation, desktop) are the recommended enrichment tools.
- Alternative enrichment tools: Enrichr, Camera, GOseq, GREAT.
- Alternative visualization tools: ClueGO (GO only) and PathVisio (colors genes on a pathway diagram).
- Topology-aware methods (CePa, GANPA, THINK-Back, SPIA, Pathway-Express, EnrichNet) model gene interactions but are data-limited.
Materials and Software Setup
Hardware: a personal computer with Internet access and at least 8 GB of RAM. GSEA alone can run in 1 GB, but Cytoscape (required for EnrichmentMap) needs at least 8 GB. Software: a contemporary web browser for g:Profiler; Java Standard Edition (v.8 or higher) to run GSEA and Cytoscape; the GSEA desktop application; and the Cytoscape desktop application (v.3.6.0 or higher).
Required Cytoscape apps are EnrichmentMap (v.3.1+), clusterMaker2 (v.0.9.5+), WordCloud (v.3.1.0+) and AutoAnnotate (v.1.2.0+); these are conveniently installed together as the 'EnrichmentMap Pipeline Collection' from the Cytoscape App Store.
Input data: downloadable example files (Supplementary Tables 1–13) should be saved in a project data folder, with a separate results data folder for generated files. The g:Profiler example (Step 6A) is a list of 127 cancer driver genes with frequent somatic SNVs identified by MuSiC in TCGA exome data of 3,200 tumors of 12 types, ranked by significance. The GSEA example (Step 6B) is an RNK file of differentially expressed genes comparing the immunoreactive and mesenchymal subtypes of TCGA ovarian cancer, with a gene score for all/most genes. For GSEA, a GMT pathway database is required (Supplementary Table 3), downloaded from http://baderlab.org/GeneSets, containing pathways from GO, Reactome, Panther, NetPath, NCI, MSigDB C2 (excluding Reactome and KEGG), MSigDB Hallmark and HumanCyc; these gene sets are updated monthly.
- Need a computer with ≥8 GB RAM (for Cytoscape), a web browser and Java 8+.
- Install GSEA and Cytoscape desktop apps plus the EnrichmentMap Pipeline Collection.
- g:Profiler example: 127 TCGA cancer driver genes (flat, ordered list).
- GSEA example: ranked RNK list comparing mesenchymal vs immunoreactive ovarian cancer subtypes.
- GSEA needs a GMT database; the Bader Lab GeneSets file combines eight sources and updates monthly.
Procedure Part 1 — Installation and Running Enrichment (Steps 1–6)
This part of the numbered procedure covers software installation (Steps 1–5, about 5 minutes) and pathway enrichment analysis (Step 6, 3–20 minutes). Step 6 branches: option A uses g:Profiler for a flat gene list, and option B uses GSEA for a ranked whole-genome list. Select the branch that matches your gene list type.
In the g:Profiler branch (6A), the list is pasted into the web query field, an ordered query and optional removal of electronic GO annotations are chosen, data sources are limited to GO biological processes and Reactome, gene set size is bounded (min 5, max 350), and the query/term intersection is set to 3. Results are returned as significant pathways (Q < 0.05 by default) and downloaded in Generic Enrichment Map (GEM) format along with the corresponding GMT file.
In the GSEA branch (6B), the RNK file and GMT database are loaded, GSEAPreranked is run with 1,000 permutations and a maximum gene set size of 200, and results are saved to the results folder. GSEA labels the top of the list 'na_pos' and the bottom 'na_neg'. The HTML report is used to count pathways passing FDR thresholds (Q < 0.05 preferred; Q < 0.1 or Q < 0.25 are more lenient).
- Step 1: Download example input/output files; create a project data folder and a results data folder.
- Step 2: Install Java v.8 or higher (JRE).
- Step 3: Download the javaGSEA desktop application (free registration required).
- Step 4: Download Cytoscape v.3.6.0 or higher.
- Step 5: In Cytoscape, install the EnrichmentMap Pipeline Collection (EnrichmentMap, clusterMaker2, WordCloud, AutoAnnotate) via Apps → App Manager.
- Step 6A (g:Profiler): open the site, paste the gene list, check Ordered query, optionally exclude electronic GO annotations, select GO biological process + Reactome, set size min 5 / max 350 and intersection 3, run, then download the Generic Enrichment Map (GEM) result and the GMT file.
- Step 6B (GSEA): launch GSEA, Load Data (RNK + GMT), Run GSEAPreranked with the gene set database, 1,000 permutations, ranked list, an analysis name, max size 200, and a results folder; run and wait for 'Success'.
- Step 6B examination: open the report, review na_pos (upregulated) and na_neg (downregulated) sets and the top-20 Snapshot, and count pathways passing FDR Q < 0.05 (or more lenient thresholds if needed).
Procedure Part 2 — Building the Enrichment Map (Steps 7–9)
This part (Steps 7–9, about 5 minutes) creates the enrichment map in Cytoscape. Step 7 launches Cytoscape; Step 8 opens the EnrichmentMap app; Step 9 populates the Create Enrichment Map panel, with branch A for g:Profiler results and branch B for GSEA results. The required input files differ between branches, but the tuning parameters are the same.
For both branches the user selects the results folder (auto-populating the fields), verifies the analysis type and the enrichment and GMT files, optionally supplies expression, ranks, classes (CLS) and phenotype labels, then tunes the node cutoff (FDR Q value, set to 0.01 in the protocol) and the edge connectivity slider before clicking Build. For GSEA, positive and negative enrichment reports are provided and phenotypes are renamed (na_pos to Mesenchymal shown red, na_neg to Immunoreactive shown blue).
- Step 7: Launch Cytoscape.
- Step 8: Open Apps → EnrichmentMap.
- Step 9A (g:Profiler): select the results folder, set Analysis Type to Generic/gProfiler, verify the GEM enrichment file and the hsapiens.pathways.NAME.gmt file, optionally add expression/ranks/classes/phenotypes, set FDR Q to 0.01, keep the edge slider centered, and click Build.
- Step 9B (GSEA): select the GSEA results folder, set Analysis Type to GSEA, verify the na_pos and na_neg reports, the GMT and ranks files, optionally add expression and CLS, rename phenotypes (na_pos→Mesenchymal/red, na_neg→Immunoreactive/blue), set FDR Q to 0.01, and click Build.
- Similarity slider presets include Jaccard > 0.35, Jaccard > 0.25, combined > 0.375, overlap > 0.5, and overlap > 0.25.
Procedure Part 4 — Exporting, Legends and Saving (Steps 14–20)
The final part (Steps 14–20, about 15 minutes) exports the figure and preserves the analysis parameters. The network is exported as an image, with vector formats (PDF, SVG) recommended for publication because they scale without quality loss and can be edited in Adobe Illustrator or Inkscape; PNG suits online use while JPG is discouraged due to lossy artifacts.
Only the visible part of the map is exported, so the entire network must be on screen first. Creation parameters (FDR Q value, similarity metric and threshold) are recorded via the EnrichmentMap Settings so they can be added to the figure legend, for example 'Enrichment map was created with parameters q < 0.01, and Jaccard Overlap combined coefficient > 0.375 with combined constant = 0.5'. A legend can be generated (Show Legend) describing node and edge size, shape and color attributes. Finally, all work is saved as a Cytoscape session.
- Step 14: Export the image as PDF (vector) for publication quality.
- Step 15–16: Set the file name/location and save; ensure the whole network is visible so it is not cropped.
- Step 17–18: Open EnrichmentMap Settings and Show Creation Parameters (FDR Q, similarity metric/threshold) for the legend.
- Step 19: Show Legend and select the node/edge attributes relevant to your analysis.
- Step 20: Save all work as a Cytoscape session (File → Save As).
Troubleshooting and Anticipated Results
The protocol provides an extensive troubleshooting table. Common issues include launching GSEA on macOS (right-click Open to bypass the unidentified-developer error, or run from the command line with more memory via java -Xmx4G -jar), the 'Java Heap space' error (use a webstart with more RAM or the JAR file with increased memory), GSEA appearing unresponsive during computation (click the '+' to see shuffleGeneSet progress messages), and few or no results from GSEA (possible gene ID mapping problems if the number of analyzed gene sets is low). In EnrichmentMap, autoloading many g:Profiler files can create wrong datasets (keep only the results and GMT files together in a folder), and collapsed clusters appear gray if attribute aggregation was not enabled.
The g:Profiler analysis produces a results text file with six columns (GO.ID, description, p.Val, FDR, Phenotype, Genes; P and FDR values are equal because g:Profiler reports only FDR-adjusted values) and the pathways GMT file. The GSEA analysis produces two report tables (na_pos and na_neg), each with 11 columns describing enrichment, plus a full results directory whose index.html gives a visual summary.
The final visualization is an enrichment map that collapses redundant pathways into biological themes. Interpretation is validated by finding expected themes (e.g., growth pathways in cancer), evaluating novel pathways as discoveries, and inspecting genes via heat maps, pathway diagrams, interaction networks or regulatory networks. Because results depend on parameters such as pathway size bounds and database choice, the robustness of conclusions should be tested by varying these parameters. All software and custom R scripts are publicly available on the Bader Lab GitHub.
- macOS GSEA launch: right-click → Open, or run from the command line with -Xmx memory flag.
- 'Java Heap space' means GSEA ran out of memory; use a higher-RAM webstart or the JAR file.
- Few/no GSEA results with a low number of analyzed gene sets suggests gene ID mapping problems.
- g:Profiler output: six-column results file (P equals FDR) plus a pathways GMT file.
- GSEA output: na_pos and na_neg 11-column report tables plus a results directory with index.html.
- Test robustness by varying pathway size limits and database choices.
Figures
13 figures extracted from the source PDF — click any to enlarge.
⤢
⤢
⤢
⤢
⤢
⤢
⤢
⤢
⤢
⤢
⤢
⤢
⤢Test yourself
10 questions on this chapter.