Thank you for this package!
However, I noticed some behavior that seems unexpected. In the example below, I initialize a PyRanges object with three ranges, and a second one with a single range. Since the range in the second object touches the middle range from the first object, I would expect the range [6-7) to be among the nearest ranges.
import pyranges as pr
f1 = pr.PyRanges(dict(Chromosome="chr1", Start=[1, 6, 20], End=[2, 7, 22], Strand=["+", "+", "+"]))
f1
| Chromosome |
Start |
End |
Strand |
| chr1 |
1 |
2 |
+ |
| chr1 |
6 |
7 |
+ |
| chr1 |
20 |
22 |
+ |
f2 = pr.PyRanges(dict(Chromosome="chr1", Start=[5], End=[6], Strand=["+"]))
| Chromosome |
Start |
End |
Strand |
| chr1 |
5 |
6 |
+ |
| Chromosome |
Start |
End |
Strand |
Chromosome_b |
Start_b |
End_b |
Strand_b |
Distance |
| chr1 |
1 |
2 |
+ |
chr1 |
5 |
6 |
+ |
4 |
| chr1 |
20 |
22 |
+ |
chr1 |
5 |
6 |
+ |
15 |
When swapping the ranges the closest range is reported.
| Chromosome |
Start |
End |
Strand |
Chromosome_b |
Start_b |
End_b |
Strand_b |
Distance |
| chr1 |
5 |
6 |
+ |
chr1 |
6 |
7 |
+ |
1 |
'1.1.4'
Thank you for this package!
However, I noticed some behavior that seems unexpected. In the example below, I initialize a PyRanges object with three ranges, and a second one with a single range. Since the range in the second object touches the middle range from the first object, I would expect the range [6-7) to be among the nearest ranges.
When swapping the ranges the closest range is reported.
'1.1.4'