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