Entering edit mode
4.0 years ago
kbaitsi
•
0
data <- read.table("third.txt", sep = "\t", header = TRUE, row.names = 1)
data_matrix <- as.matrix(data)
colnames(data_matrix) <- c("473", "477", "474", "480", "481", "475", "479", "478", "495", "503", "499", "502", "494", "497", "496", "500")
heatmap(data_matrix)
library("RColorBrewer")
colr <- colorRampPalette(brewer.pal(8, "BuPu"))(256)
heatmap(data_matrix, scale = "column", col = colr, labRow = NA, cexCol = 0.75, margins = c(5, 2), xlab = "Data Samples", ylab = "gene expressions", main = "Differentially expressed genes")
I have written the code above and it produces the following heatmap. I also want to colour the name of the data samples with two different colours or draw a line to seperate the two clusters. Is there any way I could do that?