11 Annotation and Gene Ontology enrichment
A list of regions is hard to read on its own. This chapter shows two ways to give it meaning: annotation, which says what lies at and near each region, and Gene Ontology (GO) enrichment, which asks whether the genes near a set of regions share a function.
11.1 The question
Where are my regions: at promoters, in introns, or far from genes? And do the genes near them have something in common, such as a pathway or a cell function?
11.2 How it works
Assigning each region to a genomic feature
A gene annotation file (for example from GENCODE, Chapter 3) lists every gene, transcript, exon and untranslated region (UTR). Annotation tools overlap each region with these features. Because features overlap each other, a tool needs an order of priority. ChIPseeker, a widely used tool, “adopted the following priority”: promoter, 5′ UTR, 3′ UTR, exon, intron, downstream, intergenic (Yu et al. 2015; Yu 2026). By default, a promoter is the region from 3 kb upstream to 3 kb downstream of a transcription start site (TSS) (Yu et al. 2015).
Assigning each region to a gene
The simplest rule gives each region to its nearest gene. This is often wrong for enhancers, which can act on genes further away. The rule also has a bias: genes with long empty stretches of DNA around them collect many regions by chance. GREAT, a tool for enrichment of regions, found that “associating each binding site with the one or two nearest genes—introduces a strong bias toward genes that are flanked by large intergenic regions” (McLean et al. 2010).
GREAT instead gives each gene a regulatory domain: “a basal domain that extends 5 kb upstream and 1 kb downstream from its transcription start site”, extended to the domains of the nearest genes on each side, up to 1 Mb (McLean et al. 2010). A region belongs to every gene whose domain contains it.
Testing for enrichment
The Gene Ontology gives each gene terms that describe its biological process, molecular function and cellular component (Gene Ontology Consortium 2023). Enrichment asks: do more of my regions fall near genes with a term than you would expect by chance?
GREAT runs two tests (McLean et al. 2010):
- A region test (binomial): do more regions than expected fall in the domains of the term’s genes, given how much of the genome those domains cover?
- A gene test (hypergeometric): are more of the term’s genes hit by at least one region than expected?
The two tests answer different questions. A term that passes both is spread over many genes. A term that passes only the region test often comes from many regions near a few genes. GREAT calls the first “term-derived enrichment” and the second “gene-specific enrichment” (McLean et al. 2010).
Choosing the background
Enrichment always compares your regions with a background. The choice of background decides the question you ask:
- One sample’s peaks against the whole genome asks: what kind of cell is this? The answer is usually the cell’s identity.
- Changed regions against all tested regions asks: what is special about the regions that changed? This is the question of the experiment.
11.3 In EpiNexus
Annotation. EpiNexus annotates every sample’s peaks with the gene annotation of the genome (GENCODE for human and mouse), using ChIPseeker’s order of priority and a promoter of ±3 kb. Each peak also gets its nearest gene and its distance to that gene’s TSS. The Annotation page has the tabs Feature Distribution, Distance to TSS, Genomic Distribution and Annotation Table.
GO enrichment. EpiNexus uses GREAT’s regulatory domains (5 kb upstream and 1 kb downstream, extended up to 1 Mb) and the GO annotations of NCBI for the genome. It tests:
- each sample’s peaks against the genome, with the region and the gene test;
- each comparison’s gained and lost regions against all tested regions, with a region test.
On the GO Enrichment page, choose the region set and the ontology. The table shows, for each term, the number of regions, the fold enrichment, the region FDR, the genes hit (for example 4 / 9: four of the term’s nine genes), the gene FDR and the genes themselves.
Look at terms that pass both tests. GREAT’s own results view shows only terms “statistically significant by both the binomial and hypergeometric tests”, with at least two-fold enrichment, because “each test has a bias that is compensated by the other test” (GREAT team 2026). EpiNexus uses the same rule, at FDR < 0.05, for one sample’s peaks. For gained and lost regions, which are tested against all tested regions, only the region test applies. EpiNexus then calls a term at FDR < 0.05 with at least two-fold enrichment, and shows the gene FDR beside it.
11.4 Reading the result
Where the peaks lie
Table 11.1 compares the H3K27ac peaks of the heart dataset (Chapter 14) with the ATAC-seq peaks of the stem-cell dataset (Chapter 16).
| Feature | H3K27ac, heart | ATAC-seq, stem cells |
|---|---|---|
| Promoter (≤ 1 kb) | 22 % | 17 % |
| Promoter (1–3 kb) | 11 % | 9 % |
| Intron | 43 % | 39 % |
| Distal intergenic | 18 % | 27 % |
| Exon, UTRs, downstream | 6 % | 9 % |
| Median distance to the nearest TSS | 9.5 kb | 11.5 kb |
In both datasets, only about a fifth of the peaks lie within 1 kb of a gene start. Most lie in introns or between genes, a median of about 10 kb from the nearest TSS. Many of them are likely enhancers. For them, the nearest gene is only a first guess (Chapter 13).
GO of all peaks: the cell type
For each of the four H3K27ac libraries, EpiNexus found more than 200 significant terms. The top ones were “focal adhesion”, “actin filament organization” and “contractile muscle fiber”. These describe heart muscle. They confirm the tissue, but they say nothing about the experiment.
GO of the changed regions: the experiment
| Dataset, region set | Significant terms | Pass both tests | Top term by the region test |
|---|---|---|---|
| H3K27ac, lost (2,267 regions) | 284 | 38 | “response to denervation involved in regulation of muscle adaptation”: 26 regions, 4 genes |
| H3K27ac, gained (194 regions) | 5 | 0 | “type 2 fibroblast growth factor receptor binding”: 4 regions, 1 gene |
| ATAC-seq, lost (6,561 regions) | 89 | 6 | “arachidonate epoxygenase activity”: 29 regions, 25 Cyp genes |
Read the top terms with care (Table 11.2):
- In the H3K27ac sets, they rest on one to four genes. Their gene tests are not significant. This is GREAT’s “gene-specific enrichment”.
- In the ATAC-seq set, the term passes both tests (gene FDR 0.03), but all 25 of its genes are Cyp genes. Members of this family lie side by side in the genome. The gene test counts genes, and cannot see that they are neighbours. So a cluster of related genes can pass both tests.
The strongest terms pass both tests and come from genes spread over the genome. For the H3K27ac lost regions, such terms describe heart conduction and contraction (Chapter 14).
Figure 11.2 shows these results on the GO Enrichment page.
11.5 Pitfalls
GO terms of a sample’s full peak list describe the cell type. To learn about the experiment, test the regions that changed between conditions, against all tested regions.
Before you report a term, look at how many genes stand behind it, and whether the gene test agrees. A term carried by a few genes, or by one gene cluster, is about those genes, not a pathway.
In both examples, half of the peaks lie about 10 kb or more from a gene start. For such regions, the nearest gene is a guess. Enhancer–gene links (Chapter 13) give a better estimate, and experiments are needed to prove it.