tests/testthat/test-msigdbr-collections.R

test_that("msigdbr_collections()", {
  chs <- msigdbr_collections(db_species = "Hs")
  expect_identical(chs, msigdbr_collections())
  expect_s3_class(chs, "tbl_df")
  expect_gt(nrow(chs), 10)
  expect_lt(nrow(chs), 30)
  expect_match(chs$gs_collection, "H", fixed = TRUE, all = FALSE)
  expect_match(chs$gs_collection, "C2", fixed = TRUE, all = FALSE)
  expect_match(chs$gs_collection, "C7", fixed = TRUE, all = FALSE)
  expect_match(chs$gs_collection, "C8", fixed = TRUE, all = FALSE)
  cmm <- msigdbr_collections(db_species = "Mm")
  expect_s3_class(cmm, "tbl_df")
  expect_gt(nrow(cmm), 10)
  expect_lt(nrow(cmm), 30)
  expect_match(cmm$gs_collection, "MH", fixed = TRUE, all = FALSE)
  expect_match(cmm$gs_collection, "M8", fixed = TRUE, all = FALSE)
})

Try the msigdbr package in your browser

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

msigdbr documentation built on June 8, 2025, 11:39 a.m.