How to keep ComplexHeatmap from reordering annotations
0
0
Entering edit mode
10 months ago
Manuel ▴ 10

I am using complex heatmap to plot a gene alteration matrix with a dendrogram on top but, below the dendrogram I want to have a color map with the diseases that each patient has:

column_ha = HeatmapAnnotation(Disease = Clinical_data$Disease ) Heatmap(t(gene_matrix), name = "Altered", cluster_columns = dend)

When I plot column_ha, the order of the diseases is different than the order of the disease on the heatmap. Even when I add on the Heatmap the option column_dend_reorder=FALSE... Is there any way to keep the order of the annotations fixed, the same as Clinical_data$Disease?

annotation inside heatmap annotation plotted outside heatmap with "plot(column_ha)"

As you can see the ordering on the disease annotation changes when is plotted inside heatmap or outside. On the bottom image i just plotted plot(column_ha) separately.

Dendrogram HeatmapAnnotations R Heatmap ComplexHeatmap • 468 views
ADD COMMENT

Login before adding your answer.

Traffic: 2620 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6