Running 'testthat.R' [69s/64s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(ICAMS)
  > 
  > test_check("ICAMS")
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS144Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.DBS144Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_0TransformCatalogDBS144.R#10: TransformCatalog(cat.t, target.ref.genome = "GRCh37", target.region = "exome", 
      target.catalog.type = "counts")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_0TransformCatalogDBS144.R#3: test_that("Transformation of a DBS 144 catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      cat.t <- ReadCatalog("testdata/regress.cat.dbs.144.csv", 
          ref.genome = "GRCh37", region = "transcript", catalog.type = "counts")
      x1 <- TransformCatalog(cat.t, target.ref.genome = "GRCh37", 
          target.region = "exome", target.catalog.type = "counts")
      x2 <- TransformCatalog(x1, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "counts")
      expect_equal(cat.t, x2)
      cat.density <- TransformCatalog(cat.t, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density")
      x3 <- TransformCatalog(x1, target.ref.genome = "GRCh37", 
          target.region = "exome", target.catalog.type = "density")
      null.cat.density <- cat.density
      attr(null.cat.density, "region") <- NULL
      null.x3 <- x3
      attr(null.x3, "region") <- NULL
      expect_equal(null.cat.density, null.x3)
      rm(null.cat.density, null.x3)
      genome.counts.signature <- TransformCatalog(cat.t, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "counts.signature")
      out <- rep(1, 4)
      expect_equal(sum(colSums(genome.counts.signature) == out), 
          4)
      expect_error(TransformCatalog(genome.counts.signature, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density"))
      x4 <- TransformCatalog(genome.counts.signature, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density.signature")
      x5 <- TransformCatalog(cat.density, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density.signature")
      expect_equal(x4, x5)
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x11633728>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS144Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 1. Error: Transformation of a DBS 144 catalog (@test_0TransformCatalogDBS144.
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.DBS144Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS192Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS192Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_0TransformCatalogSBS192.R#11: TransformCatalog(cat.t, target.ref.genome = "GRCh37", target.region = "exome", 
      target.catalog.type = "counts")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_0TransformCatalogSBS192.R#3: test_that("Transformation of a SBS 192 catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      cat.t <- ReadCatalog("testdata/regress.cat.sbs.192.csv", 
          ref.genome = "GRCh37", region = "transcript", catalog.type = "counts")
      x1 <- TransformCatalog(cat.t, target.ref.genome = "GRCh37", 
          target.region = "exome", target.catalog.type = "counts")
      x2 <- TransformCatalog(x1, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "counts")
      expect_equal(cat.t, x2)
      cat.density <- TransformCatalog(cat.t, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density")
      x3 <- TransformCatalog(x1, target.ref.genome = "GRCh37", 
          target.region = "exome", target.catalog.type = "density")
      null.cat.density <- cat.density
      attr(null.cat.density, "region") <- NULL
      null.x3 <- x3
      attr(null.x3, "region") <- NULL
      expect_equal(null.cat.density, null.x3)
      rm(null.cat.density, null.x3)
      genome.counts.signature <- TransformCatalog(cat.t, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "counts.signature")
      out <- rep(1, 4)
      expect_equal(sum(colSums(genome.counts.signature) == out), 
          4)
      expect_error(TransformCatalog(genome.counts.signature, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density"))
      x4 <- TransformCatalog(genome.counts.signature, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density.signature")
      x5 <- TransformCatalog(cat.density, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density.signature")
      expect_equal(x4, x5)
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x117bdf68>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS192Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 2. Error: Transformation of a SBS 192 catalog (@test_0TransformCatalogSBS192.
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.SBS192Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS96Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_1TransformCatalog.R#12: TransformCatalog(cat, target.ref.genome = "GRCh37", target.region = "exome", 
      target.catalog.type = "counts")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_1TransformCatalog.R#3: test_that("Legal transformation 1;\ncounts -> counts; genome counts -> exome counts,\nand exome counts -> genome counts", 
      {
          skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
          stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
          cat <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
              ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
          x1 <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "exome", target.catalog.type = "counts")
          x2 <- TransformCatalog(x1, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "counts")
          expect_equal(cat, x2)
      })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 3. Error: Legal transformation 1;
  counts -> counts; genome counts -> exome co
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.SBS96Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS96Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_1TransformCatalog.R#34: TransformCatalog(cat, target.ref.genome = "GRCh37", target.region = "genome", 
      target.catalog.type = "density")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_1TransformCatalog.R#25: test_that("Legal transformation 2;\ncounts -> density; genome counts -> density,\nand genome counts -> exome count -> density", 
      {
          skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
          stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
          cat <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
              ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
          x1 <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "density")
          x2 <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "exome", target.catalog.type = "counts")
          x3 <- TransformCatalog(x2, target.ref.genome = "GRCh37", 
              target.region = "exome", target.catalog.type = "density")
          attr(x1, "region") <- NULL
          attr(x3, "region") <- NULL
          expect_equal(x1, x3)
      })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 4. Error: Legal transformation 2;
  counts -> density; genome counts -> density
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.SBS96Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS96Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_1TransformCatalog.R#63: TransformCatalog(cat, target.ref.genome = "GRCh37", target.region = "genome", 
      target.catalog.type = "density")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_1TransformCatalog.R#52: test_that("Legal transformation 3;\ncounts -> density; genome GRCh37 counts -> genome GRCh37 density,\nand genome GRCh37 counts -> genome GRCh38 counts -> genome GRCh38 density", 
      {
          skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
          skip_if("" == system.file(package = "BSgenome.Hsapiens.UCSC.hg38"))
          stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
          stopifnot(requireNamespace("BSgenome.Hsapiens.UCSC.hg38"))
          cat <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
              ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
          x1 <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "density")
          x2 <- TransformCatalog(cat, target.ref.genome = "GRCh38", 
              target.region = "genome", target.catalog.type = "counts")
          x3 <- TransformCatalog(x2, target.ref.genome = "GRCh38", 
              target.region = "genome", target.catalog.type = "density")
          attr(x1, "ref.genome") <- NULL
          attr(x3, "ref.genome") <- NULL
          expect_equal(x1, x3)
      })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 5. Error: Legal transformation 3;
  counts -> density; genome GRCh37 counts -> 
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.SBS96Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS96Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_1TransformCatalog.R#92: TransformCatalog(cat, target.ref.genome = "GRCh38", target.region = "genome", 
      target.catalog.type = "counts")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_1TransformCatalog.R#81: test_that("Legal transformations 1, 2, and 4;\ngenome GRCh37 counts -> genome GRCh38 counts,\nand genome GRCh37 counts -> genome GRCh37 density -> genome GRCh38 counts", 
      {
          skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
          skip_if("" == system.file(package = "BSgenome.Hsapiens.UCSC.hg38"))
          stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
          stopifnot(requireNamespace("BSgenome.Hsapiens.UCSC.hg38"))
          cat <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
              ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
          x1 <- TransformCatalog(cat, target.ref.genome = "GRCh38", 
              target.region = "genome", target.catalog.type = "counts")
          x2 <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "density")
          x3 <- TransformCatalog(x2, target.ref.genome = "GRCh38", 
              target.region = "genome", target.catalog.type = "counts")
          expect_equal(x1, x3)
      })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 6. Error: Legal transformations 1, 2, and 4;
  genome GRCh37 counts -> genome G
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.SBS96Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS96Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_1TransformCatalog.R#115: TransformCatalog(cat, target.ref.genome = "GRCh37", target.region = "genome", 
      target.catalog.type = "density")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_1TransformCatalog.R#108: test_that("Legal transformation 4; density -> (genome) counts", 
      {
          skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
          stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
          cat <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
              ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
          x1 <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "density")
          x2 <- TransformCatalog(x1, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "counts")
          expect_equal(cat, x2)
      })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 7. Error: Legal transformation 4; density -> (genome) counts (@test_1Transfor
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.SBS96Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS96Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_1TransformCatalog.R#134: TransformCatalog(cat, target.ref.genome = "GRCh37", target.region = "genome", 
      target.catalog.type = "density")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_1TransformCatalog.R#126: test_that("Legal transformation 5;\ndensity -> counts.signature, density -> density.signature", 
      {
          skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
          stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
          cat <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
              ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
          x1 <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "density")
          x2 <- TransformCatalog(x1, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "counts.signature")
          x3 <- TransformCatalog(x1, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "density.signature")
          tmp <- apply(x1, MARGIN = 2, function(x) x/sum(x))
          expect_true(all(x3 == tmp))
          expect_true(!all(x2 == x3))
      })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 8. Error: Legal transformation 5;
  density -> counts.signature, density -> den
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.SBS96Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS96Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_1TransformCatalog.R#160: TransformCatalog(cat, target.ref.genome = "GRCh37", target.region = "exome", 
      target.catalog.type = "counts")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_1TransformCatalog.R#151: test_that("Legal transformations 3 and 6;\ngenome counts -> exome counts.signature,\nand genome counts.signature -> exome counts.signature", 
      {
          skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
          stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
          cat <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
              ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
          x1 <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "exome", target.catalog.type = "counts")
          x2 <- TransformCatalog(x1, target.ref.genome = "GRCh37", 
              target.region = "exome", target.catalog.type = "counts.signature")
          x3 <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "exome", target.catalog.type = "counts.signature")
          expect_equal(x2, x3)
          x4 <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "counts.signature")
          x5 <- TransformCatalog(x4, target.ref.genome = "GRCh37", 
              target.region = "exome", target.catalog.type = "counts.signature")
          expect_equal(x3, x5)
      })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 9. Error: Legal transformations 3 and 6;
  genome counts -> exome counts.signat
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.SBS96Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS96Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_1TransformCatalog.R#200: TransformCatalog(genome.counts.signature, target.ref.genome = "GRCh37", 
      target.region = "genome", target.catalog.type = "density.signature")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_1TransformCatalog.R#186: test_that("Legal transformation 6;\ncounts.signature -> density.signature,\nand genome counts -> exome counts.signature", 
      {
          skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
          stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
          cat <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
              ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
          genome.counts.signature <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "counts.signature")
          density.signature <- TransformCatalog(genome.counts.signature, 
              target.ref.genome = "GRCh37", target.region = "genome", 
              target.catalog.type = "density.signature")
          density.signature2 <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "density.signature")
          expect_equal(density.signature, density.signature2)
          density.cat <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "density")
          density.signature3 <- TransformCatalog(density.cat, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "density.signature")
          expect_equal(density.signature, density.signature3)
          exome.counts.signature <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "exome", target.catalog.type = "counts.signature")
          exome.counts <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "exome", target.catalog.type = "counts")
          exome.counts.signature2 <- TransformCatalog(exome.counts, 
              target.ref.genome = "GRCh37", target.region = "exome", 
              target.catalog.type = "counts.signature")
          expect_equal(exome.counts.signature, exome.counts.signature2)
      })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 10. Error: Legal transformation 6;
  counts.signature -> density.signature,
  and
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.SBS96Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS96Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_1TransformCatalog.R#252: TransformCatalog(cat, target.ref.genome = "GRCh37", target.region = "genome", 
      target.catalog.type = "density")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_1TransformCatalog.R#244: test_that("going from density to density,\n          density.signature to density.signature", 
      {
          skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
          stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
          cat <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
              ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
          x1 <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "density")
          expect_warning(x2 <- TransformCatalog(x1, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "density"))
          x3 <- TransformCatalog(x1, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "density.signature")
          expect_warning(x4 <- TransformCatalog(x3, target.ref.genome = "GRCh37", 
              target.region = "genome", target.catalog.type = "density.signature"))
          expect_equal(x1, x2)
          expect_equal(x3, x4)
      })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 11. Error: going from density to density,
            density.signature to dens
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.SBS96Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS96Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_1TransformCatalog.R#282: TransformCatalog(cat, target.ref.genome = "GRCh37", target.region = "exome", 
      target.catalog.type = "counts.signature")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_1TransformCatalog.R#274: test_that("Error test: counts.singature -> counts or density,\n            error message expected", 
      {
          skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
          stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
          cat <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
              ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
          x1 <- TransformCatalog(cat, target.ref.genome = "GRCh37", 
              target.region = "exome", target.catalog.type = "counts.signature")
          expect_error(TransformCatalog(x1, target.ref.genome = "GRCh37", 
              target.region = "exome", target.catalog.type = "counts"))
          expect_error(TransformCatalog(x1, target.ref.genome = "GRCh37", 
              target.region = "exome", target.catalog.type = "density"))
      })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 12. Error: Error test: counts.singature -> counts or density,
              err
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.SBS96Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS1536Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS1536Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_CollapseCatalog.R#13: TransformCatalog(cat.SBS1536, target.ref.genome = "GRCh37", target.region = "genome", 
      target.catalog.type = "density")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_CollapseCatalog.R#3: test_that("Collapse1536CatalogTo96 block 1", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      cat.SBS1536 <- ReadCatalog("testdata/regress.cat.sbs.1536.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      x1 <- Collapse1536CatalogTo96(cat.SBS1536)
      expect_equal(colSums(cat.SBS1536), colSums(x1))
      expect_equal("SBS96Catalog", class(x1)[1])
      cat.SBS1536.density <- TransformCatalog(cat.SBS1536, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "density")
      x2 <- Collapse1536CatalogTo96(cat.SBS1536.density)
      expect_equal(colSums(cat.SBS1536.density), colSums(x2))
      expect_equal("SBS96Catalog", class(x2)[1])
      cat.SBS1536.counts.signature <- TransformCatalog(cat.SBS1536, 
          target.ref.genome = "GRCh37", target.region = "genome", 
          target.catalog.type = "counts.signature")
      x3 <- Collapse1536CatalogTo96(cat.SBS1536.counts.signature)
      expect_equal(colSums(cat.SBS1536.counts.signature), colSums(x3))
      expect_equal("SBS96Catalog", class(x3)[1])
      cat.SBS1536.density.signature <- TransformCatalog(cat.SBS1536, 
          target.ref.genome = "GRCh37", target.region = "genome", 
          target.catalog.type = "density.signature")
      x4 <- Collapse1536CatalogTo96(cat.SBS1536.density.signature)
      expect_equal(colSums(cat.SBS1536.density.signature), colSums(x4))
      expect_equal("SBS96Catalog", class(x4)[1])
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x11724e60>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS1536Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 13. Error: Collapse1536CatalogTo96 block 1 (@test_CollapseCatalog.R#13)  ----
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.SBS1536Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS192Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS192Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_CollapseCatalog.R#48: TransformCatalog(cat.SBS192, target.ref.genome = "GRCh37", target.region = "transcript", 
      target.catalog.type = "density")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_CollapseCatalog.R#38: test_that("Collapse192CatalogTo96 block 2", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      cat.SBS192 <- ReadCatalog("testdata/regress.cat.sbs.192.csv", 
          ref.genome = "GRCh37", region = "transcript", catalog.type = "counts")
      x1 <- Collapse192CatalogTo96(cat.SBS192)
      expect_equal(colSums(cat.SBS192), colSums(x1))
      expect_equal("SBS96Catalog", class(x1)[1])
      cat.SBS192.density <- TransformCatalog(cat.SBS192, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density")
      x2 <- Collapse192CatalogTo96(cat.SBS192.density)
      expect_equal(colSums(cat.SBS192.density), colSums(x2))
      expect_equal("SBS96Catalog", class(x2)[1])
      cat.SBS192.counts.signature <- TransformCatalog(cat.SBS192, 
          target.ref.genome = "GRCh37", target.region = "transcript", 
          target.catalog.type = "counts.signature")
      x3 <- Collapse192CatalogTo96(cat.SBS192.counts.signature)
      expect_equal(colSums(cat.SBS192.counts.signature), colSums(x3))
      expect_equal("SBS96Catalog", class(x3)[1])
      cat.SBS192.density.signature <- TransformCatalog(cat.SBS192, 
          target.ref.genome = "GRCh37", target.region = "transcript", 
          target.catalog.type = "density.signature")
      x4 <- Collapse192CatalogTo96(cat.SBS192.density.signature)
      expect_equal(colSums(cat.SBS192.density.signature), colSums(x4))
      expect_equal("SBS96Catalog", class(x4)[1])
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x117bdf68>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS192Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 14. Error: Collapse192CatalogTo96 block 2 (@test_CollapseCatalog.R#48)  -----
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.SBS192Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS144Catalog`(out.catalog, rows, )
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.DBS144Catalog`(out.catalog, rows, )
  where 2: out.catalog[rows, ]
  where 3 at testthat/test_CollapseCatalog.R#83: TransformCatalog(cat.DBS144, target.ref.genome = "GRCh37", target.region = "transcript", 
      target.catalog.type = "density")
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_CollapseCatalog.R#73: test_that("Collapse144CatalogTo78", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      cat.DBS144 <- ReadCatalog("testdata/regress.cat.dbs.144.csv", 
          ref.genome = "GRCh37", region = "transcript", catalog.type = "counts")
      x1 <- Collapse144CatalogTo78(cat.DBS144)
      expect_equal(colSums(cat.DBS144), colSums(x1))
      expect_equal("DBS78Catalog", class(x1)[1])
      cat.DBS144.density <- TransformCatalog(cat.DBS144, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density")
      x2 <- Collapse144CatalogTo78(cat.DBS144.density)
      expect_equal(colSums(cat.DBS144.density), colSums(x2))
      expect_equal("DBS78Catalog", class(x2)[1])
      cat.DBS144.counts.signature <- TransformCatalog(cat.DBS144, 
          target.ref.genome = "GRCh37", target.region = "transcript", 
          target.catalog.type = "counts.signature")
      x3 <- Collapse144CatalogTo78(cat.DBS144.counts.signature)
      expect_equal(colSums(cat.DBS144.counts.signature), colSums(x3))
      expect_equal("DBS78Catalog", class(x3)[1])
      cat.DBS144.density.signature <- TransformCatalog(cat.DBS144, 
          target.ref.genome = "GRCh37", target.region = "transcript", 
          target.catalog.type = "density.signature")
      x4 <- Collapse144CatalogTo78(cat.DBS144.density.signature)
      expect_equal(colSums(cat.DBS144.density.signature), colSums(x4))
      expect_equal("DBS78Catalog", class(x4)[1])
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x11633728>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS144Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 15. Error: Collapse144CatalogTo78 (@test_CollapseCatalog.R#83)  -------------
  the condition has length > 1
  Backtrace:
   1. ICAMS::TransformCatalog(...)
   3. ICAMS:::`[.DBS144Catalog`(out.catalog, rows, )
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS136Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_PlotCatalog.DBS136Catalog.R#12: `[.DBS136Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2 at testthat/test_PlotCatalog.DBS136Catalog.R#12: catalog.counts[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_PlotCatalog.DBS136Catalog.R#3: test_that("PlotCatalog.DBS136Catalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      opar <- par(oma = c(2, 2, 2, 0))
      on.exit(par(opar))
      catalog.counts <- ReadCatalog("testdata/regress.cat.dbs.136.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      cat.counts <- catalog.counts[, 1, drop = FALSE]
      out <- PlotCatalog(cat.counts)
      expect_equal(out, TRUE)
      cat.density <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "density")
      out <- PlotCatalog(cat.density)
      expect_equal(out, TRUE)
      cat.counts.signature <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "counts.signature")
      expect_error(PlotCatalog(cat.counts.signature))
      cat.density.signature <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "density.signature")
      expect_error(PlotCatalog(cat.density.signature))
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x117ec138>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS136Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 16. Error: PlotCatalog.DBS136Catalog function (@test_PlotCatalog.DBS136Catalo
  the condition has length > 1
  Backtrace:
   1. catalog.counts[, 1, drop = FALSE]
   2. ICAMS:::`[.DBS136Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS144Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_PlotCatalog.DBS144Catalog.R#13: `[.DBS144Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2 at testthat/test_PlotCatalog.DBS144Catalog.R#13: catalog.counts[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_PlotCatalog.DBS144Catalog.R#3: test_that("PlotCatalog.DBS144Catalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      opar <- par(mar = c(1, 1, 1, 1))
      on.exit(par(opar))
      catalog.counts <- ReadCatalog("testdata/regress.cat.dbs.144.csv", 
          ref.genome = "GRCh37", region = "transcript", catalog.type = "counts")
      cat.counts <- catalog.counts[, 1, drop = FALSE]
      out <- PlotCatalog(cat.counts)
      expect_equal(out, TRUE)
      cat.density <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density")
      out <- PlotCatalog(cat.density)
      expect_equal(out, TRUE)
      cat.counts.signature <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "counts.signature")
      out <- PlotCatalog(cat.counts.signature)
      expect_equal(out, TRUE)
      cat.density.signature <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density.signature")
      out <- PlotCatalog(cat.density.signature)
      expect_equal(out, TRUE)
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x11633728>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS144Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 17. Error: PlotCatalog.DBS144Catalog function (@test_PlotCatalog.DBS144Catalo
  the condition has length > 1
  Backtrace:
   1. catalog.counts[, 1, drop = FALSE]
   2. ICAMS:::`[.DBS144Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS78Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_PlotCatalog.DBS78Catalog.R#11: `[.DBS78Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2 at testthat/test_PlotCatalog.DBS78Catalog.R#11: catalog.counts[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_PlotCatalog.DBS78Catalog.R#3: test_that("PlotCatalog.DBS78Catalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      opar <- par(mar = c(2, 2, 2, 1))
      on.exit(par(opar))
      catalog.counts <- ReadCatalog("testdata/regress.cat.dbs.78.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      cat.counts <- catalog.counts[, 1, drop = FALSE]
      out <- PlotCatalog(cat.counts)
      expect_equal(out, TRUE)
      cat.density <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "density")
      out <- PlotCatalog(cat.density)
      expect_equal(out, TRUE)
      cat.counts.signature <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "counts.signature")
      out <- PlotCatalog(cat.counts.signature)
      expect_equal(out, TRUE)
      cat.density.signature <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "density.signature")
      out <- PlotCatalog(cat.density.signature)
      expect_equal(out, TRUE)
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x115ae588>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS78Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 18. Error: PlotCatalog.DBS78Catalog function (@test_PlotCatalog.DBS78Catalog.
  the condition has length > 1
  Backtrace:
   1. catalog.counts[, 1, drop = FALSE]
   2. ICAMS:::`[.DBS78Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.IndelCatalog`(catalog, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_PlotCatalog.IndelCatalog.R#11: `[.IndelCatalog`(catalog, , 1, drop = FALSE)
  where 2 at testthat/test_PlotCatalog.IndelCatalog.R#11: catalog[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_PlotCatalog.IndelCatalog.R#3: test_that("PlotCatalog.IndelCatalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      opar <- par(mar = c(2, 2, 2, 1))
      on.exit(par(opar))
      catalog <- ReadCatalog("testdata/BTSG_WGS_PCAWG.indels.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      cat <- catalog[, 1, drop = FALSE]
      out <- PlotCatalog(cat)
      expect_equal(out, TRUE)
      cat.counts.signature <- apply(cat, MARGIN = 2, function(x) x/sum(x))
      cat.counts.signature <- as.catalog(cat.counts.signature, 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts.signature")
      out <- PlotCatalog(cat.counts.signature)
      expect_equal(out, TRUE)
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1164fa48>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.IndelCatalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 19. Error: PlotCatalog.IndelCatalog function (@test_PlotCatalog.IndelCatalog.
  the condition has length > 1
  Backtrace:
   1. catalog[, 1, drop = FALSE]
   2. ICAMS:::`[.IndelCatalog`(catalog, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS1536Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_PlotCatalog.SBS1536Catalog.R#9: `[.SBS1536Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2 at testthat/test_PlotCatalog.SBS1536Catalog.R#9: catalog.counts[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_PlotCatalog.SBS1536Catalog.R#3: test_that("PlotCatalog.SBS1536Catalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.sbs.1536.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      cat.counts <- catalog.counts[, 1, drop = FALSE]
      out <- PlotCatalog(cat.counts)
      expect_equal(out, TRUE)
      cat.density <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "density")
      out <- PlotCatalog(cat.density)
      expect_equal(out, TRUE)
      cat.counts.signature <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "counts.signature")
      out <- PlotCatalog(cat.counts.signature)
      expect_equal(out, TRUE)
      cat.density.signature <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "density.signature")
      out <- PlotCatalog(cat.density.signature)
      expect_equal(out, TRUE)
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x11724e60>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS1536Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 20. Error: PlotCatalog.SBS1536Catalog function (@test_PlotCatalog.SBS1536Cata
  the condition has length > 1
  Backtrace:
   1. catalog.counts[, 1, drop = FALSE]
   2. ICAMS:::`[.SBS1536Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS192Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_PlotCatalog.SBS192Catalog.R#12: `[.SBS192Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2 at testthat/test_PlotCatalog.SBS192Catalog.R#12: catalog.counts[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_PlotCatalog.SBS192Catalog.R#3: test_that("PlotCatalog.SBS192Catalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      opar <- par(mar = c(2, 2, 2, 1))
      on.exit(par(opar))
      catalog.counts <- ReadCatalog("testdata/regress.cat.sbs.192.csv", 
          ref.genome = "GRCh37", region = "transcript", catalog.type = "counts")
      cat.counts <- catalog.counts[, 1, drop = FALSE]
      out <- PlotCatalog(cat.counts)
      out1 <- PlotCatalog(cat.counts, plot.SBS12 = TRUE)
      expect_equal(out, TRUE)
      expect_equal(out1, TRUE)
      cat.density <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density")
      out <- PlotCatalog(cat.density)
      out1 <- PlotCatalog(cat.density, plot.SBS12 = TRUE)
      expect_equal(out, TRUE)
      expect_equal(out1, TRUE)
      cat.counts.signature <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "counts.signature")
      out <- PlotCatalog(cat.counts.signature)
      out1 <- PlotCatalog(cat.counts.signature, plot.SBS12 = TRUE)
      expect_equal(out, TRUE)
      expect_equal(out1, TRUE)
      cat.density.signature <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density.signature")
      out <- PlotCatalog(cat.density.signature)
      out1 <- PlotCatalog(cat.density.signature, plot.SBS12 = TRUE)
      expect_equal(out, TRUE)
      expect_equal(out1, TRUE)
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x117bdf68>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS192Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 21. Error: PlotCatalog.SBS192Catalog function (@test_PlotCatalog.SBS192Catalo
  the condition has length > 1
  Backtrace:
   1. catalog.counts[, 1, drop = FALSE]
   2. ICAMS:::`[.SBS192Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_PlotCatalog.SBS96Catalog.R#11: `[.SBS96Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2 at testthat/test_PlotCatalog.SBS96Catalog.R#11: catalog.counts[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_PlotCatalog.SBS96Catalog.R#3: test_that("PlotCatalog.SBS96Catalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      opar <- par(mar = c(1, 1, 1, 1))
      on.exit(par(opar))
      catalog.counts <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      cat.counts <- catalog.counts[, 1, drop = FALSE]
      out <- PlotCatalog(cat.counts)
      expect_equal(out, TRUE)
      cat.density <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "density")
      out <- PlotCatalog(cat.density)
      expect_equal(out, TRUE)
      cat.counts.signature <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "counts.signature")
      out <- PlotCatalog(cat.counts.signature)
      expect_equal(out, TRUE)
      cat.density.signature <- TransformCatalog(cat.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "density.signature")
      out <- PlotCatalog(cat.density.signature)
      expect_equal(out, TRUE)
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 22. Error: PlotCatalog.SBS96Catalog function (@test_PlotCatalog.SBS96Catalog.
  the condition has length > 1
  Backtrace:
   1. catalog.counts[, 1, drop = FALSE]
   2. ICAMS:::`[.SBS96Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS136Catalog`(catalog, , i, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.DBS136Catalog`(catalog, , i, drop = FALSE)
  where 2: catalog[, i, drop = FALSE]
  where 3: PlotCatalogToPdf.DBS136Catalog(catalog.counts, file = file.path(tempdir(), 
      "PlotCatDBS136.counts.test.pdf"))
  where 4 at testthat/test_PlotCatalogToPdf.DBS136Catalog.R#10: PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
      "PlotCatDBS136.counts.test.pdf"))
  where 5: eval(code, test_env)
  where 6: eval(code, test_env)
  where 7: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 13: tryCatchList(expr, classes, parentenv, handlers)
  where 14: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 15: test_code(desc, code, env = parent.frame())
  where 16 at testthat/test_PlotCatalogToPdf.DBS136Catalog.R#3: test_that("PlotCatalogToPdf.DBS136Catalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.dbs.136.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      out <- PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
          "PlotCatDBS136.counts.test.pdf"))
      expect_equal(out, TRUE)
      catalog.density <- TransformCatalog(catalog.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "density")
      out <- PlotCatalogToPdf(catalog.density, file = file.path(tempdir(), 
          "PlotCatDBS136.density.test.pdf"))
      expect_equal(out, TRUE)
      unlink(file.path(tempdir(), "PlotCatDBS136.counts.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatDBS136.density.test.pdf"))
      graphics.off()
  })
  where 17: eval(code, test_env)
  where 18: eval(code, test_env)
  where 19: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 23: doTryCatch(return(expr), name, parentenv, handler)
  where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 25: tryCatchList(expr, classes, parentenv, handlers)
  where 26: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 27: test_code(NULL, exprs, env)
  where 28: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 29: force(code)
  where 30: doWithOneRestart(return(expr), restart)
  where 31: withOneRestart(expr, restarts[[1L]])
  where 32: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 33: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 34: FUN(X[[i]], ...)
  where 35: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 36: force(code)
  where 37: doWithOneRestart(return(expr), restart)
  where 38: withOneRestart(expr, restarts[[1L]])
  where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 40: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 41: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 43: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x117ec138>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS136Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 23. Error: PlotCatalogToPdf.DBS136Catalog function (@test_PlotCatalogToPdf.DB
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalogToPdf(...)
   2. ICAMS:::PlotCatalogToPdf.DBS136Catalog(...)
   4. ICAMS:::`[.DBS136Catalog`(catalog, , i, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS144Catalog`(catalog, , i, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.DBS144Catalog`(catalog, , i, drop = FALSE)
  where 2: catalog[, i, drop = FALSE]
  where 3: PlotCatalogToPdf.DBS144Catalog(catalog.counts, file = file.path(tempdir(), 
      "PlotDBS144Catalog.counts.test.pdf"))
  where 4 at testthat/test_PlotCatalogToPdf.DBS144Catalog.R#11: PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
      "PlotDBS144Catalog.counts.test.pdf"))
  where 5: eval(code, test_env)
  where 6: eval(code, test_env)
  where 7: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 13: tryCatchList(expr, classes, parentenv, handlers)
  where 14: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 15: test_code(desc, code, env = parent.frame())
  where 16 at testthat/test_PlotCatalogToPdf.DBS144Catalog.R#3: test_that("PlotCatalogToPdf.DBS144Catalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.dbs.144.csv", 
          ref.genome = "GRCh37", region = "transcript", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      out <- PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
          "PlotDBS144Catalog.counts.test.pdf"))
      expect_equal(out, TRUE)
      catalog.density <- TransformCatalog(catalog.counts, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density")
      out <- PlotCatalogToPdf(catalog.density, file = file.path(tempdir(), 
          "PlotDBS144Catalog.density.test.pdf"))
      expect_equal(out, TRUE)
      catalog.counts.signature <- TransformCatalog(catalog.counts, 
          target.ref.genome = "GRCh37", target.region = "transcript", 
          target.catalog.type = "counts.signature")
      out <- PlotCatalogToPdf(catalog.counts.signature, file = file.path(tempdir(), 
          "PlotDBS144Catalog.counts.signature.test.pdf"))
      expect_equal(out, TRUE)
      catalog.density.signature <- TransformCatalog(catalog.counts, 
          target.ref.genome = "GRCh37", target.region = "transcript", 
          target.catalog.type = "density.signature")
      out <- PlotCatalogToPdf(catalog.density.signature, file = file.path(tempdir(), 
          "PlotDBS144Catalog.density.signature.test.pdf"))
      expect_equal(out, TRUE)
      unlink(file.path(tempdir(), "PlotDBS144Catalog.counts.test.pdf"))
      unlink(file.path(tempdir(), "PlotDBS144Catalog.density.test.pdf"))
      unlink(file.path(tempdir(), "PlotDBS144Catalog.counts.signature.test.pdf"))
      unlink(file.path(tempdir(), "PlotDBS144Catalog.density.signature.test.pdf"))
      graphics.off()
  })
  where 17: eval(code, test_env)
  where 18: eval(code, test_env)
  where 19: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 23: doTryCatch(return(expr), name, parentenv, handler)
  where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 25: tryCatchList(expr, classes, parentenv, handlers)
  where 26: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 27: test_code(NULL, exprs, env)
  where 28: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 29: force(code)
  where 30: doWithOneRestart(return(expr), restart)
  where 31: withOneRestart(expr, restarts[[1L]])
  where 32: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 33: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 34: FUN(X[[i]], ...)
  where 35: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 36: force(code)
  where 37: doWithOneRestart(return(expr), restart)
  where 38: withOneRestart(expr, restarts[[1L]])
  where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 40: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 41: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 43: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x11633728>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS144Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 24. Error: PlotCatalogToPdf.DBS144Catalog function (@test_PlotCatalogToPdf.DB
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalogToPdf(...)
   2. ICAMS:::PlotCatalogToPdf.DBS144Catalog(...)
   4. ICAMS:::`[.DBS144Catalog`(catalog, , i, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS78Catalog`(catalog, , i, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.DBS78Catalog`(catalog, , i, drop = FALSE)
  where 2: catalog[, i, drop = FALSE]
  where 3: PlotCatalogToPdf.DBS78Catalog(catalog.counts, file = file.path(tempdir(), 
      "PlotCatDBS78.counts.test.pdf"))
  where 4 at testthat/test_PlotCatalogToPdf.DBS78Catalog.R#10: PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
      "PlotCatDBS78.counts.test.pdf"))
  where 5: eval(code, test_env)
  where 6: eval(code, test_env)
  where 7: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 13: tryCatchList(expr, classes, parentenv, handlers)
  where 14: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 15: test_code(desc, code, env = parent.frame())
  where 16 at testthat/test_PlotCatalogToPdf.DBS78Catalog.R#3: test_that("PlotCatalogToPdf.DBS78Catalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.dbs.78.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      out <- PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
          "PlotCatDBS78.counts.test.pdf"))
      expect_equal(out, TRUE)
      catalog.density <- TransformCatalog(catalog.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "density")
      out <- PlotCatalogToPdf(catalog.density, file = file.path(tempdir(), 
          "PlotCatDBS78.density.test.pdf"))
      expect_equal(out, TRUE)
      catalog.counts.signature <- TransformCatalog(catalog.counts, 
          target.ref.genome = "GRCh37", target.region = "genome", 
          target.catalog.type = "counts.signature")
      out <- PlotCatalogToPdf(catalog.counts.signature, file = file.path(tempdir(), 
          "PlotCatDBS78.counts.signature.test.pdf"))
      expect_equal(out, TRUE)
      catalog.density.signature <- TransformCatalog(catalog.counts, 
          target.ref.genome = "GRCh37", target.region = "genome", 
          target.catalog.type = "density.signature")
      out <- PlotCatalogToPdf(catalog.density.signature, file = file.path(tempdir(), 
          "PlotCatDBS78.density.signature.test.pdf"))
      expect_equal(out, TRUE)
      unlink(file.path(tempdir(), "PlotCatDBS78.counts.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatDBS78.density.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatDBS78.counts.signature.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatDBS78.density.signature.test.pdf"))
      graphics.off()
  })
  where 17: eval(code, test_env)
  where 18: eval(code, test_env)
  where 19: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 23: doTryCatch(return(expr), name, parentenv, handler)
  where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 25: tryCatchList(expr, classes, parentenv, handlers)
  where 26: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 27: test_code(NULL, exprs, env)
  where 28: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 29: force(code)
  where 30: doWithOneRestart(return(expr), restart)
  where 31: withOneRestart(expr, restarts[[1L]])
  where 32: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 33: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 34: FUN(X[[i]], ...)
  where 35: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 36: force(code)
  where 37: doWithOneRestart(return(expr), restart)
  where 38: withOneRestart(expr, restarts[[1L]])
  where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 40: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 41: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 43: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x115ae588>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS78Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 25. Error: PlotCatalogToPdf.DBS78Catalog function (@test_PlotCatalogToPdf.DBS
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalogToPdf(...)
   2. ICAMS:::PlotCatalogToPdf.DBS78Catalog(...)
   4. ICAMS:::`[.DBS78Catalog`(catalog, , i, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.IndelCatalog`(catalog, , i, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.IndelCatalog`(catalog, , i, drop = FALSE)
  where 2: catalog[, i, drop = FALSE]
  where 3: PlotCatalogToPdf.IndelCatalog(catalog.counts, file = file.path(tempdir(), 
      "PlotCatID.counts.test.pdf"))
  where 4 at testthat/test_PlotCatalogToPdf.IndelCatalog.R#10: PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
      "PlotCatID.counts.test.pdf"))
  where 5: eval(code, test_env)
  where 6: eval(code, test_env)
  where 7: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 13: tryCatchList(expr, classes, parentenv, handlers)
  where 14: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 15: test_code(desc, code, env = parent.frame())
  where 16 at testthat/test_PlotCatalogToPdf.IndelCatalog.R#3: test_that("PlotCatalogToPdf.IndelCatalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/BTSG_WGS_PCAWG.indels.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("Biliary-AdenoCA", 1:35)
      out <- PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
          "PlotCatID.counts.test.pdf"))
      expect_equal(out, TRUE)
      catalog.counts.signature <- apply(catalog.counts, MARGIN = 2, 
          function(x) x/sum(x))
      catalog.counts.signature <- as.catalog(catalog.counts.signature, 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts.signature")
      out <- PlotCatalogToPdf(catalog.counts.signature, file = file.path(tempdir(), 
          "PlotCatID.counts.signature.test.pdf"))
      expect_equal(out, TRUE)
      unlink(file.path(tempdir(), "PlotCatID.counts.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatID.counts.signature.test.pdf"))
      graphics.off()
  })
  where 17: eval(code, test_env)
  where 18: eval(code, test_env)
  where 19: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 23: doTryCatch(return(expr), name, parentenv, handler)
  where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 25: tryCatchList(expr, classes, parentenv, handlers)
  where 26: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 27: test_code(NULL, exprs, env)
  where 28: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 29: force(code)
  where 30: doWithOneRestart(return(expr), restart)
  where 31: withOneRestart(expr, restarts[[1L]])
  where 32: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 33: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 34: FUN(X[[i]], ...)
  where 35: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 36: force(code)
  where 37: doWithOneRestart(return(expr), restart)
  where 38: withOneRestart(expr, restarts[[1L]])
  where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 40: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 41: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 43: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1164fa48>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.IndelCatalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 26. Error: PlotCatalogToPdf.IndelCatalog function (@test_PlotCatalogToPdf.Ind
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalogToPdf(...)
   2. ICAMS:::PlotCatalogToPdf.IndelCatalog(...)
   4. ICAMS:::`[.IndelCatalog`(catalog, , i, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS1536Catalog`(catalog, , i, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS1536Catalog`(catalog, , i, drop = FALSE)
  where 2: catalog[, i, drop = FALSE]
  where 3: PlotCatalogToPdf.SBS1536Catalog(catalog.counts, file = file.path(tempdir(), 
      "PlotCatSBS1536.counts.test.pdf"))
  where 4 at testthat/test_PlotCatalogToPdf.SBS1536Catalog.R#10: PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
      "PlotCatSBS1536.counts.test.pdf"))
  where 5: eval(code, test_env)
  where 6: eval(code, test_env)
  where 7: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 13: tryCatchList(expr, classes, parentenv, handlers)
  where 14: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 15: test_code(desc, code, env = parent.frame())
  where 16 at testthat/test_PlotCatalogToPdf.SBS1536Catalog.R#3: test_that("PlotCatalogToPdf.SBS1536Catalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.sbs.1536.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      out <- PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
          "PlotCatSBS1536.counts.test.pdf"))
      expect_equal(out, TRUE)
      catalog.density <- TransformCatalog(catalog.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "density")
      out <- PlotCatalogToPdf(catalog.density, file = file.path(tempdir(), 
          "PlotCatSBS1536.density.test.pdf"))
      expect_equal(out, TRUE)
      catalog.counts.signature <- TransformCatalog(catalog.counts, 
          target.ref.genome = "GRCh37", target.region = "genome", 
          target.catalog.type = "counts.signature")
      out <- PlotCatalogToPdf(catalog.counts.signature, file = file.path(tempdir(), 
          "PlotCatSBS1536.counts.signature.test.pdf"))
      expect_equal(out, TRUE)
      catalog.density.signature <- TransformCatalog(catalog.counts, 
          target.ref.genome = "GRCh37", target.region = "genome", 
          target.catalog.type = "density.signature")
      out <- PlotCatalogToPdf(catalog.density.signature, file = file.path(tempdir(), 
          "PlotCatSBS1536.density.signature.test.pdf"))
      expect_equal(out, TRUE)
      unlink(file.path(tempdir(), "PlotCatSBS1536.counts.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatSBS1536.density.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatSBS1536.counts.signature.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatSBS1536.density.signature.test.pdf"))
      graphics.off()
  })
  where 17: eval(code, test_env)
  where 18: eval(code, test_env)
  where 19: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 23: doTryCatch(return(expr), name, parentenv, handler)
  where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 25: tryCatchList(expr, classes, parentenv, handlers)
  where 26: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 27: test_code(NULL, exprs, env)
  where 28: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 29: force(code)
  where 30: doWithOneRestart(return(expr), restart)
  where 31: withOneRestart(expr, restarts[[1L]])
  where 32: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 33: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 34: FUN(X[[i]], ...)
  where 35: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 36: force(code)
  where 37: doWithOneRestart(return(expr), restart)
  where 38: withOneRestart(expr, restarts[[1L]])
  where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 40: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 41: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 43: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x11724e60>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS1536Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 27. Error: PlotCatalogToPdf.SBS1536Catalog function (@test_PlotCatalogToPdf.S
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalogToPdf(...)
   2. ICAMS:::PlotCatalogToPdf.SBS1536Catalog(...)
   4. ICAMS:::`[.SBS1536Catalog`(catalog, , i, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS192Catalog`(catalog, , i, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS192Catalog`(catalog, , i, drop = FALSE)
  where 2: catalog[, i, drop = FALSE]
  where 3: PlotCatalogToPdf.SBS192Catalog(catalog.counts, file = file.path(tempdir(), 
      "PlotCatSBS192.counts.test.pdf"))
  where 4 at testthat/test_PlotCatalogToPdf.SBS192Catalog.R#10: PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
      "PlotCatSBS192.counts.test.pdf"))
  where 5: eval(code, test_env)
  where 6: eval(code, test_env)
  where 7: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 13: tryCatchList(expr, classes, parentenv, handlers)
  where 14: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 15: test_code(desc, code, env = parent.frame())
  where 16 at testthat/test_PlotCatalogToPdf.SBS192Catalog.R#3: test_that("PlotCatalogToPdf.SBS192Catalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.sbs.192.csv", 
          ref.genome = "GRCh37", region = "transcript", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      out <- PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
          "PlotCatSBS192.counts.test.pdf"))
      out1 <- PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
          "PlotCatalog.SBS12.counts.test.pdf"), plot.SBS12 = TRUE)
      expect_equal(out, TRUE)
      expect_equal(out1, TRUE)
      catalog.density <- TransformCatalog(catalog.counts, target.ref.genome = "GRCh37", 
          target.region = "transcript", target.catalog.type = "density")
      out <- PlotCatalogToPdf(catalog.density, file = file.path(tempdir(), 
          "PlotCatSBS192.density.test.pdf"))
      out1 <- PlotCatalogToPdf(catalog.density, file = file.path(tempdir(), 
          "PlotCatalog.SBS12.density.test.pdf"), plot.SBS12 = TRUE)
      expect_equal(out, TRUE)
      expect_equal(out1, TRUE)
      catalog.counts.signature <- TransformCatalog(catalog.counts, 
          target.ref.genome = "GRCh37", target.region = "transcript", 
          target.catalog.type = "counts.signature")
      out <- PlotCatalogToPdf(catalog.counts.signature, file = file.path(tempdir(), 
          "PlotCatSBS192.counts.signature.test.pdf"))
      out1 <- PlotCatalogToPdf(catalog.counts.signature, file = file.path(tempdir(), 
          "PlotCatalog.SBS12.counts.signature.test.pdf"), plot.SBS12 = TRUE)
      expect_equal(out, TRUE)
      expect_equal(out1, TRUE)
      catalog.density.signature <- TransformCatalog(catalog.counts, 
          target.ref.genome = "GRCh37", target.region = "transcript", 
          target.catalog.type = "density.signature")
      out <- PlotCatalogToPdf(catalog.density.signature, file = file.path(tempdir(), 
          "PlotCatSBS192.density.signature.test.pdf"))
      out1 <- PlotCatalogToPdf(catalog.density.signature, file = file.path(tempdir(), 
          "PlotCatalog.SBS12.density.signature.test.pdf"), plot.SBS12 = TRUE)
      expect_equal(out, TRUE)
      expect_equal(out1, TRUE)
      unlink(file.path(tempdir(), "PlotCatSBS192.counts.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatSBS192.density.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatSBS192.counts.signature.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatSBS192.density.signature.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatalog.SBS12.counts.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatalog.SBS12.density.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatalog.SBS12.counts.signature.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatalog.SBS12.density.signature.test.pdf"))
      graphics.off()
  })
  where 17: eval(code, test_env)
  where 18: eval(code, test_env)
  where 19: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 23: doTryCatch(return(expr), name, parentenv, handler)
  where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 25: tryCatchList(expr, classes, parentenv, handlers)
  where 26: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 27: test_code(NULL, exprs, env)
  where 28: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 29: force(code)
  where 30: doWithOneRestart(return(expr), restart)
  where 31: withOneRestart(expr, restarts[[1L]])
  where 32: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 33: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 34: FUN(X[[i]], ...)
  where 35: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 36: force(code)
  where 37: doWithOneRestart(return(expr), restart)
  where 38: withOneRestart(expr, restarts[[1L]])
  where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 40: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 41: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 43: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x117bdf68>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS192Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 28. Error: PlotCatalogToPdf.SBS192Catalog function (@test_PlotCatalogToPdf.SB
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalogToPdf(...)
   2. ICAMS:::PlotCatalogToPdf.SBS192Catalog(...)
   4. ICAMS:::`[.SBS192Catalog`(catalog, , i, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(catalog, , i, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS96Catalog`(catalog, , i, drop = FALSE)
  where 2: catalog[, i, drop = FALSE]
  where 3: PlotCatalogToPdf.SBS96Catalog(catalog.counts, file = file.path(tempdir(), 
      "PlotCatSBS96.counts.test.pdf"))
  where 4 at testthat/test_PlotCatalogToPdf.SBS96Catalog.R#10: PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
      "PlotCatSBS96.counts.test.pdf"))
  where 5: eval(code, test_env)
  where 6: eval(code, test_env)
  where 7: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 8: doTryCatch(return(expr), name, parentenv, handler)
  where 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 10: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 13: tryCatchList(expr, classes, parentenv, handlers)
  where 14: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 15: test_code(desc, code, env = parent.frame())
  where 16 at testthat/test_PlotCatalogToPdf.SBS96Catalog.R#3: test_that("PlotCatalogToPdf.SBS96Catalog function", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      out <- PlotCatalogToPdf(catalog.counts, file = file.path(tempdir(), 
          "PlotCatSBS96.counts.test.pdf"))
      expect_equal(out, TRUE)
      catalog.density <- TransformCatalog(catalog.counts, target.ref.genome = "GRCh37", 
          target.region = "genome", target.catalog.type = "density")
      out <- PlotCatalogToPdf(catalog.density, file = file.path(tempdir(), 
          "PlotCatSBS96.density.test.pdf"))
      expect_equal(out, TRUE)
      catalog.counts.signature <- TransformCatalog(catalog.counts, 
          target.ref.genome = "GRCh37", target.region = "genome", 
          target.catalog.type = "counts.signature")
      out <- PlotCatalogToPdf(catalog.counts.signature, file = file.path(tempdir(), 
          "PlotCatSBS96.counts.signature.test.pdf"))
      expect_equal(out, TRUE)
      catalog.density.signature <- TransformCatalog(catalog.counts, 
          target.ref.genome = "GRCh37", target.region = "genome", 
          target.catalog.type = "density.signature")
      out <- PlotCatalogToPdf(catalog.density.signature, file = file.path(tempdir(), 
          "PlotCatSBS96.density.signature.test.pdf"))
      expect_equal(out, TRUE)
      unlink(file.path(tempdir(), "PlotCatSBS96.counts.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatSBS96.density.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatSBS96.counts.signature.test.pdf"))
      unlink(file.path(tempdir(), "PlotCatSBS96.density.signature.test.pdf"))
      graphics.off()
  })
  where 17: eval(code, test_env)
  where 18: eval(code, test_env)
  where 19: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 20: doTryCatch(return(expr), name, parentenv, handler)
  where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 22: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 23: doTryCatch(return(expr), name, parentenv, handler)
  where 24: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 25: tryCatchList(expr, classes, parentenv, handlers)
  where 26: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 27: test_code(NULL, exprs, env)
  where 28: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 29: force(code)
  where 30: doWithOneRestart(return(expr), restart)
  where 31: withOneRestart(expr, restarts[[1L]])
  where 32: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 33: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 34: FUN(X[[i]], ...)
  where 35: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 36: force(code)
  where 37: doWithOneRestart(return(expr), restart)
  where 38: withOneRestart(expr, restarts[[1L]])
  where 39: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 40: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 41: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 43: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 44: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 29. Error: PlotCatalogToPdf.SBS96Catalog function (@test_PlotCatalogToPdf.SBS
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalogToPdf(...)
   2. ICAMS:::PlotCatalogToPdf.SBS96Catalog(...)
   4. ICAMS:::`[.SBS96Catalog`(catalog, , i, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(catalog, row.order, , drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS96Catalog`(catalog, row.order, , drop = FALSE)
  where 2: catalog[row.order, , drop = FALSE]
  where 3: WriteCat(catalog, file, 96, ICAMS::catalog.row.order$SBS96, catalog.row.headers.SBS.96, 
      strict)
  where 4: WriteCatalog.SBS96Catalog(ct1, f)
  where 5 at testthat/test_ReadWriteCatalog.R#48: my.write(ct1, f)
  where 6: (function(my.read, my.write, my.file, my.region) {
      ct1 <- my.read(my.file, ref.genome = "GRCh37",
                     region = my.region, catalog.type = "counts")
      f <- tempfile("catalog")
      my.write(ct1, f)
      ct2 <- my.read(f, ref.genome = "GRCh37",
                     region = my.region, catalog.type = "counts")
      expect_equal(ct1, ct2)
    })(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]], dots[[4L]][[1L]])
  where 7 at testthat/test_ReadWriteCatalog.R#54: mapply(Test1Cat, read.fn, write.fn, fl, a.region)
  where 8: eval(code, test_env)
  where 9: eval(code, test_env)
  where 10: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 11: doTryCatch(return(expr), name, parentenv, handler)
  where 12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 13: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 14: doTryCatch(return(expr), name, parentenv, handler)
  where 15: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 16: tryCatchList(expr, classes, parentenv, handlers)
  where 17: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 18: test_code(desc, code, env = parent.frame())
  where 19 at testthat/test_ReadWriteCatalog.R#3: test_that("Functions for reading and writing catalogs", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      read.fn <- c(ReadCatalog, ReadCatalog, ReadCatalog, ReadCatalog, 
          ReadCatalog, ReadCatalog, ReadCatalog)
      write.fn <- c(WriteCatalog, WriteCatalog, WriteCatalog, WriteCatalog, 
          WriteCatalog, WriteCatalog, WriteCatalog)
      fl <- c("testdata/BTSG_WGS_PCAWG.sbs.96.csv", "testdata/BTSG_WGS_PCAWG.sbs.192.csv", 
          "testdata/BTSG_WGS_PCAWG.sbs.1536.csv", "testdata/BTSG_WGS_PCAWG.dbs.78.csv", 
          "testdata/HepG2.dbs.144.csv", "testdata/HepG2.dbs.136.csv", 
          "testdata/BTSG_WGS_PCAWG.indels.csv")
      a.region <- c("genome", "transcript", "genome", "genome", 
          "transcript", "genome", "genome")
      Test1Cat <- function(my.read, my.write, my.file, my.region) {
          ct1 <- my.read(my.file, ref.genome = "GRCh37", region = my.region, 
              catalog.type = "counts")
          f <- tempfile("catalog")
          my.write(ct1, f)
          ct2 <- my.read(f, ref.genome = "GRCh37", region = my.region, 
              catalog.type = "counts")
          expect_equal(ct1, ct2)
      }
      discard <- mapply(Test1Cat, read.fn, write.fn, fl, a.region)
      temp.files <- list.files(tempdir(), full.names = TRUE, pattern = "^catalog")
      invisible(file.remove(temp.files))
  })
  where 20: eval(code, test_env)
  where 21: eval(code, test_env)
  where 22: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 23: doTryCatch(return(expr), name, parentenv, handler)
  where 24: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 25: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 26: doTryCatch(return(expr), name, parentenv, handler)
  where 27: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 28: tryCatchList(expr, classes, parentenv, handlers)
  where 29: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 30: test_code(NULL, exprs, env)
  where 31: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 32: force(code)
  where 33: doWithOneRestart(return(expr), restart)
  where 34: withOneRestart(expr, restarts[[1L]])
  where 35: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 36: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 37: FUN(X[[i]], ...)
  where 38: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 39: force(code)
  where 40: doWithOneRestart(return(expr), restart)
  where 41: withOneRestart(expr, restarts[[1L]])
  where 42: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 43: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 44: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 45: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 46: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 47: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 30. Error: Functions for reading and writing catalogs (@test_ReadWriteCatalog
  the condition has length > 1
  Backtrace:
   1. base::mapply(Test1Cat, read.fn, write.fn, fl, a.region)
   4. ICAMS:::WriteCatalog.SBS96Catalog(ct1, f)
   5. ICAMS:::WriteCat(...)
   7. ICAMS:::`[.SBS96Catalog`(catalog, row.order, , drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_cbind_catalogs.R#11: `[.SBS96Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2 at testthat/test_cbind_catalogs.R#11: catalog.counts[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_cbind_catalogs.R#3: test_that("cbind method for SBS96Catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      cat1 <- catalog.counts[, 1, drop = FALSE]
      cat2 <- catalog.counts[, 2, drop = FALSE]
      cat3 <- cbind(cat1, cat2)
      out <- PlotCatalogToPdf(cat3, file = file.path(tempdir(), 
          "test.pdf"))
      expect_equal(out, TRUE)
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 31. Error: cbind method for SBS96Catalog (@test_cbind_catalogs.R#11)  -------
  the condition has length > 1
  Backtrace:
   1. catalog.counts[, 1, drop = FALSE]
   2. ICAMS:::`[.SBS96Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS192Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_cbind_catalogs.R#28: `[.SBS192Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2 at testthat/test_cbind_catalogs.R#28: catalog.counts[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_cbind_catalogs.R#19: test_that("cbind method for SBS192Catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.sbs.192.csv", 
          ref.genome = "GRCh37", region = "transcript", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      cat1 <- catalog.counts[, 1, drop = FALSE]
      cat2 <- catalog.counts[, 2, drop = FALSE]
      cat3 <- cbind(cat1, cat2)
      out <- PlotCatalogToPdf(cat3, file = file.path(tempdir(), 
          "test.pdf"))
      expect_equal(out, TRUE)
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x117bdf68>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS192Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 32. Error: cbind method for SBS192Catalog (@test_cbind_catalogs.R#28)  ------
  the condition has length > 1
  Backtrace:
   1. catalog.counts[, 1, drop = FALSE]
   2. ICAMS:::`[.SBS192Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS1536Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_cbind_catalogs.R#44: `[.SBS1536Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2 at testthat/test_cbind_catalogs.R#44: catalog.counts[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_cbind_catalogs.R#36: test_that("cbind method for SBS1536Catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.sbs.1536.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      cat1 <- catalog.counts[, 1, drop = FALSE]
      cat2 <- catalog.counts[, 2, drop = FALSE]
      cat3 <- cbind(cat1, cat2)
      out <- PlotCatalogToPdf(cat3, file = file.path(tempdir(), 
          "test.pdf"))
      expect_equal(out, TRUE)
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x11724e60>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS1536Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 33. Error: cbind method for SBS1536Catalog (@test_cbind_catalogs.R#44)  -----
  the condition has length > 1
  Backtrace:
   1. catalog.counts[, 1, drop = FALSE]
   2. ICAMS:::`[.SBS1536Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS78Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_cbind_catalogs.R#60: `[.DBS78Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2 at testthat/test_cbind_catalogs.R#60: catalog.counts[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_cbind_catalogs.R#52: test_that("cbind method for DBS78Catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.dbs.78.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      cat1 <- catalog.counts[, 1, drop = FALSE]
      cat2 <- catalog.counts[, 2, drop = FALSE]
      cat3 <- cbind(cat1, cat2)
      out <- PlotCatalogToPdf(cat3, file = file.path(tempdir(), 
          "test.pdf"))
      expect_equal(out, TRUE)
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x115ae588>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS78Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 34. Error: cbind method for DBS78Catalog (@test_cbind_catalogs.R#60)  -------
  the condition has length > 1
  Backtrace:
   1. catalog.counts[, 1, drop = FALSE]
   2. ICAMS:::`[.DBS78Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS144Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_cbind_catalogs.R#77: `[.DBS144Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2 at testthat/test_cbind_catalogs.R#77: catalog.counts[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_cbind_catalogs.R#68: test_that("cbind method for DBS144Catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.dbs.144.csv", 
          ref.genome = "GRCh37", region = "transcript", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      cat1 <- catalog.counts[, 1, drop = FALSE]
      cat2 <- catalog.counts[, 2, drop = FALSE]
      cat3 <- cbind(cat1, cat2)
      out <- PlotCatalogToPdf(cat3, file = file.path(tempdir(), 
          "test.pdf"))
      expect_equal(out, TRUE)
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x11633728>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS144Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 35. Error: cbind method for DBS144Catalog (@test_cbind_catalogs.R#77)  ------
  the condition has length > 1
  Backtrace:
   1. catalog.counts[, 1, drop = FALSE]
   2. ICAMS:::`[.DBS144Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS136Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_cbind_catalogs.R#94: `[.DBS136Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2 at testthat/test_cbind_catalogs.R#94: catalog.counts[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_cbind_catalogs.R#85: test_that("cbind method for DBS136Catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.dbs.136.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      cat1 <- catalog.counts[, 1, drop = FALSE]
      cat2 <- catalog.counts[, 2, drop = FALSE]
      cat3 <- cbind(cat1, cat2)
      out <- PlotCatalogToPdf(cat3, file = file.path(tempdir(), 
          "test.pdf"))
      expect_equal(out, TRUE)
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x117ec138>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS136Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 36. Error: cbind method for DBS136Catalog (@test_cbind_catalogs.R#94)  ------
  the condition has length > 1
  Backtrace:
   1. catalog.counts[, 1, drop = FALSE]
   2. ICAMS:::`[.DBS136Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.IndelCatalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1 at testthat/test_cbind_catalogs.R#109: `[.IndelCatalog`(catalog.counts, , 1, drop = FALSE)
  where 2 at testthat/test_cbind_catalogs.R#109: catalog.counts[, 1, drop = FALSE]
  where 3: eval(code, test_env)
  where 4: eval(code, test_env)
  where 5: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 6: doTryCatch(return(expr), name, parentenv, handler)
  where 7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 8: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 9: doTryCatch(return(expr), name, parentenv, handler)
  where 10: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 11: tryCatchList(expr, classes, parentenv, handlers)
  where 12: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 13: test_code(desc, code, env = parent.frame())
  where 14 at testthat/test_cbind_catalogs.R#102: test_that("cbind method for IndelCatalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/BTSG_WGS_PCAWG.indels.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      cat1 <- catalog.counts[, 1, drop = FALSE]
      cat2 <- catalog.counts[, 2, drop = FALSE]
      cat3 <- cbind(cat1, cat2)
      out <- PlotCatalogToPdf(cat3, file = file.path(tempdir(), 
          "test.pdf"))
      expect_equal(out, TRUE)
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 15: eval(code, test_env)
  where 16: eval(code, test_env)
  where 17: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 18: doTryCatch(return(expr), name, parentenv, handler)
  where 19: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 20: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 21: doTryCatch(return(expr), name, parentenv, handler)
  where 22: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 23: tryCatchList(expr, classes, parentenv, handlers)
  where 24: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 25: test_code(NULL, exprs, env)
  where 26: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 27: force(code)
  where 28: doWithOneRestart(return(expr), restart)
  where 29: withOneRestart(expr, restarts[[1L]])
  where 30: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 31: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 32: FUN(X[[i]], ...)
  where 33: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 34: force(code)
  where 35: doWithOneRestart(return(expr), restart)
  where 36: withOneRestart(expr, restarts[[1L]])
  where 37: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 38: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 39: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 40: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 41: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 42: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1164fa48>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.IndelCatalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 37. Error: cbind method for IndelCatalog (@test_cbind_catalogs.R#109)  ------
  the condition has length > 1
  Backtrace:
   1. catalog.counts[, 1, drop = FALSE]
   2. ICAMS:::`[.IndelCatalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS96Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS96Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2: catalog.counts[, 1, drop = FALSE]
  where 3 at testthat/test_methods_for_subsetting_catalogs.R#10: PlotCatalog(catalog.counts[, 1, drop = FALSE])
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_methods_for_subsetting_catalogs.R#3: test_that("[ method for SBS96Catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.sbs.96.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      out1 <- PlotCatalog(catalog.counts[, 1, drop = FALSE])
      out2 <- PlotCatalogToPdf(catalog.counts[, 1, drop = FALSE], 
          file = file.path(tempdir(), "test.pdf"))
      expect_equal(out1, TRUE)
      expect_equal(out2, TRUE)
      expect_error(PlotCatalog(catalog.counts[, 1]))
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1172e5d8>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS96Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 38. Error: [ method for SBS96Catalog (@test_methods_for_subsetting_catalogs.R
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalog(catalog.counts[, 1, drop = FALSE])
   3. ICAMS:::`[.SBS96Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS192Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS192Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2: catalog.counts[, 1, drop = FALSE]
  where 3 at testthat/test_methods_for_subsetting_catalogs.R#27: PlotCatalog(catalog.counts[, 1, drop = FALSE])
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_methods_for_subsetting_catalogs.R#19: test_that("[ method for SBS192Catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.sbs.192.csv", 
          ref.genome = "GRCh37", region = "transcript", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      out1 <- PlotCatalog(catalog.counts[, 1, drop = FALSE])
      out2 <- PlotCatalogToPdf(catalog.counts[, 1, drop = FALSE], 
          file = file.path(tempdir(), "test.pdf"))
      expect_equal(out1, TRUE)
      expect_equal(out2, TRUE)
      expect_error(PlotCatalog(catalog.counts[, 1]))
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x117bdf68>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS192Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 39. Error: [ method for SBS192Catalog (@test_methods_for_subsetting_catalogs.
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalog(catalog.counts[, 1, drop = FALSE])
   3. ICAMS:::`[.SBS192Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.SBS1536Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.SBS1536Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2: catalog.counts[, 1, drop = FALSE]
  where 3 at testthat/test_methods_for_subsetting_catalogs.R#43: PlotCatalog(catalog.counts[, 1, drop = FALSE])
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_methods_for_subsetting_catalogs.R#36: test_that("[ method for SBS1536Catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.sbs.1536.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      out1 <- PlotCatalog(catalog.counts[, 1, drop = FALSE])
      out2 <- PlotCatalogToPdf(catalog.counts[, 1, drop = FALSE], 
          file = file.path(tempdir(), "test.pdf"))
      expect_equal(out1, TRUE)
      expect_equal(out2, TRUE)
      expect_error(PlotCatalog(catalog.counts[, 1]))
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x11724e60>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.SBS1536Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 40. Error: [ method for SBS1536Catalog (@test_methods_for_subsetting_catalogs
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalog(catalog.counts[, 1, drop = FALSE])
   3. ICAMS:::`[.SBS1536Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS78Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.DBS78Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2: catalog.counts[, 1, drop = FALSE]
  where 3 at testthat/test_methods_for_subsetting_catalogs.R#59: PlotCatalog(catalog.counts[, 1, drop = FALSE])
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_methods_for_subsetting_catalogs.R#52: test_that("[ method for DBS78Catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.dbs.78.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      out1 <- PlotCatalog(catalog.counts[, 1, drop = FALSE])
      out2 <- PlotCatalogToPdf(catalog.counts[, 1, drop = FALSE], 
          file = file.path(tempdir(), "test.pdf"))
      expect_equal(out1, TRUE)
      expect_equal(out2, TRUE)
      expect_error(PlotCatalog(catalog.counts[, 1]))
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x115ae588>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS78Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 41. Error: [ method for DBS78Catalog (@test_methods_for_subsetting_catalogs.R
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalog(catalog.counts[, 1, drop = FALSE])
   3. ICAMS:::`[.DBS78Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS144Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.DBS144Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2: catalog.counts[, 1, drop = FALSE]
  where 3 at testthat/test_methods_for_subsetting_catalogs.R#76: PlotCatalog(catalog.counts[, 1, drop = FALSE])
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_methods_for_subsetting_catalogs.R#68: test_that("[ method for DBS144Catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.dbs.144.csv", 
          ref.genome = "GRCh37", region = "transcript", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      out1 <- PlotCatalog(catalog.counts[, 1, drop = FALSE])
      out2 <- PlotCatalogToPdf(catalog.counts[, 1, drop = FALSE], 
          file = file.path(tempdir(), "test.pdf"))
      expect_equal(out1, TRUE)
      expect_equal(out2, TRUE)
      expect_error(PlotCatalog(catalog.counts[, 1]))
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x11633728>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS144Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 42. Error: [ method for DBS144Catalog (@test_methods_for_subsetting_catalogs.
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalog(catalog.counts[, 1, drop = FALSE])
   3. ICAMS:::`[.DBS144Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.DBS136Catalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.DBS136Catalog`(catalog.counts, , 1, drop = FALSE)
  where 2: catalog.counts[, 1, drop = FALSE]
  where 3 at testthat/test_methods_for_subsetting_catalogs.R#92: PlotCatalog(catalog.counts[, 1, drop = FALSE])
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_methods_for_subsetting_catalogs.R#85: test_that("[ method for DBS136Catalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/regress.cat.dbs.136.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      colnames(catalog.counts) <- paste0("HepG2_", 1:4)
      out1 <- PlotCatalog(catalog.counts[, 1, drop = FALSE])
      out2 <- PlotCatalogToPdf(catalog.counts[, 1, drop = FALSE], 
          file = file.path(tempdir(), "test.pdf"))
      expect_equal(out1, TRUE)
      expect_equal(out2, TRUE)
      expect_error(PlotCatalog(catalog.counts[, 1]))
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x117ec138>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.DBS136Catalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 43. Error: [ method for DBS136Catalog (@test_methods_for_subsetting_catalogs.
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalog(catalog.counts[, 1, drop = FALSE])
   3. ICAMS:::`[.DBS136Catalog`(catalog.counts, , 1, drop = FALSE)
  
   ----------- FAILURE REPORT -------------- 
   --- failure: the condition has length > 1 ---
   --- srcref --- 
  : 
   --- package (from environment) --- 
  ICAMS
   --- call from context --- 
  `[.IndelCatalog`(catalog.counts, , 1, drop = FALSE)
   --- call from argument --- 
  if (class(y) %in% c("integer", "numeric")) {
      return(y)
  } else {
      class(y) <- class(x)
      for (at in c("ref.genome", "catalog.type", "abundance", "region")) {
          attr(y, at) <- attr(x, at, exact = TRUE)
      }
      return(y)
  }
   --- R stacktrace ---
  where 1: `[.IndelCatalog`(catalog.counts, , 1, drop = FALSE)
  where 2: catalog.counts[, 1, drop = FALSE]
  where 3 at testthat/test_methods_for_subsetting_catalogs.R#107: PlotCatalog(catalog.counts[, 1, drop = FALSE])
  where 4: eval(code, test_env)
  where 5: eval(code, test_env)
  where 6: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 7: doTryCatch(return(expr), name, parentenv, handler)
  where 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 10: doTryCatch(return(expr), name, parentenv, handler)
  where 11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 12: tryCatchList(expr, classes, parentenv, handlers)
  where 13: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 14: test_code(desc, code, env = parent.frame())
  where 15 at testthat/test_methods_for_subsetting_catalogs.R#101: test_that("[ method for IndelCatalog", {
      skip_if("" == system.file(package = "BSgenome.Hsapiens.1000genomes.hs37d5"))
      stopifnot(requireNamespace("BSgenome.Hsapiens.1000genomes.hs37d5"))
      catalog.counts <- ReadCatalog("testdata/BTSG_WGS_PCAWG.indels.csv", 
          ref.genome = "GRCh37", region = "genome", catalog.type = "counts")
      out1 <- PlotCatalog(catalog.counts[, 1, drop = FALSE])
      out2 <- PlotCatalogToPdf(catalog.counts[, 1, drop = FALSE], 
          file = file.path(tempdir(), "test.pdf"))
      expect_equal(out1, TRUE)
      expect_equal(out2, TRUE)
      expect_error(PlotCatalog(catalog.counts[, 1]))
      unlink(file.path(tempdir(), "test.pdf"))
  })
  where 16: eval(code, test_env)
  where 17: eval(code, test_env)
  where 18: withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error)
  where 19: doTryCatch(return(expr), name, parentenv, handler)
  where 20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  where 21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  where 22: doTryCatch(return(expr), name, parentenv, handler)
  where 23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), 
      names[nh], parentenv, handlers[[nh]])
  where 24: tryCatchList(expr, classes, parentenv, handlers)
  where 25: tryCatch(withCallingHandlers({
      eval(code, test_env)
      if (!handled && !is.null(test)) {
          skip_empty()
      }
  }, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, 
      message = handle_message, error = handle_error), error = handle_fatal, 
      skip = function(e) {
      })
  where 26: test_code(NULL, exprs, env)
  where 27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
  where 28: force(code)
  where 29: doWithOneRestart(return(expr), restart)
  where 30: withOneRestart(expr, restarts[[1L]])
  where 31: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 32: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, 
      {
          reporter$start_file(basename(path))
          lister$start_file(basename(path))
          source_file(path, new.env(parent = env), chdir = TRUE, 
              wrap = wrap)
          reporter$.end_context()
          reporter$end_file()
      })
  where 33: FUN(X[[i]], ...)
  where 34: lapply(paths, test_file, env = env, reporter = current_reporter, 
      start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
  where 35: force(code)
  where 36: doWithOneRestart(return(expr), restart)
  where 37: withOneRestart(expr, restarts[[1L]])
  where 38: withRestarts(testthat_abort_reporter = function() NULL, force(code))
  where 39: with_reporter(reporter = current_reporter, results <- lapply(paths, 
      test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, 
      load_helpers = FALSE, wrap = wrap))
  where 40: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 41: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, 
      ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 
      wrap = wrap)
  where 42: test_package_dir(package = package, test_path = test_path, filter = filter, 
      reporter = reporter, ..., stop_on_failure = stop_on_failure, 
      stop_on_warning = stop_on_warning, wrap = wrap)
  where 43: test_check("ICAMS")
  
   --- value of length: 2 type: logical ---
  [1] FALSE FALSE
   --- function from context --- 
  function (x, i, j, drop = if (missing(i)) TRUE else length(cols) == 
      1) 
  {
      y <- NextMethod("[")
      if (class(y) %in% c("integer", "numeric")) {
          return(y)
      }
      else {
          class(y) <- class(x)
          for (at in c("ref.genome", "catalog.type", "abundance", 
              "region")) {
              attr(y, at) <- attr(x, at, exact = TRUE)
          }
          return(y)
      }
  }
  <bytecode: 0x1164fa48>
  <environment: namespace:ICAMS>
   --- function search by body ---
  Function [.IndelCatalog in namespace ICAMS has this body.
   ----------- END OF FAILURE REPORT -------------- 
  -- 44. Error: [ method for IndelCatalog (@test_methods_for_subsetting_catalogs.R
  the condition has length > 1
  Backtrace:
   1. ICAMS::PlotCatalog(catalog.counts[, 1, drop = FALSE])
   3. ICAMS:::`[.IndelCatalog`(catalog.counts, , 1, drop = FALSE)
  
  == testthat results  ===========================================================
  [ OK: 116 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 44 ]
  1. Error: Transformation of a DBS 144 catalog (@test_0TransformCatalogDBS144.R#10) 
  2. Error: Transformation of a SBS 192 catalog (@test_0TransformCatalogSBS192.R#11) 
  3. Error: Legal transformation 1;
  counts -> counts; genome counts -> exome counts,
  and exome counts -> genome counts (@test_1TransformCatalog.R#12) 
  4. Error: Legal transformation 2;
  counts -> density; genome counts -> density,
  and genome counts -> exome count -> density (@test_1TransformCatalog.R#34) 
  5. Error: Legal transformation 3;
  counts -> density; genome GRCh37 counts -> genome GRCh37 density,
  and genome GRCh37 counts -> genome GRCh38 counts -> genome GRCh38 density (@test_1TransformCatalog.R#63) 
  6. Error: Legal transformations 1, 2, and 4;
  genome GRCh37 counts -> genome GRCh38 counts,
  and genome GRCh37 counts -> genome GRCh37 density -> genome GRCh38 counts (@test_1TransformCatalog.R#92) 
  7. Error: Legal transformation 4; density -> (genome) counts (@test_1TransformCatalog.R#115) 
  8. Error: Legal transformation 5;
  density -> counts.signature, density -> density.signature (@test_1TransformCatalog.R#134) 
  9. Error: Legal transformations 3 and 6;
  genome counts -> exome counts.signature,
  and genome counts.signature -> exome counts.signature (@test_1TransformCatalog.R#160) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted