How to reorder the column of the heatmap following the cluster annotation?
0
0
Entering edit mode
3.9 years ago

Annotation:

ha = HeatmapAnnotation(IntCl = info2$groups,

                   CNAcorCl = info$groups,

                   METcorCl = info1$groups,

                   col = list(IntCl = c("1" = "turquoise", "2" = "pink"),

                              CNAcorCl = c("1" = "turquoise", "2" = "pink"),

                              METcorCl = c("1" = "turquoise", "2" = "pink")),

                   which="col")
  

and I plot the heatmap

set.seed(5342)

Heatmap(test , name = "expression levels",

    show_row_names = FALSE, 

    show_column_names = FALSE,

    cluster_rows = FALSE, 

    cluster_columns = FALSE,

    show_row_dend = FALSE,

    show_column_dend=FALSE,

    row_dend_reorder = FALSE, 

    column_dend_reorder = FALSE,

    row_title = "566 CNAcor", 

    row_title_side = "left", 

    row_title_gp = gpar(fontsize = 10),

    column_title = "208 patients", 

    column_title_side = "bottom",

    column_title_gp = gpar(fontsize = 10),

    top_annotation = ha)
  

The problem is that I want the order of the column of the heatmap to abide by the order of cluster IntCl (i.e., info2$groups). I try a lot but can not solve it.

Figure

ComplexHeatmap heatmap order • 7.3k views
ADD COMMENT
0
Entering edit mode

Thanks a a lot. This is the answer I'm looking for.

ADD REPLY

Login before adding your answer.

Traffic: 2433 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