-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathtest-which_panel.R
More file actions
56 lines (42 loc) · 1.79 KB
/
Copy pathtest-which_panel.R
File metadata and controls
56 lines (42 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
test_that("test one gene only in IMPACT505", {
hugo_symbol <- "ZNRF3"
test <- which_impact_panel(hugo_symbol)
expect_equal(ncol(test), 8)
expect_equal(nrow(test), length(hugo_symbol))
expect_equal(test$IMPACT505, "yes")
expect_equal(test$IMPACT468, "no")
expect_equal(test$IMPACT410, "no")
expect_equal(test$IMPACT341, "no")
expect_equal(test$`IMPACT-HEME-400`, "no")
expect_equal(test$`IMPACT-HEME-468`, "no")
expect_equal(test$ACCESS129, "no")
})
test_that("test vector of genes including recodes", {
hugo_symbol <- c("SOS1", "AGO2", "MLL3", "MLL", "TP53")
expect_message(test <- which_impact_panel(hugo_symbol))
expect_equal(ncol(test), 8)
expect_equal(nrow(test), length(hugo_symbol))
expect_false("MLL3" %in% test$genes_in_panel)
expect_false("MLL" %in% test$genes_in_panel)
expect_true("KMT2C" %in% test$genes_in_panel)
expect_equal(test$IMPACT505[test$genes_in_panel == "TP53"], "yes")
expect_equal(test$IMPACT468[test$genes_in_panel == "TP53"], "yes")
expect_equal(test$IMPACT410[test$genes_in_panel == "TP53"], "yes")
expect_equal(test$IMPACT341[test$genes_in_panel == "TP53"], "yes")
expect_equal(test$`IMPACT-HEME-400`[test$genes_in_panel == "TP53"], "yes")
expect_equal(test$`IMPACT-HEME-468`[test$genes_in_panel == "TP53"], "yes")
expect_equal(test$ACCESS129[test$genes_in_panel == "TP53"], "yes")
})
test_that("test non-impact gene", {
hugo_symbol <- c("XXX")
test <- which_impact_panel(hugo_symbol)
expect_equal(ncol(test), 8)
expect_equal(nrow(test), length(hugo_symbol))
expect_equal(test$IMPACT505, "no")
expect_equal(test$IMPACT468, "no")
expect_equal(test$IMPACT410, "no")
expect_equal(test$IMPACT341, "no")
expect_equal(test$`IMPACT-HEME-400`, "no")
expect_equal(test$`IMPACT-HEME-468`, "no")
expect_equal(test$ACCESS129, "no")
})