rnabioco / valr

Genome Interval Arithmetic in R
http://rnabioco.github.io/valr/
Other
88 stars 25 forks source link

bed_intersect reports non-overlapping two adjacent intervals #351

Closed ItokawaK closed 5 years ago

ItokawaK commented 5 years ago

Valr version: 0.5.0 (installed from CRAN) R version: 3.6.0

Intervals x and y below are not overlapping with each other but they are reported by bed_intersect(). Is it an expected behavior?

> x <- trbl_interval(
+   ~chrom, ~start, ~end,
+   'chr1', 450,    500
+ )
> y <- trbl_interval(
+   ~chrom, ~start, ~end,
+   'chr1', 500,    550
+ )
> bed_intersect(x, y)
# A tibble: 1 x 6
  chrom start.x end.x start.y end.y .overlap
  <chr>   <dbl> <dbl>   <dbl> <dbl>    <int>
1 chr1      450   500     500   550        0
ItokawaK commented 5 years ago

Ahh I understand this can be filtered out by ".overlap" field. I am sorry.