R语言---热图的制作

>install.packages("gplots")

> library("gplots")
> p <- data.frame(read.table("test.txt",header = T, sep="\t"))
> row.names(p) <- p$gene
> p <- p[,2:21]
> p_matrix<- data.matrix(p)

> heatmap(p_matrix, Rowv=NA, Colv=NA, col=cm.colors(256), revC=FALSE, scale='column')

对数据进行cluster:
> heatmap.2(p_matrix, col=colorpanel(100,low="yellow",high="red"), , scale="none",key=TRUE, keysize=1,symkey=FALSE, density.info="none", trace="none", cexRow=0.5)

对y轴进行数据进行cluster:
> heatmap.2(p_matrix, Colv=NA,col=colorpanel(100,low="yellow",high="red"), , scale="none",key=TRUE, keysize=1,symkey=FALSE, density.info="none", trace="none", cexRow=0.5)

对x轴进行数据进行cluster:

> heatmap.2(p_matrix, Rowv=NA,col=colorpanel(100,low="yellow",high="red"), , scale="none",key=TRUE, keysize=1,symkey=FALSE, density.info="none", trace="none", cexRow=0.5)

参考:http://www2.warwick.ac.uk/fac/sci/moac/people/students/peter_cock/r/heatmap

posted on 2013-11-08 17:04  原生態  阅读(1533)  评论(0编辑  收藏  举报