circos.genomicDensity: Calculate and add genomic density track

View source: R/genomic.R

circos.genomicDensityR Documentation

Calculate and add genomic density track

Description

Calculate and add genomic density track

Usage

circos.genomicDensity(
    data,
    ylim.force = FALSE,
    window.size = NULL,
    overlap = TRUE,
    count_by = c("percent", "number"),
    col = ifelse(area, "grey", "black"),
    lwd = par("lwd"),
    lty = par("lty"),
    type = "l",
    area = TRUE,
    area.baseline = NULL,
    baseline = 0,
    border = NA,
    ...)

Arguments

data

A bed-file-like data frame or a list of data frames. If the input is a list of data frames. there will be multiple density plot in one same track.

ylim.force

Whether to force upper bound of ylim to be 1. Ignored if count_by is set to number.

window.size

Pass to genomicDensity.

overlap

Pass to genomicDensity.

count_by

Pass to genomicDensity.

col

Colors. It should be length of one. If data is a list of data frames, the length of col can also be the length of the list. If multiple sets of genomic regions are visualized in one single track, you should set the colors with transparency to distinguish them.

lwd

Width of lines, the same setting as col argument.

lty

Style of lines, the same setting as col argument.

type

Type of lines, see circos.lines.

area

See circos.lines.

area.baseline

Deprecated, use baseline instead.

baseline

See circos.lines.

border

See circos.lines.

...

Pass to circos.trackPlotRegion.

Details

This function is a high-level graphical function, and it will create a new track.

If you have multiple sets of genomic regions, you should make sure the density ranges for all sets are similar, or I suggest you should put them into different tracks. One example can be found in the "Examples" Section where the density range for bed_list[[2]] is too high compared to the range for bed_list[[1]], thus, it is better to put the two sets of regions into two separate tracks.

See Also

https://jokergoo.github.io/circlize_book/book/high-level-genomic-functions.html#genomic-density-and-rainfall-plot

Examples

load(system.file(package = "circlize", "extdata", "DMR.RData"))

# rainfall

circos.initializeWithIdeogram(plotType = c("axis", "labels"))

bed_list = list(DMR_hyper, DMR_hypo)
circos.genomicRainfall(bed_list, pch = 16, cex = 0.4, col = c("#FF000080", "#0000FF80"))

circos.genomicDensity(bed_list[[1]], col = c("#FF000080"), track.height = 0.1)
circos.genomicDensity(bed_list[[2]], col = c("#0000FF80"), track.height = 0.1)
circos.clear()

############ draw the two densities in one track  #############
circos.initializeWithIdeogram(plotType = c("axis", "labels"))
circos.genomicDensity(bed_list, col = c("#FF000080", "#0000FF80"), track.height = 0.2)
circos.clear()


circlize documentation built on May 29, 2024, 1:59 a.m.