Question: How to order columns of heatmap as they are in matrix data
1
gravatar for Mehmet
2.9 years ago by
Mehmet600
Japan
Mehmet600 wrote:

Dear All,

I made a complex heatmap using complexheatmap package of R. I want to order columns of the heatmap based on order in my matrix data.

Any idea?

this is heatmap command I run:

hmap <- Heatmap(heat, name="Z-score",col=colorRamp2(myBreaks, myCol), column_order = samplesnames, cluster_columns = FALSE, heatmap_legend_param=list(color_bar="continuous", legend_direction="horizontal", legend_width=unit(3,"cm"), title_position="topcenter", title_gp=gpar(fontsize=10, fontface="bold")), split=df$EffectorName, cluster_rows=TRUE, show_row_dend=TRUE, row_title="Transcript", row_title_side="left", row_title_gp=gpar(fontsize=5, fontface="bold"), show_row_names=TRUE, row_names_side="left", row_title_rot=0,  show_column_dend=TRUE, column_title="Samples", column_title_side="top", column_title_gp=gpar(fontsize=10, fontface="bold"), column_title_rot=0, show_column_names=TRUE, clustering_distance_columns=function(x) as.dist(1-cor(t(x))), clustering_method_columns="ward.D2", column_dend_height=unit(5,"mm"), clustering_distance_rows="euclidean", clustering_method_rows="ward.D2", row_dend_width=unit(5,"mm"), top_annotation_height=unit(0.5,"cm"), top_annotation=ColAnn, bottom_annotation_height=unit(1, "cm"), bottom_annotation=boxAnnCol)
rna-seq R • 7.3k views
ADD COMMENTlink modified 2.9 years ago • written 2.9 years ago by Mehmet600

This is a continuation of the discussion, here: C: Heatmap based with FPKM values (the discussion became too long and off topic).

Mehmet, can you please again paste a sample of your data and the Heatmap() command that you are using so that everyone else can see. The ordering functions that I mention do work, as I use them a lot, but there must be some problem with your data and/or the way that you are executing the Heatmap() function.

When you paste your data, make sure that it looks presentable to others!

Thanks.

ADD REPLYlink modified 2.9 years ago • written 2.9 years ago by Kevin Blighe66k

I don't know how to paste data as it is readable. Please follow the previous topic (Heatmap based with FPKM values).

ADD REPLYlink written 2.9 years ago by Mehmet600

Hi Kevin,

Now it is okay, I figured it out.

Here is my command:

hmap <- Heatmap(heat, name="Z-score",col=colorRamp2(myBreaks, myCol), cluster_columns = FALSE, heatmap_legend_param=list(color_bar="continuous", legend_direction="horizontal", legend_width=unit(3,"cm"), title_position="topcenter", title_gp=gpar(fontsize=10, fontface="bold")), split=df$EffectorName, cluster_rows=TRUE, show_row_dend=TRUE, row_title="Transcript", row_title_side="left", row_title_gp=gpar(fontsize=5, fontface="bold"), show_row_names=TRUE, row_names_side="left", row_title_rot=0,  show_column_dend=TRUE, column_title="Samples", column_title_side="top", column_title_gp=gpar(fontsize=10, fontface="bold"), column_title_rot=0, show_column_names=TRUE, clustering_distance_columns=function(x) as.dist(1-cor(t(x))), clustering_method_columns="ward.D2", column_dend_height=unit(5,"mm"), clustering_distance_rows="euclidean", clustering_method_rows="ward.D2", row_dend_width=unit(5,"mm"), top_annotation_height=unit(0.5,"cm"), top_annotation=ColAnn, bottom_annotation_height=unit(1, "cm"), bottom_annotation=boxAnnCol)

Thank you very very very much......

ADD REPLYlink written 2.9 years ago by Mehmet600
1

Glad that you got it working! Now you see why it is called 'complex' heatmap! :)

ADD REPLYlink written 2.9 years ago by Kevin Blighe66k
2
gravatar for said3427
2.9 years ago by
said342790
Mexico
said342790 wrote:
Heatmap(matrix_data, cluster_columns = FALSE)
ADD COMMENTlink written 2.9 years ago by said342790

It worked perfectly.

ADD REPLYlink written 22 months ago by SmallChess530
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2299 users visited in the last hour