I have the following script for creating a heatmap using Heatmap in Rstudio. Everything looks good, the coloring, dendogram size and location, font size, column annotations (labels), but I can't seem to add row labels.
My data file is tab separated text file, with a header row (column names in Heatmap), and the 1st column has the sample names (I want those to show as row labels in Heatmap)
Here is my script:
source("https://bioconductor.org/biocLite.R")
biocLite("ComplexHeatmap")
library(ComplexHeatmap)
filename <- "Data.txt"
my_data <- read.table(filename, sep ="\t", quote = "", stringsAsFactors =`FALSE,header = TRUE)`
# Make the heatmap data into a matrix
# [all rows, columns 2-13]
# Leave out 1st column (sample names) since they don't not belong in the heatmap
my_matrix <- as.matrix(my_data[ ,c(2:13)])
# Cluster by rows only, not columns
# Increase dendogram width
# Change font size to 0.8
Heatmap(my_matrix, cluster_columns = FALSE,
column_names_gp = gpar(cex=0.8),
row_hclust_width = unit(3, "cm"))
Everything looks great, but there are no row labels on my heatmap (only column labels).