Description Usage Arguments Details References Examples
Draw rectangle-like grid, specifically for genomic graphics
1 2 3 4 5  | circos.genomicRect(region, value = NULL,
    ytop = NULL, ybottom = NULL, ytop.column = NULL, ybottom.column = NULL,
    sector.index = get.cell.meta.data("sector.index"),
    track.index = get.cell.meta.data("track.index"), posTransform = NULL,
    col = NA, border = "black", lty = par("lty"), ...)
 | 
region | 
 A data frame contains 2 column which correspond to start position and end position  | 
value | 
 A data frame contains values and other information  | 
ytop | 
 A vector or a single value indicating top position of rectangles  | 
ybottom | 
 A vector or a single value indicating bottom position of rectangles  | 
ytop.column | 
 If   | 
ybottom.column | 
 If   | 
sector.index | 
 Pass to   | 
track.index | 
 Pass to   | 
posTransform | 
 Self-defined function to transform genomic positions, see   | 
col | 
 The length of   | 
border | 
 Settings are similar as   | 
lty | 
 Settings are similar as   | 
... | 
 Mysterious parameters  | 
The function is a low-level graphical function and usually is put in panel.fun when using circos.genomicTrackPlotRegion.
Gu, Z. (2014) circlize implements and enhances circular visualization in R. Bioinformatics.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84  | ## Not run: 
############################
### rect matrix
circos.par("track.height" = 0.1, cell.padding = c(0, 0, 0, 0))
circos.initializeWithIdeogram(plotType = NULL)
bed = generateRandomBed(nr = 100, nc = 4)
circos.genomicTrackPlotRegion(bed, stack = TRUE, panel.fun = function(region, value, ...) {
    circos.genomicRect(region, value, col = sample(1:10, nrow(region), replace = TRUE), 
        border = NA, ...)
    i = getI(...)
    cell.xlim = get.cell.meta.data("cell.xlim")
    #circos.lines(cell.xlim, c(i, i), lty = 2, col = "#00000040")
}, bg.border = NA)
circos.genomicPosTransformLines(bed, posTransform = posTransform.default,
    horizontalLine = "top")
circos.genomicTrackPlotRegion(bed, stack = TRUE, panel.fun = function(region, value, ...) {
    circos.genomicRect(region, value, col = sample(1:10, nrow(region), replace = TRUE), 
        border = NA, posTransform = posTransform.default, ...)
    i = getI(...)
    cell.xlim = get.cell.meta.data("cell.xlim")
    #circos.lines(cell.xlim, c(i, i), lty = 2, col = "#00000040")
}, bg.border = NA)
circos.genomicPosTransformLines(bed, posTransform = posTransform.default,
    direction = "outside", horizontalLine = "bottom")
circos.genomicTrackPlotRegion(bed, stack = TRUE, panel.fun = function(region, value, ...) {
    circos.genomicRect(region, value, col = sample(1:10, nrow(region), replace = TRUE), 
        border = NA, ...)
    i = getI(...)
    cell.xlim = get.cell.meta.data("cell.xlim")
    #circos.lines(cell.xlim, c(i, i), lty = 2, col = "#00000040")
}, bg.border = NA)
circos.clear()
##########################
### rect from bed list
circos.par("track.height" = 0.1, cell.padding = c(0, 0, 0, 0))
circos.initializeWithIdeogram(plotType = NULL)
bed1 = generateRandomBed(nr = 100)
bed2 = generateRandomBed(nr = 100)
bed_list = list(bed1, bed2)
f = colorRamp2(breaks = c(-1, 0, 1), colors = c("green", "black", "red"))
circos.genomicTrackPlotRegion(bed_list, stack = TRUE,
    panel.fun = function(region, value, ...) {
    
    circos.genomicRect(region, value, col = f(value[[1]]), 
        border = NA, ...)
    i = getI(...)
    cell.xlim = get.cell.meta.data("cell.xlim")
    circos.lines(cell.xlim, c(i, i), lty = 2, col = "#000000")
})
circos.genomicTrackPlotRegion(bed_list, ylim = c(0, 3),
    panel.fun = function(region, value, ...) {
    i = getI(...)
    circos.genomicRect(region, value, ytop = i+0.4, ybottom = i-0.4, col = f(value[[1]]), 
        border = NA, ...)
    
    cell.xlim = get.cell.meta.data("cell.xlim")
    circos.lines(cell.xlim, c(i, i), lty = 2, col = "#000000")
})
circos.genomicTrackPlotRegion(bed1, panel.fun = function(region, value, ...) {
    circos.genomicRect(region, value, col = "red", border = NA, ...)
})
circos.genomicTrackPlotRegion(bed_list, panel.fun = function(region, value, ...) {
    i = getI(...)
    circos.genomicRect(region, value, col = i, border = NA, ...)
})
circos.clear()
## End(Not run)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.