-
Notifications
You must be signed in to change notification settings - Fork 25
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
improvements for interactive use #393
Conversation
update testthat and tests closes #392
still need to handle empty function calls, ideally these would use library(valr)
# this error is partcularly uninformative
bed_intersect()
#> Error in y_tbl[[1]]: subscript out of bounds
bed_flank()
#> Error in check_interval(x): argument "x" is missing, with no default
bed_slop()
#> Error in check_interval(x): argument "x" is missing, with no default Created on 2022-10-04 with reprex v2.0.2 |
with new changes: library(valr)
bed_intersect()
#> Error in `bed_intersect()`:
#> ! `x` is absent but must be supplied.
#> Backtrace:
#> ▆
#> 1. └─valr::bed_intersect()
#> 2. └─rlang::check_required(x) at valr/R/bed_intersect.r:90:2
#> 3. └─rlang::abort(msg, call = call)
bed_flank()
#> Error in `bed_flank()`:
#> ! `x` is absent but must be supplied.
#> Backtrace:
#> ▆
#> 1. └─valr::bed_flank()
#> 2. └─rlang::check_required(x) at valr/R/bed_flank.r:58:2
#> 3. └─rlang::abort(msg, call = call)
bed_slop()
#> Error in `bed_slop()`:
#> ! `x` is absent but must be supplied.
#> Backtrace:
#> ▆
#> 1. └─valr::bed_slop()
#> 2. └─rlang::check_required(x) at valr/R/bed_slop.r:50:2
#> 3. └─rlang::abort(msg, call = call) Created on 2022-10-04 with reprex v2.0.2 |
behavior in pipes looks better now too: library(valr)
x <- tibble::tribble(
~chrom, ~start, ~end,
'chr1', 25, 50,
'chr1', 100, 125
)
y <- tibble::tribble(
~chrom, ~start, ~end,
'chr1', 30, 75
)
bed_intersect()
#> Error in `bed_intersect()`:
#> ! `x` is absent but must be supplied.
#> Backtrace:
#> ▆
#> 1. └─valr::bed_intersect()
#> 2. └─rlang::check_required(x) at valr/R/bed_intersect.r:90:2
#> 3. └─rlang::abort(msg, call = call)
bed_intersect(x)
#> Error in `bed_intersect()`:
#> ! One or more tbls required in `...`
#> Backtrace:
#> ▆
#> 1. └─valr::bed_intersect(x)
#> 2. └─cli::cli_abort("One or more tbls required in {.var ...}") at valr/R/bed_intersect.r:93:4
#> 3. └─rlang::abort(...)
bed_flank()
#> Error in `bed_flank()`:
#> ! `x` is absent but must be supplied.
#> Backtrace:
#> ▆
#> 1. └─valr::bed_flank()
#> 2. └─rlang::check_required(x) at valr/R/bed_flank.r:58:2
#> 3. └─rlang::abort(msg, call = call)
bed_slop()
#> Error in `bed_slop()`:
#> ! `x` is absent but must be supplied.
#> Backtrace:
#> ▆
#> 1. └─valr::bed_slop()
#> 2. └─rlang::check_required(x) at valr/R/bed_slop.r:50:2
#> 3. └─rlang::abort(msg, call = call)
# pipe behavior
bed_intersect(x, y) |>
bed_flank()
#> Error in `bed_flank()`:
#> ! `genome` is absent but must be supplied.
#> Backtrace:
#> ▆
#> 1. └─valr::bed_flank(bed_intersect(x, y))
#> 2. └─rlang::check_required(genome) at valr/R/bed_flank.r:59:2
#> 3. └─rlang::abort(msg, call = call) Created on 2022-10-04 with reprex v2.0.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the updates.
update testthat and tests
closes #392