Skip to content

Commit

Permalink
Fixing broken hyp_dots test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdchen committed Aug 31, 2023
1 parent 5e3b409 commit a74b3b8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/testthat/test-hyp_dots.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ hyp_dots_tests <- function(hyp_obj, return_obj=FALSE) {
expect_silent(hyp_dots(hyp_obj, size_by="genesets"))
expect_silent(hyp_dots(hyp_obj, size_by="significance"))
expect_silent(hyp_dots(hyp_obj, size_by="none"))
p <- hyp_dots(hyp_obj, "gg")
p <- hyp_dots(hyp_obj)
expect_is(p, "gg")
if (return_obj) return(hyp_obj)
}
Expand All @@ -17,11 +17,11 @@ test_that("hyp_dots() is working", {
testdat <- readRDS(file.path(system.file("extdata", package="hypeR"), "testdat.rds"))
gsets_obj <- testdat$gsets
rgsets_obj <- testdat$rgsets

# Overrepresentation (signature)
signature <- testdat$signature
experiment <- testdat$experiment

hypeR(signature, gsets_obj, test="hypergeometric", background=100) %>%
hyp_dots_tests()
hypeR(signature, rgsets_obj, test="hypergeometric", background=100) %>%
Expand All @@ -31,7 +31,7 @@ test_that("hyp_dots() is working", {
expect_equal(length(p), 3)
expect_equal(names(p), c("Signature 1", "Signature 2", "Signature 3"))
expect_is(p[["Signature 3"]], "gg")

# Enrichment (ranked signature)
signature <- names(testdat$weighted_signature)
experiment <- lapply(testdat$weighted_experiment, names)
Expand All @@ -45,11 +45,11 @@ test_that("hyp_dots() is working", {
expect_equal(length(p), 3)
expect_equal(names(p), c("Signature 1", "Signature 2", "Signature 3"))
expect_is(p[["Signature 3"]], "gg")

# Enrichment (weighted signature)
signature <- testdat$weighted_signature
experiment <- testdat$weighted_experiment

hypeR(signature, gsets_obj, test="kstest") %>%
hyp_dots_tests()
hypeR(signature, rgsets_obj, test="kstest") %>%
Expand Down

0 comments on commit a74b3b8

Please sign in to comment.