Intro to R III: heatmaps!

As many of us biologists know, heatmaps are so common in papers about any kind of high-throughput assay that they’re almost a cliché. The reason is that they let you view, at a glance, global patterns of differences between clusters of samples and/or genes, allowing you to see the forest instead of the trees (to use another cliché). Making and customizing heatmaps doesn’t have to be as groan-worthy as this introduction, though. It’s as easy as knowing how to navigate a handful of functions in R, which Igor will be walking us through today.

To prepare, please copy, paste, and run the R code posted here in RStudio. Below, I’ve posted the installation instructions, but please check out the link for the full tutorial code.

# install the relevant packages if they are not installed

# download the data files (it will download to the current working directory)
download.file(paste0("", fileName), destfile=fileName)
download.file(paste0("", fileName), destfile=fileName)

# load the relevant packages

If you want the files themselves just to keep, download them here and here. The R code posted above will also manage the installations you will need for this tutorial, namely RColorBrewer (a package for fancy colour schemes in R) and pheatmap (the package that does the work of making the heatmap).


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s