|
a |
|
b/tests/testthat/test-enrichment.R |
|
|
1 |
context("ORA") |
|
|
2 |
|
|
|
3 |
test_that("get_interaction_from_ORA fails on invalid imput", { |
|
|
4 |
query <- c("IL15", "CDHR5", "TGFA", 'C4B') |
|
|
5 |
expect_error(get_interaction_from_ORA(query, sources = "qowiudjh")) |
|
|
6 |
expect_error(get_interaction_from_ORA(query, sources = c("GO", "KEGG"))) |
|
|
7 |
}) |
|
|
8 |
|
|
|
9 |
test_that("get_interaction_from_ORA works ", { |
|
|
10 |
query <- c("IL15", "CDHR5", "TGFA", 'C4B') |
|
|
11 |
expect_is(get_interaction_from_ORA(query, sources = "GO"), "igraph") |
|
|
12 |
expect_is(get_interaction_from_ORA(query, sources = c("KEGG")), "NULL") |
|
|
13 |
|
|
|
14 |
|
|
|
15 |
query <- list("All" = c("IL15", "CDHR5", "TGFA", 'C4B'), |
|
|
16 |
"c1" = c("IL15", "CDHR5", "TGFA")) |
|
|
17 |
expect_is(get_interaction_from_ORA(query, sources = "GO"), "list.igraph") |
|
|
18 |
query <- list(c("IL15", "CDHR5", "TGFA", 'C4B'), c("IL15", "CDHR5", "TGFA")) |
|
|
19 |
expect_is(get_interaction_from_ORA(query, sources = "GO"), "list.igraph") |
|
|
20 |
|
|
|
21 |
}) |
|
|
22 |
|
|
|
23 |
test_that("get_ORA works", { |
|
|
24 |
query <- list("All" = c("IL15", "CDHR5", "TGFA", 'C4B'), |
|
|
25 |
"c1" = c("IL15", "CDHR5", "TGFA")) |
|
|
26 |
expect_is(get_ORA(query), "data.frame") |
|
|
27 |
query <- c("IL15") |
|
|
28 |
expect_is(get_ORA(query), "data.frame") |
|
|
29 |
}) |
|
|
30 |
|
|
|
31 |
# test_that("get_go_info works", { |
|
|
32 |
# expect_is(get_go_info("GO:0044216"), "data.frame") |
|
|
33 |
# }) |