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

closest behaviour on book-ended intervals #311

Closed
jayhesselberth opened this issue Dec 7, 2017 · 0 comments · Fixed by #327
Assignees

Comments

@jayhesselberth
Copy link
Member

@jayhesselberth jayhesselberth commented Dec 7, 2017

First and third intervals should have .dist = 1.

reprex::reprex_info()
#> Created by the reprex package v0.1.1.9000 on 2017-12-07

library(valr)

x <- trbl_interval(
  ~chrom, ~start, ~end,
  "chr1", 100,    150
)

y <- trbl_interval(
  ~chrom, ~start, ~end,
  "chr1", 99,     100,
  "chr1", 100,    101,
  "chr1", 150,    151
)

bed_closest(x, y)
#> # A tibble: 3 x 7
#>   chrom start.x end.x start.y end.y .overlap .dist
#>   <chr>   <dbl> <dbl>   <dbl> <dbl>    <int> <int>
#> 1  chr1     100   150      99   100        0     0
#> 2  chr1     100   150     100   101        1     0
#> 3  chr1     100   150     150   151        0     0
@kriemo kriemo self-assigned this Jan 24, 2018
jayhesselberth added a commit that referenced this issue Jan 24, 2018
- closes #311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.