View source: R/addInteractionAnnotation.R
addInteractionAnnotation | R Documentation |
A function to add annotation markers for emphasizing interactions
addInteractionAnnotation(
obj,
idx,
FUN = grid.polygon,
panel = c("top", "bottom"),
...
)
obj |
A GInteractions object, GRanges object or numeric vector. For numeric vector, the positive value will generate a line with slope 1 and negative value will generate a line at the position with slope -1. |
idx |
The layer number of track. |
FUN |
Function for plot. Available functions are grid.polygon, grid.lines, and grid.text for GInteractions object; grid.lines, and grid.text for GRanges object; FUN is not used for numeric vector. |
panel |
Plot regions. Available values are "top", "bottom". |
... |
Parameters will be passed to FUN. |
invisible viewport for plot region.
See Also as addGuideLine
, addArrowMark
library(trackViewer)
library(InteractionSet)
gi <- readRDS(system.file("extdata", "nij.chr6.51120000.53200000.gi.rds",
package="trackViewer"))
tads <- GInteractions(
GRanges("chr6",
IRanges(c(51130001, 51130001, 51450001, 52210001), width = 20000)),
GRanges("chr6",
IRanges(c(51530001, 52170001, 52210001, 53210001), width = 20000)))
range <- GRanges("chr6", IRanges(51120000, 53200000))
tr <- gi2track(gi)
viewTracks(trackList(tr),
gr=range, autoOptimizeStyle = TRUE)
addInteractionAnnotation(tads, "tr", grid.lines,
gp=gpar(col = "#E69F00", lwd=3, lty=3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.