Start "R", and change directory.
To change directory, you can choose the menu "change directory" on "R".
Please set your directory in the folder including your data-text file.
I attached the demo file below.
This file should be used as a tab-text format.
FYI, this demo file includes a series of circadian expressions of plant clock genes, CCA1, LHY, TOC1/PRR1, PRR3, PRR5, PRR7 and PRR9 (data from Edwards KD et al., 2006). You can also see it in our publication (Hanano S and Davis SJ, 2007).
# Open "genefilter" and "gplots" packages. * you need install these packages before you draw the heat-map.
> library(genefilter)
> library(gplots)
# Read data
> data <- read.delim("clockdemo.txt", header=TRUE, row.names=1)
# Draw heatmap with raw data
> heatmap(as.matrix(data), margin=c(4,8), main="Heat Map 1 (Raw Data)")
# Z Score
> data.z <- genescale(data, axis=1, method="Z")
# Heatmap from Z scored data
> heatmap(as.matrix(data.z), margin=c(4,8), main="Heat Map 2 (Z score Data)")
# Heatmap from Z scored data, with red-green color, and without column change.
> heatmap.2(as.matrix(data.z), col=greenred(75), scale="none", key=TRUE, symkey=FALSE, density.info="none", trace="none", cexRow=1, margin=c(4,8), main="Heat Map 2 (Z score Data)", Colv=NA)
# Please ignore the "warning".
Warning message:
In heatmap.2(as.matrix(data.z), col = greenred(75), scale = "none", :
Discrepancy: Colv is FALSE, while dendrogram is `row'. Omitting column dendogram.
#
I referred to the following site.
だれでもできるマイクロアレイ解析
http://blogs.yahoo.co.jp/doshiroutomicroarray
P.S.
If you use 'col = cm.colors(100)' instead of col = greenred(75), you can use CM colors.
> heatmap.2(as.matrix(data.z), col = cm.colors(100), scale="none", key=TRUE, symkey=FALSE, density.info="none", trace="none", cexRow=1, margin=c(4,8), main="Heat Map 2 (Z score Data)", Colv=NA)