tests/testthat/test-gs_volcano.R

context("Testing the GO volcano plot and related functionality")

test_that("Plot is generated", {
  expect_error(
    gs_volcano(res_enrich_IFNg_vs_naive))

  res_enrich_withscores <- get_aggrscores(res_enrich_IFNg_vs_naive,
                                          res_macrophage_IFNg_vs_naive,
                                          annotation_obj = anno_df,
                                          aggrfun = mean)
  expect_is(gs_volcano(res_enrich_withscores), "gg")

  expect_error(
    gs_volcano(
      res_enrich_withscores,
      color_by = "fake_col")
  )
})

test_that("mds plot with custom genesets", {
  mygenesets <- res_enrich_IFNg_vs_naive$gs_id[c(1, 10, 20)]
  res_enrich_withscores <- get_aggrscores(res_enrich_IFNg_vs_naive,
                                          res_macrophage_IFNg_vs_naive,
                                          annotation_obj = anno_df,
                                          aggrfun = mean)
  expect_is(
    gs_volcano(res_enrich_withscores,
               gs_ids = mygenesets,
               plot_title = "mytitle-volcano"),
    "gg")
})

Try the GeneTonic package in your browser

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

GeneTonic documentation built on Nov. 8, 2020, 5:27 p.m.