Thread Subject: CLustergram for heatmap in MATALB

Subject: CLustergram for heatmap in MATALB

From: Young1

Date: 25 Nov, 2009 01:05:26

Message: 1 of 3

I am trying to use the clustergram command of MATLAB to plot a heat map of a set of data stored in a matrix X. The default colormap is redgreencmap, in which red represents values above the mean, black represents the mean, and green represents values below the mean of a row (gene) across all columns (samples).However, I want to assign these colors not based on the mean of each row, but based on if they are greater than or less than zero, i.e.:
red: if the values are greater than zero
green: if the values are less than zero
black: if the value is zero.
(The mean can be anything)
Is there any way of doing that?
Thanks

Subject: CLustergram for heatmap in MATALB

From: Darren Rowland

Date: 25 Nov, 2009 02:10:17

Message: 2 of 3

I don't think many of us here will be familiar with clustergrams, given that they are part of the bioinformatics toolbox. However is it possible for you to simply compute the mean yourself, then subtract this from the matrix, then plot the heatmap
i.e. perhaps something like

plot(clustergram(X-repmat(mean(X,2),1,size(X,2))))

Hth
Darren

Subject: CLustergram for heatmap in MATALB

From: Li Yang

Date: 28 Nov, 2009 19:42:06

Message: 3 of 3

Young1 <xgeneral57@gmail.com> wrote in message <1309828473.32039.1259111156945.JavaMail.root@gallium.mathforum.org>...
> I am trying to use the clustergram command of MATLAB to plot a heat map of a set of data stored in a matrix X. The default colormap is redgreencmap, in which red represents values above the mean, black represents the mean, and green represents values below the mean of a row (gene) across all columns (samples).However, I want to assign these colors not based on the mean of each row, but based on if they are greater than or less than zero, i.e.:
> red: if the values are greater than zero
> green: if the values are less than zero
> black: if the value is zero.
> (The mean can be anything)
> Is there any way of doing that?
> Thanks

You can look up the 'Standardize' option in the clustergram function and set the option to 'None' or 3. Also make sure the Symmetric option is set to TRUE. The colormap will be centered around ZERO.

Also if you have Bioinfomatics Toolbox version 3.4 (R2009B), you can use the function HeatMap for your plot, by default the 'Standardize' option is 'None', and without dendrograms.

Thanks,

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com