GenomicRanges: Find N nearest/preceding/following ranges
1
0
Entering edit mode
maltethodberg ▴ 180
@maltethodberg-9690
Last seen 3 hours ago
Denmark

The nearest(), precede() and follow() functions find the single nearest/preceding/following range.

Is there a similar implementation and/or easy way to find an arbitrary number of corresponding ranges, e.g. the 5 preceding ranges?

genomicranges • 1.2k views
ADD COMMENT
3
Entering edit mode
@michael-lawrence-3846
Last seen 3.0 years ago
United States

There's the unexported GenomicRanges:::findKNN(). It finds all k nearest neighbors. I think it could be modified to just return the preceding/following ranges. There's already an option to ignore overlaps. If it's useful let me know; maybe we should clean it up and export it.

ADD COMMENT
0
Entering edit mode

Thanks for the tip! I'd say that's a reasonably useful function. Would also be nice if it worked with GPos

ADD REPLY

Login before adding your answer.

Traffic: 577 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6