code如下:
setwd('C:/Users/Administrator/Desktop/LSM测序总结/heatmap')
rm(list = ls())
library(pheatmap)
library(RColorBrewer)
data <- read.csv(file = "deg_heatmap.csv",header = T,sep = ",")
data1 <- data
rownames(data1) <- data[,1]
data1 <- data1[,-1]
exprSet <- data1
qx <- as.numeric(quantile(exprSet, c(0., 0.25, 0.5, 0.75, 0.99, 1.0), na.rm=T))
LogC <- (qx[5] > 100) ||
(qx[6]-qx[1] > 50 && qx[2] > 0) ||
(qx[2] > 0 && qx[2] < 1 && qx[4] > 1 && qx[4] < 2)
LogC
exprSet <- log2(exprSet[,]+1)
pheatmap(exprSet)
##plot[AU]
my_col<-colorRampPalette(c(c("#481467","#2e6f8e","#1fa088","#6ccd5a","#e7e419")))(100)
## my_col<-colorRampPalette(rev(brewer.pal(n = 9, name = "YlGn")))(100)
pheatmap(exprSet,scale = "row",cluster_cols=F,cluster_rows=F,show_rownames = F, color = my_col,cellwidth =15,
cellheight =0.5, legend = T, fontsize = 8, border_color = 8,show_colnames=T)
记得点赞收藏哦~
网友评论