Open ShanSabri opened 4 years ago
I managed to work up a solution that seems to work for my case.
Glad you managed to get something to work for your needs. When I have more time, I will try to implement a family of join_nearest_neighbor_*()
functions based on your use case. Would be happy to add you as a contributor, if you would like to have a go at implementing a PR. cc @lawremi
Hi Stuart,
Thanks for the great package.
I was wondering if it was possible to find the k-nearest neighbors as opposed to the single nearest. For example, I'm interested in tagging ATAC peaks with the 5 nearest genes. I've opened up an issue on GenomicRanges() regarding its unexported
findKNN()
function and was wondering if you had any insight.The functions below seem to work perfectly for k=1 nearest neighbor, but I'd like to extend this to k>1, while also retaining the corresponding distances:
Any help would be much appreciated!
EDIT: I should mention that reproducible data and examples are posted on the GenomicRanges() issue I opened.