Question: How can I reorder row clusters using complexheatmap
0
gravatar for smyiz
5 months ago by
smyiz20
smyiz20 wrote:

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)
complexheatmap R • 491 views
ADD COMMENTlink modified 5 months ago by Kevin Blighe52k • written 5 months ago by smyiz20
2
gravatar for Kevin Blighe
5 months ago by
Kevin Blighe52k
Kevin Blighe52k wrote:

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

Kevin

ADD COMMENTlink written 5 months ago by Kevin Blighe52k
2

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

cluster_row_slices = FALSE

ADD REPLYlink written 5 months ago by smyiz20

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

ADD REPLYlink written 5 months ago by ATpoint26k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 833 users visited in the last hour