Climate-Resilient Crops · Data Tutorial

GO Enrichment Analysis

By the end of this practical you will be able to:

1 Your clusters, and the question they leave open

This is the same dataset you clustered earlier: 500 genes measured in Arabidopsis plants that were treated in three ways and sampled at three time points. Clustering put genes that behave in the same way into the same group.

That is a useful start, but look at what a cluster actually gives you: a list of codes like AT1G29930. A list of names does not tell you what those genes do, and that is what you need if you want to say anything about how the plant defends itself. Closing that gap is what the rest of this practical is about.

Distance:
Linkage:

Each row is one gene, each column one sample. Blue means the gene is expressed below its own average, red above it. The coloured bar on the left shows which cluster each gene ended up in, labelled C1, C2 and so on. The cluster you have selected is outlined in white.

low → high expression

Pick the cluster you want to work with

Everything in steps 2 to 4 follows this choice, so you can come back and change it at any time.

AVR (avirulent bacteria) VIR (virulent bacteria) MOCK (no bacteria)
❓ Question
  • Which cluster shows an expression pattern that looks promising if you want to study resistance to this biotic stress? Say what it is about the pattern that convinces you.

2 Looking up what a gene does

Biologists have spent decades writing down what individual genes do. The problem is that everybody writes it down differently: "helps against bacteria", "bacterial defence", "responds to Pseudomonas". A computer cannot tell that these mean the same thing.

The Gene Ontology (GO) solves this. It is a fixed dictionary of biological processes that everyone agrees to use, so a result from one lab can be compared with a result from another. Every entry is called a GO term and has an id and a name, such as GO:0009617 response to bacterium.

Two things about GO matter for what follows. First, the terms are ordered from general to specific: response to stress sits above response to bacterium, which sits above still more specific terms. If a gene is labelled with a specific term, it automatically counts for all the more general terms above it as well. Second, a gene usually carries several terms at once, because a gene can be involved in more than one process.

Look one gene up

The terms of this gene, drawn from general (top) to specific (bottom). Green terms are the ones the gene is directly labelled with; grey terms are the more general ones it inherits automatically.

❓ Questions
  • What functional annotations does your gene have? Is each GO term equally specific?
  • What is a disadvantage of looking only at the annotations of a single gene? Do you think all the GO terms you find for your gene make sense?
💡 Hint if every gene you try looks convincing

Try a few more genes from the same cluster, including one or two that you pick at random rather than choosing yourself. Also look at how many terms each gene has, and check whether the terms were measured in the lab or predicted by a computer.

3 Enrichment: doing this for the whole cluster at once

Looking up genes one at a time does not scale, and it is easy to fool yourself: if you go hunting through 200 genes you will always find one that fits the story you had in mind. GO enrichment does the job for the whole cluster at once, and it does it by counting.

The idea is simple. Take one GO term. Count how many genes in your cluster carry it. Then count how many genes in the whole dataset carry it. If the cluster has clearly more than its fair share, that term is enriched, and the process it describes is probably what this group of genes is doing. Repeat for every term.

How do we decide what counts as "clearly more"?

The page works out how likely that count would be if you had simply grabbed the same number of genes at random out of the dataset. That likelihood is the p-value: a small p-value means random picking would almost never give you this many. The calculation is a standard one called Fisher's exact test, and it is exactly what the goatools package in the notebook does for you.

Why the numbers below are "corrected"

There is a catch. We do not test one term, we test about 1,300 of them. If you run 1,300 tests, some will look impressive purely by chance, in the same way that rolling a die often enough will eventually give you five sixes in a row. The correction adjusts every p-value to account for how many tests were run. Always read the corrected column. You can switch the colouring below to see how much difference this makes.

Enrichment results for your cluster

Colour by:
Show:
p < 0.005 p < 0.01 p < 0.05 p > 0.05, not significant

The enriched terms in their general-to-specific order, coloured by p-value. Click a term to see which of your cluster's genes carry it.

❓ Questions
  • Do the enriched GO terms of the cluster make sense, looking at its expression profile in step 1?
  • What is the goal of GO enrichment analysis? Try to say it in one sentence.
  • Find a cluster that returns no enriched terms at all. Is that a failure of the method, or is it telling you something?
  • How would you use the enriched GO terms of your cluster to inform a follow-up experiment? Be concrete: what would you measure, on which plants, and at what moment?

4 Before you trust the result

You have just sketched a follow-up experiment. Before anyone spends a season on it, there is one check worth doing, and this step is about that check.

An enrichment result is a lead, not a conclusion. It tells you that genes already known to be involved in some process changed together. It does not tell you that the process caused anything. And, more awkwardly, it does not tell you that your treatment caused the change: if something else happened to the plants at the same time as the infection, the analysis will report that just as happily, and it will look just as convincing.

The genes that change at 1 hour

In the original study the plants were sampled 1, 6 and 12 hours after treatment. The button below resets the clustering to its default settings and selects the cluster whose genes respond most strongly at the 1 hour time point, so you can run the analysis on it.

AVR VIR MOCK
❓ Question
  • Can you use this methodology to explain what seems to cause the gene expression changes in the plant at 1 hour after infection? Compare the MOCK line with the two infected lines before you answer, and look at which processes come out enriched.
If you have time left

Go back to step 1, change the number of clusters or the linkage, and run the enrichment on other clusters. Do the same biological processes keep turning up, or does each set of settings tell a different story? That is worth knowing before you trust any single result.

✓ Check your understanding