I am trying to create to circos plot using the circlize
package in R. I want the labels on the first two sectors to be bending inside (facing = "bending.inside")
and those on the remaining sectors to be pointing outwards in the clockwise direction (facing = "clockwise")
. From the vignette, it looks like only a single parameter can be specified in the facing
argument. Is there a way to assign different label directions for different sectors? Please help.
Here’s a part of the code that I used to specify the direction of the labels:
<code>library(grid)
library(gridBase)
library(ComplexHeatmap)
circos.trackPlotRegion(track.index = 1,
panel.fun = function(x, y) {
xlim = get.cell.meta.data("xlim")
ylim = get.cell.meta.data("ylim")
sector.name = get.cell.meta.data("sector.index")
circos.text(CELL_META$xcenter,
ylim[1] + cm_h(25),
sector.name,
facing = "clockwise",
niceFacing = TRUE,
adj = c(0, 0.5),
cex = 1.8)
}, bg.border = NA)
</code>
<code>library(grid)
library(gridBase)
library(ComplexHeatmap)
circos.trackPlotRegion(track.index = 1,
panel.fun = function(x, y) {
xlim = get.cell.meta.data("xlim")
ylim = get.cell.meta.data("ylim")
sector.name = get.cell.meta.data("sector.index")
circos.text(CELL_META$xcenter,
ylim[1] + cm_h(25),
sector.name,
facing = "clockwise",
niceFacing = TRUE,
adj = c(0, 0.5),
cex = 1.8)
}, bg.border = NA)
</code>
library(grid)
library(gridBase)
library(ComplexHeatmap)
circos.trackPlotRegion(track.index = 1,
panel.fun = function(x, y) {
xlim = get.cell.meta.data("xlim")
ylim = get.cell.meta.data("ylim")
sector.name = get.cell.meta.data("sector.index")
circos.text(CELL_META$xcenter,
ylim[1] + cm_h(25),
sector.name,
facing = "clockwise",
niceFacing = TRUE,
adj = c(0, 0.5),
cex = 1.8)
}, bg.border = NA)