How can I reorder row clusters using complexheatmap
1
0
Entering edit mode
4.8 years ago
smyiz ▴ 30

I want to change order of clusters on the heatmap using Complex Heatmap package and I used pearson distance method and average method. When I cut the row dendrogram, cluster order is 1,3,2,4. How can I change it to this order :2,1,3,4

      clusters = dendextend::cutree(hx, k = 4)
      col_fun = colorRamp2(c(-2, 0, 2), c("blue", "white", "red"))
      split <- factordim.cl$clusters, levels =c(2,1,3,4))

      Heatmap(z, split = split, show_row_names = FALSE, name = "log2(FC)", col = col_fun)
R complexheatmap • 7.8k views
ADD COMMENT
2
Entering edit mode
4.8 years ago

Ready made solution for you: A: Complex Heatmap: Changing order of clusters

Kevin

ADD COMMENT
2
Entering edit mode

the problem is solved. just need to add this parameter:

cluster_row_slices = FALSE

ADD REPLY
0
Entering edit mode

Yep, please also see the manual, it is outstandingly comprehensive.

ADD REPLY

Login before adding your answer.

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