tests/testthat/test-get_cai.R

test_that("CAI = 1 for a reference with no bias", {
    cf <- matrix(1, nrow = 1, ncol = 64)
    colnames(cf) <- sort(names(Biostrings::GENETIC_CODE))
    rscu <- est_rscu(cf)
    cf2 <- cf
    cf2[] <- sample.int(64, 64)
    cai <- get_cai(cf2, rscu)
    expect_equal(cai, 1)
})

Try the cubar package in your browser

Any scripts or data that you put into this service are public.

cubar documentation built on April 3, 2025, 8:58 p.m.