Climate-Resilient Crops ยท Data Tutorial

Transcriptomics & Clustering

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

1 The experiment behind the data

In this practical we explore real RNA-seq data from the study High-Throughput RNA Sequencing of Pseudomonas-Infected Arabidopsis Reveals Hidden Transcriptome Complexity and Novel Splice Variants by Howard et al. (2013). Open the paper in a new tab, because you will keep coming back to it to connect what you see here with the plant biology from the lectures.

The researchers took Arabidopsis plants and applied three treatments. Each treatment was sampled at three time points (1, 6 and 12 hours), giving 9 samples in total. For each sample we have the expression of the same 500 genes. The numbers are z-scored per gene: for every gene the nine values were rescaled to have mean 0, so a positive number means "higher than that gene's average" and a negative number means "lower than average". This lets us compare the shape of a gene's response across samples rather than its absolute level.

A small slice of the data: rows are genes, columns are the 9 samples, numbers are z-scored expression.

โ“ Questions
  • Look at the paper. What are the three treatments, and what is the goal of comparing them?
  • Why do you think the plants were sampled at several time points instead of just one?
๐Ÿ’ก Hint on where to find the treatments

In the paper, scroll down to Results and look at the section called Dataset. The very first paragraph there lists what was infiltrated into the leaves for each of the three treatments. While you read it, ask yourself which treatment received no bacteria at all, and what the difference is between the two bacterial strains, because that difference is the reason the experiment was designed with three treatments rather than two.

2 Reading a clustered heatmap

A heatmap shows the whole 500×9 table at once as colour: red means a gene is expressed above its average in that sample, blue means below. On its own that is just a wall of colour. The power comes from clustering: we reorder the rows so that genes with similar response patterns sit next to each other, and reorder the columns so that similar samples sit next to each other. The tree above the columns (a dendrogram) shows which samples were merged together, and how early.

low → high expression (z-score) AVR VIR MOCK
โ“ Questions
  • What do the rows and the columns represent, and what do the colours mean?
  • Is the avirulent (AVR) sample more similar to the virulent (VIR) sample or to the mock sample? Look at the tree above the heatmap.
  • Does the treatment or the time point play the bigger role in how the samples group together?
  • Explain the clustering in your own words: what does it tell you about the relationships between the samples?
๐Ÿ’ก Hint on reading the dendrogram

Do not answer this one from the names of the treatments. To work out how far apart two samples are, start at each of them and follow the tree upwards until the two paths meet. The height at which they join is the distance the algorithm found between them, so the lower they meet, the more alike they are. Go through the tree in that order: which two samples get merged together first, which sample joins them next, and which one is left until last? Read that off the tree using only the data. Once you have that order, go back to the biology and ask which explanation fits what you found.

3 How hierarchical clustering works, and how many clusters?

Hierarchical clustering is unsupervised: nobody tells the algorithm which genes belong together, it discovers structure on its own. It is beautifully simple. Every gene starts as its own tiny cluster. Then, over and over, the algorithm finds the two closest clusters and merges them, until everything is joined into one tree. Two choices decide the outcome:

The figure below draws this process directly onto the heatmap. On the left is the tree; to actually get clusters we cut it at some height (the dashed line), and every branch below the cut becomes one cluster. The coloured bar between the tree and the heatmap shows which cluster each gene row belongs to, so you can see the coloured blocks in the heatmap line up with the clusters. Slide the cut, and switch the distance and linkage, and watch genes move between clusters and the heatmap re-sort itself.

Distance:
Linkage:
low → high expression (z-score) dashed line = the cut

Left: the gene tree, coloured by cluster. Middle bar: each gene's cluster. Right: the heatmap, its rows sorted by the tree so clusters appear as coloured blocks.

Number of genes in each cluster.

Which genes are in cluster:

Notice how the number of clusters, and even which genes end up together, shift as you move the cut and switch the distance or linkage. There is rarely one obviously correct answer, and choosing a clustering is a judgement call that depends on the biological question you are asking.
โ“ Questions
  • How many clusters do you think is most appropriate for this dataset? Why? Is there a single right answer?
  • Switch between the linkage and distance options. What differences do you observe, and can you explain them?
  • Which cluster(s) of genes would be most interesting to study further, and how would you decide?
  • Try to link a cluster back to the underlying biology. Look at the coloured block a cluster forms in the heatmap: in which treatments and at which time points are those genes high, and in which are they low? What function do you think the genes in that cluster might be carrying out for the plant?

If you have extra time, pick a cluster in the list above and click a few of its genes. Each one opens that gene in UniProt, where you can read what the protein is thought to do. Can you link them to a biological process involved in stress response, does the whole cluster tell a consistent story, and does it match what the Howard et al. paper reports?

4 A gene correlation network

Clustering is not the only way to look for structure. We can also build a network: draw one dot (node) per gene, and connect two genes with a line (edge) whenever their expression patterns are highly correlated across the nine samples. Genes that move together end up tied into tightly connected knots. Raise the threshold and only the very strongest relationships survive; lower it and the web fills in.

Colour nodes by:

Each dot is a gene; lines connect strongly correlated genes. Drag nodes around, scroll to zoom, and hover a node to see its name.

node colour & size: low high centrality
โ“ Questions
  • What happens to the network as you change the correlation threshold?
  • What could it mean, biologically, that two genes are connected by an edge?
  • Think it through rather than looking it up: would you expect the hierarchical clusters from step 3 and the tightly connected knots here to correspond to each other? Why, or why not?
  • What can you learn from a network that you cannot learn from clustering, and what can you learn from clustering that you cannot learn from a network?
  • The colouring highlights "central" genes. If you worked with a plant biologist, which genes would you suggest studying next, and what experiment would you propose?

โœ“ Check your understanding