Entering edit mode
5.4 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)
the problem is solved. just need to add this parameter:
cluster_row_slices = FALSE
Yep, please also see the manual, it is outstandingly comprehensive.