Single legend for Hierarchical clustering heat mapHi,
Thanks in advance for the support!
I'm making a Heatmap using 'two way clustering' in the hierarchical cluster. When I add the legend to the figure, it gives me one legend per column. I would like to have only one legend (color code) for the whole heatmap. I appreciate your guidance on that.
Shahram
Re: Single legend for Hierarchical clustering heat mapHI, has this been resolved? I have the same question and could not find the solution in the thread.
Cheers,
Andreas
Re: Single legend for Hierarchical clustering heat mapThanks for the response. Sorry for the confusion, I was refering to the graphic from the journal you shared for fold changes.
You essentially have standarized data already. Standardize Data takes each Y (Column) and subtracts the column mean and divides by the column standard deviation (see below link).
http://www.jmp.com/support/help/13-2/Transformations_to_Y_Columns_Variables.shtml
Since you have normalized RNA-seq results in the same units, then definately uncheck standardize data since they all have the same scale (meaning) per sample for each gene (Y Column) . I am guessing that the normalized FPKM values are also log2 tranformed? You would then have over and under represented genes displayed as postive and negative, respectively, on the scale
I hope that helps.
Chris.
Re: Single legend for Hierarchical clustering heat mapThanks Chris
The data that are used to make the graphs is RNA-seq results. There are two experimental conditions (FG and SG) which are the two horizontal clusters. And there are two main vertical clusters of each consist of 30 genes (extreme up- and down-regulated). Each cell should contain the expression level of each gene in one individual/sample (There are 10 samples here: 5 FG + 5 SG). The cell content/expression are all in FPKM which is already a normalized expression level and can be compared across genes and samples. Therefore, unit is the same for all the cell I guess. However, I can't understand how we can put the 'Fold Change' in the those cells. As far as I know, Fold Change is calculated by comparing two things. I'm not sure how Fold Change could be calculated for expression of ONE gene in ONE sample.
Re: Single legend for Hierarchical clustering heat mapHi,
To make a quick note about this graphic posted. The data used is already standardized (fold change) and thus was probably made by turning off the Standardize Data. All of the columns used for "Y" and are now on the top (or bottom) of the heatmap have the same units of measuremeant and mean the same thing (fold change) so they are directly compariable.
Do you have something similar where each column is in the same units and range of measurement?
Chris
Re: Single legend for Hierarchical clustering heat mapThanks guys for your support!
I have attached both figures (standardized and non-standardized) to see the differences between them.
I'm using JMP 13.2.1 (32-bit).
Jeff, That's true. Each legend is a color code for each column. So if I want a standardized figure, I can't get a single legend.
Maybe, I just use the standardized heatmap with the legend from the non-standardized heatmap together. In that case, I will have the figure that I want with a single legend which contains the whole range of the color codes. It might not look proffessional though, but I think that's what people do!
Thanks.


Re: Single legend for Hierarchical clustering heat mapThanks guys for your support!
I have attached both pictures (standardized and non-standardized) to see the differences.
I'm using the JMP 13.2.1 (32-bit).
Jeff,
That's true each legend is a color code for each column which make sense.
Maybe I just use the legend of the non-standardized figure with the figure itself from standardized one together.
In that case, I get the figure that I want plus a single legend which indicates all the cell colors.
Re: Single legend for Hierarchical clustering heat mapThanks, Jim. I'm going to blame that on Monday morning fog in my brain.
Yes, if I turn on Standardize Data in the Clustering launch dialog and get a Color Map and a Legend then I get this with the Cereal data.

@shnias83, notice that I have to have multiple legends because the colors mean different things for each column because the data has been standardized. You said that you want the standardization because it gives you the analysis and visualization you need. What legend would you use since the colors have different values for each column?
Re: Single legend for Hierarchical clustering heat mapJeff,
To see the multiple legends, take the script that I included above, using the Drosophila Aging Distances data, but remove the For loop that deletes the multiple legends.
JIm
Re: Single legend for Hierarchical clustering heat mapWhat version of JMP are you using?
I'm having difficulty visualizing the multiple legends that you're getting.
Can you share a picture of what you're getting?
If not, can you reproduce the situation with one of the sample data sets (Help->Sample Data and search for "Cluster")?
Here's what I can get with the Cereal data.

Re: Single legend for Hierarchical clustering heat mapThanks Jim
I have attached a figure from a paper which has used JMP. I want to replicate that if possible.

Re: Single legend for Hierarchical clustering heat mapTreating your data a Distance Matrix, will also result in a common legend. The multiple legends are being displayed, because every column has a different range, thus a separate legend. If you just want to get rid of all of the legends except one, the code below will illustrate how to do that....but I am not sure that is what you want to do.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Drosophila Aging Distances.jmp" );
hc = Hierarchical Cluster(
Y(
:ORE_FEMALE_WK1_1,
:ORE_FEMALE_WK1_2,
:ORE_FEMALE_WK1_11,
:ORE_FEMALE_WK1_12,
:ORE_FEMALE_WK1_21,
:ORE_FEMALE_WK1_24,
:ORE_FEMALE_WK6_1,
:ORE_FEMALE_WK6_2,
:ORE_FEMALE_WK6_11,
:ORE_FEMALE_WK6_12,
:ORE_FEMALE_WK6_21,
:ORE_FEMALE_WK6_24,
:ORE_MALE_WK1_3,
:ORE_MALE_WK1_4,
:ORE_MALE_WK1_9,
:ORE_MALE_WK1_10,
:ORE_MALE_WK1_19,
:ORE_MALE_WK1_20,
:ORE_MALE_WK6_3,
:ORE_MALE_WK6_4,
:ORE_MALE_WK6_9,
:ORE_MALE_WK6_10,
:ORE_MALE_WK6_19,
:ORE_MALE_WK6_20,
:SAM_FEMALE_WK1_7,
:SAM_FEMALE_WK1_8,
:SAM_FEMALE_WK1_15,
:SAM_FEMALE_WK1_16,
:SAM_FEMALE_WK1_22,
:SAM_FEMALE_WK1_23,
:SAM_FEMALE_WK6_7,
:SAM_FEMALE_WK6_8,
:SAM_FEMALE_WK6_15,
:SAM_FEMALE_WK6_16,
:SAM_FEMALE_WK6_22,
:SAM_FEMALE_WK6_23,
:SAM_MALE_WK1_5,
:SAM_MALE_WK1_6,
:SAM_MALE_WK1_13,
:SAM_MALE_WK1_14,
:SAM_MALE_WK1_17,
:SAM_MALE_WK1_18,
:SAM_MALE_WK6_5,
:SAM_MALE_WK6_6,
:SAM_MALE_WK6_13,
:SAM_MALE_WK6_14,
:SAM_MALE_WK6_17,
:SAM_MALE_WK6_18
),
Label( :Observation ID ),
Method( "Ward" ),
Standardize Data( 1 ),
Legend( 1 ),
Dendrogram Scale( "Distance Scale" ),
Number of Clusters( 5 ),
Color Map( "Blue to Gray to Red" ),
SendToReport( Dispatch( {}, "Dendrogram", OutlineBox, {SetHorizontal( 1 )} ) )
);
For( i = 48, i > 1, i--,
Report( hc )[Table Box( i )] << delete
);
Re: Single legend for Hierarchical clustering heat mapYes, that's correct.
However, unselecting 'Standardize Data' will change the clutering pattern and column ordering. So I will get a different heatmap which dosen't convey my mesage clearly.
Re: Single legend for Hierarchical clustering heat mapIf you Unselect the "Standardize Data" the legend will only have 1 copy displayed
Re: Single legend for Hierarchical clustering heat mapThanks for the reply.
I'm not using Cell Plot though.
As I want a heatmap combined with a dendrogram, I'm doing a cluster analysis through: Alnalyze > Clustering > Hierarchical cluster.
There's no such an option, Scale Uniformly, in the clustering dialog.
Re: Single legend for Hierarchical clustering heat mapIf you select the "Scale Uniformly" check box on the Cell Plot dialog box, you will only get one legend when you select it.
Re: Single legend for Hierarchical clustering heat map@Jeff_Perkinson what does the lower graph show in the above cluster. I could not find the explanation.
Thanks in advance.
Re: Single legend for Hierarchical clustering heat maphi Chris,
I have a follow up question. If I already know the cluster results, say, using other clustering methods.
Can I generate a two-way cluster plot in JMP?
I guess it will be a simplified version, without the tree breaks to each column/rows, rather trucks into clusters.
Let me know if you have a quick advice for this?
Thanks very much.
Regards
Caroline