This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How can I sort the circular heatmap labels alphabetically in R?

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

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.

0 answers

No answers yet.

Log in to answer this question.