-
整理出這樣的group和表達(dá)譜數(shù)據(jù),其中表達(dá)譜必須是矩陣
- 為熱圖上方的bar賦值
annotation_col = data.frame(Gender = group)
rownames(annotation_col) = colnames(expr_limma)
ann_colors = list(Type = c(F = "#FFA42D", M = "#A9D9DF"))
- 熱圖主程序
pdf("heatmap.pdf",width = 20,height = 60)
pheatmap(expr_limma,cellwidth = 8, cellheight = 1, fontsize = 8,
method="spearman", #計(jì)算gene或sample之間的相關(guān)性的方法,可選"pearson" (default), "kendall", or "spearman"
scale="row", #為基因做scale
cluster_rows=T,#為基因做聚類
cluster_cols=T,#為sample做聚類
color = colorRampPalette(c("navy", "white", "firebrick3"))(20),
show_colnames=F,show_rownames =F,
annotation_col = annotation_col,
annotation_colors = ann_colors,
#treeheight_row = "0",treeheight_col = "0",#不畫樹
border_color = "NA")
dev.off()


