Enrichment Analysis

Basics

Enrichment analysis = to analyze whether specific biological pathways or functions are over-represented (enriched) in large-scale omics data, e.g. genes or proteins.

Core idea

Important idea

Enrichment analysis is usually not about one gene. It is about whether a group of genes points to a biological function, pathway, or process.

Key terms

Foreground
= the selected/presented genes or proteins

Background
= the genes/proteins existing in the whole genome, or the reference set used for comparison

Warning

Background choice matters. A bad background can make the enrichment result misleading. It should match the experiment, not always the whole genome.

Gene set
= a predefined group of genes that share something, e.g. same pathway, same biological function, same cellular location, or same regulation pattern

Ranked gene list
= genes ordered by a score, e.g. fold change, test statistic, correlation, or other measurement

Enriched
= a gene set/pathway/function appears more strongly than expected by chance

Enrichment scores
= a number that summarizes how strongly a gene/protein set is enriched in the input data.
It is often based on:

Tip

Different methods calculate enrichment scores differently. So the score should be interpreted together with the method/tool that produced it. See below.

Main Types

Overview and Comparison

graph LR
    A[Enrichment Analysis] --> B[Over-Representation Analysis ORA]
    A --> C[Gene Set Enrichment Analysis GSEA]
    A --> D[Functional Enrichment Analysis]
    D --> E[GO Enrichment]
    D --> F[Pathway Enrichment]
    E --> G[GO Biological Process]
    E --> H[GO Molecular Function]
    E --> I[GO Cellular Component]
Method Input Main question When to use Gene set presented
ORA selected foreground + background is this gene set over-represented in the selected genes? when there is a clear selected gene/protein list any predefined gene set
GSEA ranked gene list are genes from this gene set concentrated at the top/bottom of the ranking? when cutoff for selecting genes is unclear any predefined gene set
GO enrichment gene list/ranked list + GO database enrichment (by ORA or GSEA) using GO terms functional interpretation functions/processes/locations
Pathway enrichment gene list/ranked list + pathway database enrichment (by ORA or GSEA) using pathway gene sets pathway interpretation biological pathways or interaction routes

Over-Representation Analysis (ORA)

= tests whether a gene set is over-represented in a selected foreground list compared with a background list

How it works

Input

Output

Enrichment scores & stats

In ORA, the score/statistics are based on overlap between:

Notation:

Contingency table (related idea: contingency table tests):

In gene set Not in gene set Total
Foreground k nk n
Not foreground Kk NKn+k Nn
Background total K NK N
Gene ratio

= proportion of foreground genes in the gene set

gene ratio = k / n
Background ratio

= proportion of background genes in the gene set

background ratio = K / N
Fold enrichment

= how much more common the gene set is in the foreground than in the background.

fold enrichment = gene ratio / background ratio
                = (k / n) / (K / N)

Meaning:

P-value

P-value comes from a random sampling model with tests:

P(X = k) = [C(K, k) * C(N-K, n-k)] / C(N, n)

For enrichment, the p-value is usually:

p-value = P(X >= observed k)

Meaning:

Adjusted p-value / FDR

ORA tests many gene sets at once, so tools correct p-values for multiple testing. Adjusted p-value / FDR provides corrected significance after considering that many gene sets were tested. See Adjusting p-values in Statistical analysis.

Gene Set Enrichment Analysis (GSEA)

= tests whether genes from a gene set tend to appear near the top or bottom of a ranked gene list.

How it works

Input

Output

Enrichment scores & stats

In GSEA, the score/statistics are based on where gene set members appear in a ranked gene list.

GSEA Enrichment Score

GSEA walks down the ranked list:

Simplified unweighted idea:

The enrichment score is the largest deviation from zero.

Enrichment Score = maximum running-score deviation from 0

Meaning:

Note

In real GSEA, the increase can be weighted by the ranking score, so highly ranked genes may contribute more strongly.

NES

= normalized enrichment score.

Why normalize:

So GSEA often normalizes ES to make gene sets more comparable.

P-value

GSEA p-value usually comes from permutation/randomization, which is also a sampling/randomization idea (see Data Sampling).

Simplified idea:

Functional enrichment analysis

= general name for enrichment analysis that interprets a gene/protein list by biological functions.

GO enrichment

= enrichment analysis using Gene Ontology terms as the gene sets. It is not a different statistical idea by itself - it means the enrichment result is interpreted through GO terms.

Gene Ontology (GO) = a structured vocabulary for describing gene functions.

Main GO categories

GO category Meaning
GO Biological Process (BP) biological programs/processes, e.g. cell cycle
GO Molecular Function (MF) molecular activity, e.g. binding or enzyme activity
GO Cellular Component (CC) where gene products are located, e.g. nucleus or membrane

How it works

Pathway enrichment

= enrichment analysis using pathway databases as gene sets.

Examples of pathway-style interpretation

Common workflow

  1. get gene/protein measurements from omics data
  2. for protein, usually first map proteins to gene IDs / annotations; see Proteomics Analysis and Modeling
  3. define input
    • ORA: foreground + background
    • GSEA: ranked gene list
  4. choose gene sets/database
    • GO terms
    • pathways
    • other curated gene sets
  5. run enrichment test
  6. correct for multiple testing (Adjusting p-values in Statistical analysis)
  7. interpret enriched terms carefully

Things to be careful about