Learn R Programming

circlize (version 0.4.1)

circos.trackPoints: Add points to the plotting regions in a same track

Description

Add points to the plotting regions in a same track

Usage

circos.trackPoints(factors = NULL, x, y, track.index = get.cell.meta.data("track.index"),
    pch = par("pch"), col = par("col"), cex = par("cex"), bg = par("bg"))

Arguments

factors

A factor or a character vector which represents the categories of data

x

Data points on x-axis

y

Data points on y-axis

track.index

Index for the track

pch

Point type

col

Point color

cex

Point size

bg

backgrond color

Details

The function adds points in multiple cells by first splitting data into several parts in which each part corresponds to one factor (sector index) and then adding points in each cell by calling circos.points.

Length of pch, col and cex can be one, length of levels of the factors or length of factors.

This function can be replaced by a for loop containing circos.points.

References

Gu, Z. (2014) circlize implements and enhances circular visualization in R. Bioinformatics.

Examples

Run this code
# NOT RUN {
circos.initialize(letters[1:8], xlim = c(0, 1))
df = data.frame(fa = sample(letters[1:8], 100, replace = TRUE),
                x = runif(100), y = runif(100))
circos.track(ylim = c(0, 1))
circos.trackPoints(df$fa, x = df$x, y = df$y, pch = 16, col = as.numeric(factor(df$fa)))
circos.clear()

# }

Run the code above in your browser using DataLab