By the end of this practical you will be able to:
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.
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.
Everything in steps 2 to 4 follows this choice, so you can come back and change it at any time.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.