Learn R Programming

circlize (version 0.4.17)

circos.stackedText: Add a stacked text track

Description

Add a stacked text track

Usage

circos.stackedText(sectors, x, text,
    col = par("col"), font = par("font"), cex = par("cex"), family = par("family"),
    bg.border = "black", bg.col = "#FF8080",
    niceFacing = FALSE,
    side = c("outside", "inside"))

Arguments

sectors

A vector of sector names.

x

A vector of x-coordinates.

text

A vector of texts.

bg.border

Background color.

bg.col

Colors for borders.

niceFacing

Current not supported.

side

Side of the track.

col

Text colors.

font

Text fontfaces.

cex

Font sizes.

family

Font families.

Details

The height of the track is not fixed, so you may need to manually adjust the track height.

Examples

Run this code
if (FALSE) {
circos.par$circle.margin = 0.5
circos.par$cell.padding = rep(0, 4)
circos.par$track.margin = rep(0, 2)

circos.initialize(sectors = letters[1:4], xlim = c(0, 1))

sectors = sample(letters[1:4], 40, replace = TRUE)
x = runif(40)
text = sapply(letters[sample(26, 40, replace = TRUE)], function(x) strrep(x, sample(4:6, 1)))
circos.stackedText(sectors, x, text, bg.col = "#EEEEEE")

circos.track(ylim = c(0, 1))
circos.clear()

#### genome plot
circos.par$track.margin = rep(0, 2)
circos.par$cell.padding = rep(0, 4)

circos.initializeWithIdeogram(plotType = NULL)
bed = generateRandomBed(50)
text = sapply(
    letters[sample(26, nrow(bed), replace = TRUE)], 
    function(x) strrep(x, sample(4:6, 1))
)
bed$text = text

circos.stackedText(bed[, 1], bed[, 2], bed$text, cex = 0.7)
circos.genomicIdeogram()
circos.clear()

}

Run the code above in your browser using DataLab