-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange behaviour of join_nearest* #76
Comments
Hi Steve, That does seem odd! I’ll take a look at this in more detail next week. In general the docs for these functions could use a bit of work. Have you tried - Thanks |
Thanks Stuart.
Cheers, Steve |
Hi Steve, Glad to hear that plyranges uses
In your example, running IRanges::nearest(a,b, ignore.strand = TRUE, select = "all")
Hits object with 1 hit and 0 metadata columns:
queryHits subjectHits
<integer> <integer>
[1] 1 2
-------
queryLength: 1 / subjectLength: 2
IRanges::nearest(a, b, ignore.strand = FALSE, select = "all")
Hits object with 1 hit and 0 metadata columns:
queryHits subjectHits
<integer> <integer>
[1] 1 2
-------
queryLength: 1 / subjectLength: 2 Hence the identical results for both upstream/right. I realise here that the docs are probably not clear on this matter but hopefully that helps! |
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 The functions below seem to work perfectly for k=1 nearest neighbor, but I'd like to extend this to k>1.
Any help would be much appreciated! BTW - It's Shan. We interned together at Genentech. I hope things are going well for you! |
Hi Shan, Nice to hear from you, hope you're doing well! also @ShanSabri - if you like could you please make another issue for this? that way i can get to implementing it at some point (but also PRs welcome ;P) |
Hmm this is still unclear to me even after looking at the example. I should clarify that I'm able to compute the overlap over a range, but that's not really what I'm aiming to do here. From the example you posted:
I'd like to take the, say 3, nearest genes to a given position (even if they are very far) while also returning their corresponding distances. Let's continue discussion over here. Thanks for getting back! |
No problem, I think the example is going the other way around from what you want as well. |
@steveped I'm assuming you managed to resolve this, so closing the issue now. |
Thanks @sa-lee. Passed the conversation to my confused collaborator & they took it from here. Really appreciated the help too. |
Hi Stuart,
Love the package (obviously), but I'm having some dramas with
join_nearest*()
. In my following example, I need to join feature1 with gene1. The gene is upstream, on the opposite strand to my feature.Given that gene1 is on the opposite strand to feature 1,
join_nearest_upstream()
andjoin_nearest_downstream()
behave exactly how I expect.However, if strand information is ignored by
join_nearest_left()
andjoin_nearest_right()
, I cannot see how the following is able to be explained.Is the strand information only ignored for one of the ranges (x = a, y = b)?.
If I manually remove the strand information, I still cannot join these ranges.
It seems that feature1 & gene1 are unable to be joined by any method here. Should I be using something else?
Thanks,
Steve
The text was updated successfully, but these errors were encountered: