tests/testthat/test-identifyTSNs.R

test_that("identify TSNs", {
  df <- tibble(ID5 = rep(c(10,20,30,40,50), c(1,5,2,6,2))) %>%
    mutate(ID3 = length(ID5) %>% runif %>% '*'(10) %>% floor,
    R = c(8, 2, 0, 1, 1, 1, 8, 0, 0, 0, 0, 0, 0, 3, 2, 5)) %>% setDT
    expect_equal(identifyTSNsR(dat = df, nDistinctPauseThresh = 3, nReadsThresh = 5), 20)
    expect_equal(identifyTSNsR(dat = df, nDistinctPauseThresh = 1, nReadsThresh = 1), c(10, 20, 30, 40, 50))
    expect_equal(identifyTSNsR(dat = df, nDistinctPauseThresh = 2, nReadsThresh = 6), 50)
})
Timothy-Barry/coproanalysis documentation built on Feb. 12, 2020, 7:33 a.m.