Question: Finding the nearest n genes from a genomic loci
1
13 months ago by
ssabri20
ssabri20 wrote:

I am aware of the nearest() function but I believe this is limited to finding the nearest single gene to a loci. Is there a way to compute the n nearest genes for a genomic loci? I ultimately want to do this for a genomicranges object that is segmented into approximately 3 million non-overlapping ranges/bins. These loci are defined by binning a chromosome into 200bp windows. Thank you!

genomicranges • 205 views
modified 13 months ago by Michael Lawrence11k • written 13 months ago by ssabri20
Answer: Finding the nearest n genes from a genomic loci
2
13 months ago by
United States
Michael Lawrence11k wrote:

There is a hidden function GenomicRanges:::findKNN() that might do the trick. It's largely untested so let me know whether it works.