How can I sort the circular heatmap labels alphabetically in R?
0
0
Entering edit mode
16 months ago
logbio ▴ 30

How can I sort the Circular heatmap labels in alphabetical order?

The codes where I created the circular in my code are as follows:


library(circlize)
col_fun1 = colorRamp2(c(0, 0.000001, 5, 10), c("#FFFFFF", "#91cf60", "#ffffbf", "#fc8d59"))
circos.clear()

pdf(circle.pdf", width = 15, height = 20)

circos.par(gap.after = c(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 8))

circos.track(track.index = get.current.track.index(), panel.fun = function(x, y) {
   if(CELL_META$sector.numeric.index == 11) {
     cn = colnames(cpl)
     n = length(cn)
     circos.text(rep(CELL_META$cell.xlim[2], n) + convert_x(1, "mm"),
                 1:n - 0.5, cn,
                 cex = 0.5, adj = c(0, 0.5), facing = "inside")
   }
}, bg.border = NA)

library(ComplexHeatmap)
lgd = Legend(title = "sepal length", col_fun = col_fun1)
grid.draw(lgd)

dev.off()
circular-heatmap circlize r circos • 589 views
ADD COMMENT
0
Entering edit mode

Please remove unnecessary code, limit it to the relevant parts and try to provide some sort of example data for reproduction. Is is unclear how the heatmap is even supposed to look.

ADD REPLY

Login before adding your answer.

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