Heatmap Maker Shiny App

[This article was first published on R in the Lab, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

A brief tutorial about how to use Heatmap Maker, a web application in R made with Shiny.

 

What is Heatmap Maker?

Heatmap Maker is a Shiny App that allows you to make and save cluster heatmaps as the following:

Heatmap Maker has as a core the function heatmap.2() from gplots package.

Install and use

If you are an R and RStudio user, you have two options to use the app.

Download from GitHub

Simply download it from GitHub or through GitHub Desktop, just click here Heatmap Maker. Once in the HeatmapMaker main folder, double click on the Heatmap-Maker.Rproj file:

And type in the R console (you need devtools package):

devtools::laod_all(".")

then:

HeatmapMaker()

As a package

Install the app as a package with the next code:

devtools::install_github("jpch26/Heatmap-Maker")

then:

library(HeatmapMaker)

and finally:

HeatmapMaker()

Shinyapps.io

Use the app directly, you do not need R or RStudio, by clicking in the next link:

Heatmap Maker

Probably, this will not be a long term option to use the app because shinyapp.io just allow to publish five apps simultaneously, which also includes some other restrictions. I hope in the future I will able to find a good solution for this (or maybe I will pay for it…).

Data sets

Heatmap Maker accepts TSV, TXT and CSV files. I recommend the next structure for your data (for more clarity presented in a Excel sheet):

At this example, columns (column names in orange) represent an independent variable and rows (row names in blue) represent a dependent variable or response. The above is not exhaustive and will rely on your data, maybe you will have two independent variables.

The only requirement is that your data set follows the “matrix” structure showed in the figure. You can see more examples of data sets in the github repository for this app.

Available colors

The available colors are:

All the used colors in the app are colorblind friendly.

Steps

The first time you open the app, it will display a pre load data set. You can find this data set in the repository for this app, search for it in the sample_data folder as expression_data_1, available in .txt, .tsv, and .csv formats.

The app and the pre load heatmap will look like this:

Upload your data

Just click on upload data and search for your data set:

The plot will be updated automatically to represent your data.

Customize

Customize your heatmap with the different options in the option side bar.

  • X label: Write a label in the x axis.
  • Y label: Write a label in the y axis.
  • Heatmap color: Choose a color palette for the values in your heatmap.
  • Dendrogram: Display, or not, dendrograms in rows and/or columns.
  • Side colors: Put or remove side colors on columns and/or rows.
  • Heatmap row names and Heatmap column names: Put or remove row and column names, respectively. This names will be take directly from your data set.
  • Adjust x label and Adjust y label: Adjust the position of x and y labels, respectively.
  • Adjust column name size and Adjust row name size: Adjust sizes for row and column names.

Download

Be sure to write a good name for your plot, choose a format, and finally click on Download Heatmap.

Your image will be located in your downloads directory.

GitHub Repository

If you want to check out the repository for this app just click on:

Heatmap Maker Repository

This repository includes data sets that you can use to explore the app features, check out the sample_data directory.

 

Thank you so much for your time and visit this site.

Juan Pablo Carreón Hidalgo 🤓


https://twitter.com/JuanPa2601

The text on this tutorial is under Creative Commons Attribution 4.0 International License.

CC BY 4.0

Heatmap Maker is under GNU General Public License v3.0

To leave a comment for the author, please follow the link and comment on their blog: R in the Lab.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)