Notes on Creating Beautiful Heatmaps in R

By |2018-08-31T12:20:23-04:00August 31st, 2018|Categories: Note笔记|Tags: , , |

Date: 2017/04/16 source: http://math.usu.edu/jrstevens/stat5570/2.3.Clustering.pdf # Heatmap Trial library(cluster) library(RColorBrewer) set.seed(123) x1 <- c(rnorm(20,sd=.05), rnorm(20,mean=1,sd=.05), rnorm(20,mean=1.5,sd=.05)) x2 <- 4+c(rnorm(20,sd=2), rnorm(20,mean=8,sd=1.5), rnorm(20,mean=8,sd=1)) x1.sc <- x1/sd(x1) x2.sc <- x2/sd(x2) hmcol <- colorRampPalette(brewer.pal(10,"RdBu"))(256) csc <- c(hmcol[50],hmcol[200]) # define side colors heatmap(cbind(x1.sc,x2.sc),scale="column",col=hmcol, ColSideColors=csc,cexCol=1.5,cexRow=.5) # ---- try with ALL datasets source("http://bioconductor.org/biocLite.R") biocLite(c('affy', 'ALL')) # download packages library(affy); library(ALL); data(ALL) gn <- featureNames(ALL) [...]