2007-09-26

Heatmap is so pretty and vivid.. XD

Don't just try heatmap..There are more options such as heatmap.2 from gplots package, and heatmap_2 from Heatplus package.
Both heatmap.2 and heatmap_2 can show the bar of color code for arbitrary unit (color key ); in addition to that, heatmap_2 can repress the dendrogram for rows (but unable to suppress the clustering) and show different colors for dendrogram of columns based on their clusters.
Don't worry about the data format! They "eat" the same format of data, meaning what heatmap can load is good for heatmap.2 & heatmap_2 too.
Some miscellaneous setup just for pretty look
1) color pattern
Color palette can be easily assigned by using col=ColorPattern.
Here are some internal/pre-defined color palettes:
heat.colors(n), topo.colors(n), redgreen(n) and cm.colors(n)
Change (n) to set up how many levels you want in the color gradient
rev(): reverse the color pattern, for example rev(redgreen(100)) will get a gradient from green to red instead of the one from red to green.

2) color-stripe for specific group of sample
scol=c(...) is a vector with the length equaling to the number of your column.
Just assign the color you want in th vector, like c("red","red","skyblue","skyblue") for a 4-coulmned dataset.
3) scaling
scaling="row", "col", "none"; although keeping this option ON usually makes the heatmap pretty, I thought turning it OFF can help us have an ideal how many genes is in relatively low expression levels.

No comments: