cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
shnias83
Level I

Single legend for Hierarchical clustering heat map

Hi,

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

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Single legend for Hierarchical clustering heat map

Thanks 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.

Chris Kirchberg, M.S.2
Data Scientist, Life Sciences - Global Technical Enablement
JMP Statistical Discovery, LLC. - Denver, CO
Tel: +1-919-531-9927 ▪ Mobile: +1-303-378-7419 ▪ E-mail: chris.kirchberg@jmp.com
www.jmp.com

View solution in original post

17 REPLIES 17
txnelson
Super User

Re: Single legend for Hierarchical clustering heat map

If you select the "Scale Uniformly" check box on the Cell Plot dialog box, you will only get one legend when you select it.

Jim
shnias83
Level I

Re: Single legend for Hierarchical clustering heat map

Thanks 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.

txnelson
Super User

Re: Single legend for Hierarchical clustering heat map

If you Unselect the "Standardize Data" the legend will only have 1 copy displayed

Jim
shnias83
Level I

Re: Single legend for Hierarchical clustering heat map

Yes, 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. 

txnelson
Super User

Re: Single legend for Hierarchical clustering heat map

Treating 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
);
Jim
shnias83
Level I

Re: Single legend for Hierarchical clustering heat map

Thanks Jim

 

I have attached a figure from a paper which has used JMP. I want to replicate that if possible.

Untitled.jpg

Jeff_Perkinson
Community Manager Community Manager

Re: Single legend for Hierarchical clustering heat map

What 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.

Hierarchical Cluster.png

 

 

-Jeff
txnelson
Super User

Re: Single legend for Hierarchical clustering heat map

Jeff,

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

Jim
Jeff_Perkinson
Community Manager Community Manager

Re: Single legend for Hierarchical clustering heat map

Thanks, 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.

Hierarchical Cluster2.png

 

@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?

 

 

-Jeff