Learn R Programming

circlize (version 0.4.10)

circos.genomicLines: Add lines to a plotting region, specifically for genomic graphics

Description

Add lines to a plotting region, specifically for genomic graphics

Usage

circos.genomicLines(
    region,
    value,
    numeric.column = NULL,
    sector.index = get.cell.meta.data("sector.index"),
    track.index = get.cell.meta.data("track.index"),
    posTransform = NULL,
    col = ifelse(area, "grey", "black"),
    lwd = par("lwd"),
    lty = par("lty"),
    type = "l",
    area = FALSE,
    area.baseline = NULL,
    border = "black",
    baseline = "bottom",
    pt.col = par("col"),
    cex = par("cex"),
    pch = par("pch"),
    ...)

Arguments

region

A data frame contains 2 column which correspond to start position and end position

value

A data frame contains values and other information

numeric.column

Which column in value data frame should be taken as y-value. If it is not defined, the whole numeric columns in value will be taken.

sector.index

Pass to circos.lines

track.index

Pass to circos.lines

posTransform

Self-defined function to transform genomic positions, see posTransform.default for explaination

col

col of lines/areas. If there are more than one numeric column, the length of col can be either one or number of numeric columns. If there is only one numeric column and type is either segment or h, the length of col can be either one or number of rows of region. pass to circos.lines

lwd

Settings are similar as col. Pass to circos.lines

lty

Settings are similar as col. Pass to circos.lines

type

There is an additional option segment which plot segment lines from start position to end position. Settings are similar as col. Pass to circos.lines.

area

Settings are similar as col. Pass to circos.lines

area.baseline

Deprecated, use baseline instead.

baseline

Settings are similar as col. Pass to circos.lines

border

Settings are similar as col. Pass to circos.lines

pt.col

Settings are similar as col. Pass to circos.lines

cex

Settings are similar as col. Pass to circos.lines

pch

Settings are similar as col. Pass to circos.lines

...

mysterious parameters

Details

The function is a low-level graphical function and usually is put in panel.fun when using circos.genomicTrackPlotRegion.

Examples

Run this code
# NOT RUN {
### test bed
circos.par("track.height" = 0.1)
circos.initializeWithIdeogram(plotType = NULL)

bed = generateRandomBed(nr = 100)
circos.genomicTrackPlotRegion(bed, panel.fun = function(region, value, ...) {
    circos.genomicLines(region, value, type = "l", ...)
})

bed1 = generateRandomBed(nr = 100)
bed2 = generateRandomBed(nr = 100)
bed_list = list(bed1, bed2)

circos.genomicTrackPlotRegion(bed_list, panel.fun = function(region, value, ...) {
    i = getI(...)
    circos.genomicLines(region, value, col = i, ...)
})

circos.genomicTrackPlotRegion(bed_list, stack = TRUE, 
    panel.fun = function(region, value, ...) {
    i = getI(...)
    circos.genomicLines(region, value, col = i, ...)
})

bed = generateRandomBed(nr = 100, nc = 4)
circos.genomicTrackPlotRegion(bed, panel.fun = function(region, value, ...) {
    circos.genomicLines(region, value, col = 1:4, ...)
})

circos.genomicTrackPlotRegion(bed, stack = TRUE, panel.fun = function(region, value, ...) {
    i = getI(...)
    circos.genomicLines(region, value, col = i, ...)
})

bed = generateRandomBed(nr = 100)
circos.genomicTrackPlotRegion(bed, panel.fun = function(region, value, ...) {
    circos.genomicLines(region, value, type = "segment", lwd = 2, ...)
})

circos.clear()
# }

Run the code above in your browser using DataLab