open2c / bioframe

Genomic interval operations on Pandas DataFrames
MIT License
173 stars 28 forks source link

Merging based on unrelated intervals possible? #212

Open marade opened 3 months ago

marade commented 3 months ago

Hi. Thanks for this excellent package. I'm wanting to do a merge that is dependent on a second, unrelated set of intervals. If both the r- and q- intervals will merge, then go ahead, but if only one of them would merge, do nothing. I think this might be possible with bioframe, but I haven't found the right recipe yet. Have you encountered this use case?

With min_dist=100:

Don't merge: qstart qend rstart rend 2756014 2756066 54079 54131 55662 55787 54096 54221

Merge: qstart qend rstart rend 54358 54543 54629 54814 54147 54332 54840 55025