tests/testthat/test_binNormalize.R

test_that("binNormalize", {
  library(svbams)
  library(Rsamtools)
  library(svfilters.hg19)
  data(bins1kb)
  extdir <- system.file("extdata", package="svbams", mustWork=TRUE)
  bamfile <- file.path(extdir, "cgov10t.bam")
  bins <- keepSeqlevels(bins1kb, "chr3", pruning.mode="coarse")
  bins <- subsetByOverlaps(bins, GRanges("chr3", IRanges(59600000, 61000000)))
  bviews <- BamViews(bamRanges=bins, bamPaths=bamfile)
  bins$cnt <- binnedCounts(bviews)
  normalized <- binNormalize(bins)
  expect_that(length(normalized), equals(1378))
  width <- width(bins)
  expect_that(width[1], equals(1000))
  expect_that(normalized, is_a ("numeric"))
  }
)
cancer-genomics/trellis documentation built on Feb. 2, 2023, 7:04 p.m.