R09

2021-12-10  本文已影响0人  rong酱

热图

library(pheatmap)

bk <- c(seq(-1,-0.01,by=0.01),seq(0,1,by=0.01))
mycolor <- c(colorRampPalette(colors=c("navy","white"))(length(bk)/2),colorRampPalette(color=c("white","firebrick3"))(length(bk)/2))

r <- read.table('4sample_readcount_new.matrix',sep="\t",row.names=1,header=T)
rdata <- as.data.frame(r)
rdata <- rdata[apply(r, 1, function(x) sd(x)!=0),]
dpi=2500
png('heatmap_1210.png',w=12*dpi,h=10*dpi,units = "px",res = dpi,type='cairo')
pheatmap(rdata,scale = "row", cellwidth = 20, cellheight = 0.5,cluster_cols = F,cluster_rows = T,treeheight_row=0, treeheight_col=0,show_rownames=T, color=mycolor,fontsize = 0.5,fontsize_col=12, breaks=bk,legend=F)
dev.off()

要求高帮助我成长

上一篇下一篇

猜你喜欢

热点阅读