Description Usage Arguments Details Value Author(s) See Also Examples
Annotate the results of nearest with more information about the type of match.
1 | annotateNearest(x, subject, annotate = TRUE, ...)
|
x |
The query. An |
subject |
The subject. An |
annotate |
Whether to annotate the result. |
... |
Arguments passed along to |
This function runs 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
.
A data frame with columns 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.
dist |
Signed distance to the nearest target. Queries downstream from (i.e. past) their nearest target are given a negative distance. |
subjectHits |
The index of the nearest target. |
type |
one of |
amountOverlap |
The width of the overlap region, if any. |
insideDistance |
When a query is contained in its nearest target, the
signed minimum of the two distances target-start-to-query-start and
query-end-to-target-end. The former is taken positive, and the latter,
which wins in ties, negative. |
size1 |
equals |
size2 |
equals |
Harris Jaffee, Peter Murakami and Rafael A. Irizarry
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.