Skip to content

Commit 7f845e8

Browse files
authored
Merge pull request #284 from stemangiola/allow-tidy-expression-in-test_gene_overrepresentation
modify test to allow tidy mutate
2 parents c09ed7d + 56c98a3 commit 7f845e8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

R/methods.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3727,7 +3727,7 @@ setGeneric("test_gene_overrepresentation", function(.data,
37273727
stop("tidybulk says: the .entrez parameter appears to no be set")
37283728

37293729
# Check column type
3730-
if (.data |> distinct(!!.do_test) |> sapply(class) %in% c("logical") |> not() |> any())
3730+
if (.data %>% mutate(my_do_test = !!.do_test) %>% pull(my_do_test) |> is("logical") |> not() )
37313731
stop("tidybulk says: .do_test column must be logical (i.e., TRUE or FALSE)")
37323732

37333733
# Check packages msigdbr

R/methods_SE.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2099,7 +2099,7 @@ setMethod("test_gene_enrichment",
20992099
stop("tidybulk says: the .entrez parameter appears to no be set")
21002100

21012101
# Check column type
2102-
if (.data %>% rowData() %>% as_tibble() %>% distinct(!!.do_test) %>% sapply(class) %in% c("logical") %>% not() %>% any)
2102+
if (.data %>% rowData() %>% as_tibble(rownames = f_(.data)$name) %>% mutate(my_do_test = !!.do_test) %>% pull(my_do_test) |> is("logical") %>% not())
21032103
stop("tidybulk says: .do_test column must be logical (i.e., TRUE or FALSE)")
21042104

21052105
# Check packages msigdbr

0 commit comments

Comments
 (0)