
Last chance! 50% off unlimited learning
Sale ends in
annotateNearest(x, subject, annotate = TRUE, ...)
IRanges
or GenomicRanges
object, or a
data.frame
with columns for start
, end
,
and, optionally, chr
or seqnames
.
IRanges
or GenomicRanges
object, or a
data.frame
with columns for start
, end
,
and, optionally, chr
or seqnames
.
nearest
.
c("distance", "subjectHits", "type",
"amountOverlap", "insideDistamce", "size1", "size2")
unless
annotate
is FALSE
, in which case only the first two
columns are returned as an integer matrix.c("inside", "cover", "disjoint", "overlap")
.dist
will be 0
in this case.width(x)
.width(subject)
.nearest
and then annotates the
nearest hit. Note that the nearest subject range to a given query may not be
unique and we arbitrarily chose one as done by default by
nearest
.
nearest
, matchGenes
query <- GRanges(seqnames = 'chr1', IRanges(c(1, 4, 9), c(5, 7, 10)))
subject <- GRanges('chr1', IRanges(c(2, 2, 10), c(2, 3, 12)))
nearest(query, subject)
distanceToNearest(query, subject)
## showing 'cover' and 'disjoint', and 'amountOverlap'
annotateNearest(query, subject)
## showing 'inside' and 'insideDist', and 'amountOverlap'
annotateNearest(subject, query)
annotateNearest(GRanges('chr1', IRanges(3,3)), GRanges('chr1', IRanges(2,5)))
annotateNearest(GRanges('chr1', IRanges(3,4)), GRanges('chr1', IRanges(2,5)))
annotateNearest(GRanges('chr1', IRanges(4,4)), GRanges('chr1', IRanges(2,5)))
Run the code above in your browser using DataLab