pheatmap column cluster annotation

977 Views Asked by At

I have following code for the heat map generation using "pheatmap" package. I am successful creating heat map but having very hard time to annotate the column. I have 9 cell types and each cell type has 3 replicates.

Here is the data. I have labeled samples as 01_01,01_02,01_03 to 09_01, 09_02,09_03.

I would like to have column annotation as "A", "B", "C", "D","E", "F", "G", "H", "I". pheatmap with clustering row and column

I tried my best to annotate cluster column but wasn't successful. I really appreciate if someone can explain how to do customize column annotation.

Data: my data file

library(readxl)
library(pheatmap)
library(tibble)
library(dplyr)

read file

test<-read_excel("~test.xlsx",1)

test%>% 
   column_to_rownames("Metabolite") %>%
   as.data.frame()

test<-as.data.frame(test)
rownames(test)<-test$Metabolite
test$Metabolite<-NULL


    pheatmap(test,cluster_rows=TRUE,cluster_cols=TRUE,breaks=NA,scale="none",legend=TRUE,color=colorRampPalette(c("navy","white","firebrick3"))(50),margins=c(5,10),fontsize_row=4,fontsize_col=4,cellwidth=5,cellheight=5)
0

There are 0 best solutions below