AffyBatch draw a heatmap.
hmap.eset(x,probesets,samples=1:length(sampleNames(x)),scluster=standard.pearson,pcluster=standard.pearson,slabs=sampleNames(x)[samples],plabs,col="bwr",min.val=NULL ,max.val=NULL,scale=FALSE,spread=6,by.fc=F,sdev=NULL,show.legend=T,title=NULL,cex=0.5)AffyBatch object to get the expression data from AffyBatch object and plots a heatmap. At its simplest, all that is required is an AffyBatch object (as calculated by call.exprs) and a vector supplying the probesets to plot. These can be specified by name, as an integer index or as a vector of TRUEs and FALSES. The function will try to do something sensible with the labels. If it fails you will need to specify this with plabs. The function will then draw a heatmap, coloured blue-white-red in increasing intensity, scaled so that 100Col can be used to change the colouring. "bwr" specifies blue-white-red, "rbg" specifies red-black-green, and "ryw" specifies red-yellow-white. Alternatively, a vector of arbitrary colours can be supplied (try rainbow(21), for example).
The clustering method can also be changed by supplying, either, a function that takes a matrix of expression values and returns an hclust or dendrogram object, or alternatively, an hclust or dendrogram object itself. Setting either of these to NULL will stop the heatmap being clustered on that axis.
Scaling is somewhat more complex. If scale is TRUE, then each gene is coloured independently, on a scale based on its standard deviation. By default this is calculated for the samples that are being plotted, unless a value is supplied for sdev -- in which case this should be a vector of standard deviations, one for each probeset being plotted (and in the same order). This scaling is done after the clustering. For more details on how all of this works see the website http://bioinf.picr.man.ac.uk/simpleaffy and also look at hmap.pc which uses the scaling to plot transcripts identified as being differentially expressed.
hmap.pc blue.white.red.cols standard.pearson ## Not run:
# eset.mas <- call.exprs(eset,"mas5")
# hmap.eset(eset.mas,1:100,1:6,col="rbg")
# ## End(Not run)
Run the code above in your browser using DataLab