pyranges
pyranges copied to clipboard
Method which reports distance to nearest interval in self?
It would be convenient to have a method which reports the distance to the nearest and previous interval, without necessarily knowing which interval that is. When looking at ranges I often have trouble eyeballing how far the different intervals are apart.
This could return a df of two columns, NextDistance and PreviousDistance:
gr.distances(how=None, # or "previous", "next"
overlap=False, # or True
strandedness=None) # or "same"/"opposite"