View source: R/annotateRegions.R
annotateRegions | R Documentation |
Annotate a GRanges
object with
sets of reference GRanges
or
GRangesList
objects, with
respect to overlaps and nearest neighbors.
annotateRegions(
x,
hasOverlap = list(),
fracOverlap = list(),
numOverlap = list(),
nearest = list(),
ignore.strand = TRUE
)
x |
The |
hasOverlap |
Named |
fracOverlap |
Named |
numOverlap |
Named |
nearest |
Named |
ignore.strand |
Logical scalar passed to
|
A GRanges
similar to x
, with
annotations added to its metadata columns (mcols
).
Michael Stadler
getGenomicTiles
that uses this function,
findOverlaps
and
nearest
in package GenomicRanges used
internally.
library(GenomicRanges)
x <- GRanges("chr1", IRanges(c(1, 12), width = 10))
tss <- GRanges("chr1", IRanges(c(1, 10, 30), width = 1,
names = paste0("t", 1:3)))
blacklist <- GRanges("chr1", IRanges(20, width = 5))
annotateRegions(x, hasOverlap = list(Blacklist = blacklist),
fracOverlap = list(Blacklist = blacklist),
numOverlap = list(TSS = tss),
nearest = list(TSS = tss))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.