rnabioco / valr

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

bed_shift failed test "going beyond the end of the chrom" #321

Closed raysinensis closed 6 years ago

raysinensis commented 6 years ago

start output did not respect chrom size expected output from bedtools would be 999, 1000

library(valr)
a <- tibble::tribble(
  ~chrom, ~start, ~end, ~name, ~score, ~strand,
  "chr1", 100, 200, "a1", 1, "+",
  "chr1", 100, 200, "a2", 2, "-"
)

tiny.genome <- tibble::tribble(
  ~chrom, ~size,
  "chr1", 1000
)
out <- bed_shift(a, tiny.genome, size = 901, trim = TRUE)
out
#> # A tibble: 2 x 6
#>   chrom start   end  name score strand
#>   <chr> <dbl> <dbl> <chr> <dbl>  <chr>
#> 1  chr1  1001  1000    a1     1      +
#> 2  chr1  1001  1000    a2     2      -

Created on 2018-01-19 by the reprex package (v0.1.1.9000).