Skip to content
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

improve documentation for overlap "return_overlap" argument #122

Open
gonzalobenegas opened this issue Sep 28, 2022 · 3 comments
Open

improve documentation for overlap "return_overlap" argument #122

gonzalobenegas opened this issue Sep 28, 2022 · 3 comments

Comments

@gonzalobenegas
Copy link

Hello,

Thanks for your awesome library. I'm trying to do basepair-level intersection. As I didn't find it in the documentation, I've been doing the following:

In [42]: a
Out[42]: 
  chrom  start  end     name
0     1     10   13  1:10-13
1     1     14   17  1:14-17

In [43]: b
Out[43]: 
  chrom  start  end
0     1     15   25
1     1     30   40

In [44]: bf.subtract(a, bf.complement(b, a)).drop(columns="name")
Out[44]: 
  chrom  start  end
0     1     15   17

Does it make sense? Is there a better approach?

Best,
Gonzalo

@gfudenberg
Copy link
Member

Hi Gonzalo,
Thanks for the kind words!
Would overlap() with how='left', return_overlap=True return what you were looking for?
Let us know if there's any specific places in the docs where it would have been helpful to mention this return argument! (e.g. in https://bioframe.readthedocs.io/en/latest/guide-intervalops.html#overlap or in https://bioframe.readthedocs.io/en/latest/guide-recipes.html)

@gonzalobenegas
Copy link
Author

Thank you, that does return what I was looking for!

Maybe a visualization in https://bioframe.readthedocs.io/en/latest/guide-intervalops.html#overlap could help (though I might be biased from my previous experience with bedtools intersect).

@gfudenberg
Copy link
Member

ok!
I'll re-open this as an issue for improving documentation

@gfudenberg gfudenberg reopened this Sep 28, 2022
@gfudenberg gfudenberg changed the title Intersection (basepair level) improve documentation for overlap "return_overlap" argument Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants