Running ‘testthat.R’ [23s/23s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(valr)
  > 
  > test_check("valr")
  1. Error: tbls grouped by strand are processed (@test_intersect.r#181) ---------
  Variable context not set
  1: bed_intersect(group_by(x, strand), group_by(y, strand)) at testthat/test_intersect.r:181
  2: select_(y, "-.source", everything(), ".source")
  3: select_.grouped_df(y, "-.source", everything(), ".source")
  4: compat_lazy_dots(.dots, caller_env(), ...)
  5: everything()
  6: current_vars()
  7: cur_vars_env$selected %||% abort("Variable context not set")
  8: abort("Variable context not set")
  
  2. Error: multiple y tbl_intervals can be passed to bed_intersect (#220) (@test_intersect.r#229) 
  Variable context not set
  1: bed_intersect(x, y, z) at testthat/test_intersect.r:229
  2: select_(y, "-.source", everything(), ".source")
  3: select_.data.frame(y, "-.source", everything(), ".source")
  4: compat_lazy_dots(.dots, caller_env(), ...)
  5: everything()
  6: current_vars()
  7: cur_vars_env$selected %||% abort("Variable context not set")
  8: abort("Variable context not set")
  
  3. Error: groups are respected when passing multiple y tbl_intervals  (@test_intersect.r#266) 
  Variable context not set
  1: bed_intersect(x, y, z) at testthat/test_intersect.r:266
  2: select_(y, "-.source", everything(), ".source")
  3: select_.grouped_df(y, "-.source", everything(), ".source")
  4: compat_lazy_dots(.dots, caller_env(), ...)
  5: everything()
  6: current_vars()
  7: cur_vars_env$selected %||% abort("Variable context not set")
  8: abort("Variable context not set")
  
  4. Error: same intervals are reported with single and multiple intersection (@test_intersect.r#297) 
  Variable context not set
  1: bed_intersect(x, y, z) %>% arrange(chrom, start.x, start.y) %>% select(-.source) at testthat/test_intersect.r:297
  2: eval(lhs, parent, parent)
  3: eval(lhs, parent, parent)
  4: bed_intersect(x, y, z)
  5: select_(y, "-.source", everything(), ".source")
  6: select_.data.frame(y, "-.source", everything(), ".source")
  7: compat_lazy_dots(.dots, caller_env(), ...)
  8: everything()
  9: current_vars()
  10: cur_vars_env$selected %||% abort("Variable context not set")
  11: abort("Variable context not set")
  
  5. Error: window IDs are generated (@test_makewindows.r#17) --------------------
  Column `.start` must be length 1 (the group size), not 11
  1: bed_makewindows(x, genome, win_size = 10) at testthat/test_makewindows.r:17
  2: tidyr::unnest(res)
  3: unnest_(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  4: unnest_.tbl_df(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  5: as_data_frame(NextMethod())
  6: NextMethod()
  7: unnest_.data.frame(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  8: dplyr::transmute_(data, .dots = unnest_cols)
  9: transmute_.default(data, .dots = unnest_cols)
  10: transmute(.data, !(!(!dots)))
  11: transmute.default(.data, !(!(!dots)))
  12: mutate(.data, !(!(!dots)))
  13: mutate.tbl_df(.data, !(!(!dots)))
  14: mutate_impl(.data, dots)
  
  6. Error: win_size fwd (@test_makewindows.r#23) --------------------------------
  Column `.start` must be length 1 (the group size), not 11
  1: bed_makewindows(x, genome, win_size = 10) at testthat/test_makewindows.r:23
  2: tidyr::unnest(res)
  3: unnest_(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  4: unnest_.tbl_df(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  5: as_data_frame(NextMethod())
  6: NextMethod()
  7: unnest_.data.frame(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  8: dplyr::transmute_(data, .dots = unnest_cols)
  9: transmute_.default(data, .dots = unnest_cols)
  10: transmute(.data, !(!(!dots)))
  11: transmute.default(.data, !(!(!dots)))
  12: mutate(.data, !(!(!dots)))
  13: mutate.tbl_df(.data, !(!(!dots)))
  14: mutate_impl(.data, dots)
  
  7. Error: win_size rev (@test_makewindows.r#34) --------------------------------
  Column `.start` must be length 1 (the group size), not 11
  1: bed_makewindows(x, genome, reverse = TRUE, win_size = 10) at testthat/test_makewindows.r:34
  2: tidyr::unnest(res)
  3: unnest_(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  4: unnest_.tbl_df(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  5: as_data_frame(NextMethod())
  6: NextMethod()
  7: unnest_.data.frame(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  8: dplyr::transmute_(data, .dots = unnest_cols)
  9: transmute_.default(data, .dots = unnest_cols)
  10: transmute(.data, !(!(!dots)))
  11: transmute.default(.data, !(!(!dots)))
  12: mutate(.data, !(!(!dots)))
  13: mutate.tbl_df(.data, !(!(!dots)))
  14: mutate_impl(.data, dots)
  
  8. Error: win_size +step_size fwd (@test_makewindows.r#45) ---------------------
  Column `.start` must be length 1 (the group size), not 21
  1: bed_makewindows(x, genome, win_size = 10, step_size = 5) at testthat/test_makewindows.r:45
  2: tidyr::unnest(res)
  3: unnest_(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  4: unnest_.tbl_df(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  5: as_data_frame(NextMethod())
  6: NextMethod()
  7: unnest_.data.frame(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  8: dplyr::transmute_(data, .dots = unnest_cols)
  9: transmute_.default(data, .dots = unnest_cols)
  10: transmute(.data, !(!(!dots)))
  11: transmute.default(.data, !(!(!dots)))
  12: mutate(.data, !(!(!dots)))
  13: mutate.tbl_df(.data, !(!(!dots)))
  14: mutate_impl(.data, dots)
  
  9. Error: win_size +step_size rev (@test_makewindows.r#57) ---------------------
  Column `.start` must be length 1 (the group size), not 21
  1: bed_makewindows(x, genome, reverse = TRUE, win_size = 10, step_size = 5) at testthat/test_makewindows.r:57
  2: tidyr::unnest(res)
  3: unnest_(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  4: unnest_.tbl_df(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  5: as_data_frame(NextMethod())
  6: NextMethod()
  7: unnest_.data.frame(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  8: dplyr::transmute_(data, .dots = unnest_cols)
  9: transmute_.default(data, .dots = unnest_cols)
  10: transmute(.data, !(!(!dots)))
  11: transmute.default(.data, !(!(!dots)))
  12: mutate(.data, !(!(!dots)))
  13: mutate.tbl_df(.data, !(!(!dots)))
  14: mutate_impl(.data, dots)
  
  10. Error: num_win fwd (@test_makewindows.r#69) --------------------------------
  Column `.start` must be length 1 (the group size), not 11
  1: bed_makewindows(x, genome, num_win = 10) at testthat/test_makewindows.r:69
  2: tidyr::unnest(res)
  3: unnest_(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  4: unnest_.tbl_df(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  5: as_data_frame(NextMethod())
  6: NextMethod()
  7: unnest_.data.frame(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  8: dplyr::transmute_(data, .dots = unnest_cols)
  9: transmute_.default(data, .dots = unnest_cols)
  10: transmute(.data, !(!(!dots)))
  11: transmute.default(.data, !(!(!dots)))
  12: mutate(.data, !(!(!dots)))
  13: mutate.tbl_df(.data, !(!(!dots)))
  14: mutate_impl(.data, dots)
  
  11. Error: num_win rev (@test_makewindows.r#81) --------------------------------
  Column `.start` must be length 1 (the group size), not 11
  1: bed_makewindows(x, genome, reverse = TRUE, num_win = 10) at testthat/test_makewindows.r:81
  2: tidyr::unnest(res)
  3: unnest_(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  4: unnest_.tbl_df(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  5: as_data_frame(NextMethod())
  6: NextMethod()
  7: unnest_.data.frame(data, dots, .drop = .drop, .id = .id, .sep = .sep)
  8: dplyr::transmute_(data, .dots = unnest_cols)
  9: transmute_.default(data, .dots = unnest_cols)
  10: transmute(.data, !(!(!dots)))
  11: transmute.default(.data, !(!(!dots)))
  12: mutate(.data, !(!(!dots)))
  13: mutate.tbl_df(.data, !(!(!dots)))
  14: mutate_impl(.data, dots)
  
  12. Error: both arg works (@test_window.r#25) ----------------------------------
  Variable context not set
  1: bed_window(x, y, genome, both = 110) at testthat/test_window.r:25
  2: do.call(bed_intersect, c(list(x = slop_x, y = y), intersect_args))
  3: (function (x, ..., invert = FALSE, suffix = c(".x", ".y")) 
     {
         if (typeof(substitute(...)) == "symbol") {
             y_tbl <- list(...)
             if (is.null(names(y_tbl))) {
                 dots <- eval(substitute(alist(...)))
                 names(y_tbl) <- dots
             }
         }
         else {
             y_tbl <- list(...)[[1]]
             if (is.null(names(y_tbl))) {
                 dots <- eval(substitute(alist(...)))[[1]]
                 dots <- as.character(dots)
                 dots <- dots[2:length(dots)]
                 names(y_tbl) <- as.character(dots)
             }
         }
         multiple_tbls <- FALSE
         if (length(y_tbl) > 1) {
             multiple_tbls <- TRUE
             y <- bind_rows(y_tbl, .id = ".source")
             y <- select_(y, "-.source", everything(), ".source")
         }
         else {
             y <- y_tbl[[1]]
         }
         if (!is.tbl_interval(x)) 
             x <- tbl_interval(x)
         if (!is.tbl_interval(y)) 
             y <- tbl_interval(y)
         check_suffix(suffix)
         x <- group_by(x, chrom, add = TRUE)
         y <- group_by(y, chrom, add = TRUE)
         suffix <- list(x = suffix[1], y = suffix[2])
         res <- intersect_impl(x, y, suffix$x, suffix$y)
         if (invert) {
             colspec <- c(chrom = "chrom", start = paste0("start", suffix$x), end = paste0("end", 
                 suffix$x))
             res <- anti_join(x, res, by = colspec)
             res <- ungroup(res)
         }
         if (multiple_tbls) {
             source_col <- paste0(".source", suffix$y)
             replace_col <- stringr::str_replace(source_col, stringr::fixed(suffix$y), 
                 "")
             cols <- colnames(res)
             colnames(res) <- ifelse(cols == source_col, replace_col, cols)
         }
         res
     })(x = structure(list(chrom = c("chr1", "chr1", "chr2"), start = c(390, 890, 890), 
         end = c(1110, 1610, 1310), name = c(".", ".", "."), score = c(".", ".", "."), 
         strand = c("+", "-", "-"), .start = c(500, 1000, 1000), .end = c(1000, 1500, 
         1200)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, -3L), .Names = c("chrom", 
     "start", "end", "name", "score", "strand", ".start", ".end")), y = structure(list(
         chrom = c("chr1", "chr1", "chr1", "chr2"), start = c(400, 1000, 1100, 1300), 
         end = c(450, 1200, 1500, 1500), name = c(".", ".", ".", "."), score = c(".", 
         ".", ".", "."), strand = c("+", "-", "+", "-")), .Names = c("chrom", "start", 
     "end", "name", "score", "strand"), class = c("tbl_ivl", "tbl_df", "tbl", "data.frame"
     ), row.names = c(NA, -4L)))
  4: select_(y, "-.source", everything(), ".source")
  5: select_.data.frame(y, "-.source", everything(), ".source")
  6: compat_lazy_dots(.dots, caller_env(), ...)
  7: everything()
  8: current_vars()
  9: cur_vars_env$selected %||% abort("Variable context not set")
  10: abort("Variable context not set")
  
  13. Error: left arg works (@test_window.r#30) ----------------------------------
  Variable context not set
  1: bed_window(x, y, genome, left = 110) at testthat/test_window.r:30
  2: do.call(bed_intersect, c(list(x = slop_x, y = y), intersect_args))
  3: (function (x, ..., invert = FALSE, suffix = c(".x", ".y")) 
     {
         if (typeof(substitute(...)) == "symbol") {
             y_tbl <- list(...)
             if (is.null(names(y_tbl))) {
                 dots <- eval(substitute(alist(...)))
                 names(y_tbl) <- dots
             }
         }
         else {
             y_tbl <- list(...)[[1]]
             if (is.null(names(y_tbl))) {
                 dots <- eval(substitute(alist(...)))[[1]]
                 dots <- as.character(dots)
                 dots <- dots[2:length(dots)]
                 names(y_tbl) <- as.character(dots)
             }
         }
         multiple_tbls <- FALSE
         if (length(y_tbl) > 1) {
             multiple_tbls <- TRUE
             y <- bind_rows(y_tbl, .id = ".source")
             y <- select_(y, "-.source", everything(), ".source")
         }
         else {
             y <- y_tbl[[1]]
         }
         if (!is.tbl_interval(x)) 
             x <- tbl_interval(x)
         if (!is.tbl_interval(y)) 
             y <- tbl_interval(y)
         check_suffix(suffix)
         x <- group_by(x, chrom, add = TRUE)
         y <- group_by(y, chrom, add = TRUE)
         suffix <- list(x = suffix[1], y = suffix[2])
         res <- intersect_impl(x, y, suffix$x, suffix$y)
         if (invert) {
             colspec <- c(chrom = "chrom", start = paste0("start", suffix$x), end = paste0("end", 
                 suffix$x))
             res <- anti_join(x, res, by = colspec)
             res <- ungroup(res)
         }
         if (multiple_tbls) {
             source_col <- paste0(".source", suffix$y)
             replace_col <- stringr::str_replace(source_col, stringr::fixed(suffix$y), 
                 "")
             cols <- colnames(res)
             colnames(res) <- ifelse(cols == source_col, replace_col, cols)
         }
         res
     })(x = structure(list(chrom = c("chr1", "chr1", "chr2"), start = c(390, 890, 890), 
         end = c(1000, 1500, 1200), name = c(".", ".", "."), score = c(".", ".", "."), 
         strand = c("+", "-", "-"), .start = c(500, 1000, 1000), .end = c(1000, 1500, 
         1200)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, -3L), .Names = c("chrom", 
     "start", "end", "name", "score", "strand", ".start", ".end")), y = structure(list(
         chrom = c("chr1", "chr1", "chr1", "chr2"), start = c(400, 1000, 1100, 1300), 
         end = c(450, 1200, 1500, 1500), name = c(".", ".", ".", "."), score = c(".", 
         ".", ".", "."), strand = c("+", "-", "+", "-")), .Names = c("chrom", "start", 
     "end", "name", "score", "strand"), class = c("tbl_ivl", "tbl_df", "tbl", "data.frame"
     ), row.names = c(NA, -4L)))
  4: select_(y, "-.source", everything(), ".source")
  5: select_.data.frame(y, "-.source", everything(), ".source")
  6: compat_lazy_dots(.dots, caller_env(), ...)
  7: everything()
  8: current_vars()
  9: cur_vars_env$selected %||% abort("Variable context not set")
  10: abort("Variable context not set")
  
  14. Error: right arg works (@test_window.r#35) ---------------------------------
  Variable context not set
  1: bed_window(x, y, genome, right = 110) at testthat/test_window.r:35
  2: do.call(bed_intersect, c(list(x = slop_x, y = y), intersect_args))
  3: (function (x, ..., invert = FALSE, suffix = c(".x", ".y")) 
     {
         if (typeof(substitute(...)) == "symbol") {
             y_tbl <- list(...)
             if (is.null(names(y_tbl))) {
                 dots <- eval(substitute(alist(...)))
                 names(y_tbl) <- dots
             }
         }
         else {
             y_tbl <- list(...)[[1]]
             if (is.null(names(y_tbl))) {
                 dots <- eval(substitute(alist(...)))[[1]]
                 dots <- as.character(dots)
                 dots <- dots[2:length(dots)]
                 names(y_tbl) <- as.character(dots)
             }
         }
         multiple_tbls <- FALSE
         if (length(y_tbl) > 1) {
             multiple_tbls <- TRUE
             y <- bind_rows(y_tbl, .id = ".source")
             y <- select_(y, "-.source", everything(), ".source")
         }
         else {
             y <- y_tbl[[1]]
         }
         if (!is.tbl_interval(x)) 
             x <- tbl_interval(x)
         if (!is.tbl_interval(y)) 
             y <- tbl_interval(y)
         check_suffix(suffix)
         x <- group_by(x, chrom, add = TRUE)
         y <- group_by(y, chrom, add = TRUE)
         suffix <- list(x = suffix[1], y = suffix[2])
         res <- intersect_impl(x, y, suffix$x, suffix$y)
         if (invert) {
             colspec <- c(chrom = "chrom", start = paste0("start", suffix$x), end = paste0("end", 
                 suffix$x))
             res <- anti_join(x, res, by = colspec)
             res <- ungroup(res)
         }
         if (multiple_tbls) {
             source_col <- paste0(".source", suffix$y)
             replace_col <- stringr::str_replace(source_col, stringr::fixed(suffix$y), 
                 "")
             cols <- colnames(res)
             colnames(res) <- ifelse(cols == source_col, replace_col, cols)
         }
         res
     })(x = structure(list(chrom = c("chr1", "chr1", "chr2"), start = c(500, 1000, 1000
     ), end = c(1110, 1610, 1310), name = c(".", ".", "."), score = c(".", ".", "."), 
         strand = c("+", "-", "-"), .start = c(500, 1000, 1000), .end = c(1000, 1500, 
         1200)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, -3L), .Names = c("chrom", 
     "start", "end", "name", "score", "strand", ".start", ".end")), y = structure(list(
         chrom = c("chr1", "chr1", "chr1", "chr2"), start = c(400, 1000, 1100, 1300), 
         end = c(450, 1200, 1500, 1500), name = c(".", ".", ".", "."), score = c(".", 
         ".", ".", "."), strand = c("+", "-", "+", "-")), .Names = c("chrom", "start", 
     "end", "name", "score", "strand"), class = c("tbl_ivl", "tbl_df", "tbl", "data.frame"
     ), row.names = c(NA, -4L)))
  4: select_(y, "-.source", everything(), ".source")
  5: select_.data.frame(y, "-.source", everything(), ".source")
  6: compat_lazy_dots(.dots, caller_env(), ...)
  7: everything()
  8: current_vars()
  9: cur_vars_env$selected %||% abort("Variable context not set")
  10: abort("Variable context not set")
  
  testthat results ================================================================
  OK: 252 SKIPPED: 3 FAILED: 14
  1. Error: tbls grouped by strand are processed (@test_intersect.r#181) 
  2. Error: multiple y tbl_intervals can be passed to bed_intersect (#220) (@test_intersect.r#229) 
  3. Error: groups are respected when passing multiple y tbl_intervals  (@test_intersect.r#266) 
  4. Error: same intervals are reported with single and multiple intersection (@test_intersect.r#297) 
  5. Error: window IDs are generated (@test_makewindows.r#17) 
  6. Error: win_size fwd (@test_makewindows.r#23) 
  7. Error: win_size rev (@test_makewindows.r#34) 
  8. Error: win_size +step_size fwd (@test_makewindows.r#45) 
  9. Error: win_size +step_size rev (@test_makewindows.r#57) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted