Skip to content

Commit 134fd43

Browse files
committed
Added more unit tests. - 2
1 parent 2ee0c4b commit 134fd43

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

tests/testthat/test-do_CorrelationHeatmap.R

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,42 @@ if (base::isFALSE(dep_check[["do_CorrelationHeatmap"]])){
5757
testthat::test_that("do_CorrelationHeatmap: PASS - group.by", {
5858
testthat::skip_on_cran()
5959

60-
genes <- list("A" = Seurat::VariableFeatures(sample)[1:5],
61-
"B" = Seurat::VariableFeatures(sample)[6:10],
62-
"C" = Seurat::VariableFeatures(sample)[11:15])
60+
genes <- list("A" = Seurat::VariableFeatures(sample)[1:50],
61+
"B" = Seurat::VariableFeatures(sample)[25:75],
62+
"C" = Seurat::VariableFeatures(sample)[50:101])
6363

6464
p <- SCpubr::do_CorrelationHeatmap(sample = sample,
6565
group.by = "seurat_clusters")
6666
testthat::expect_true("ggplot" %in% class(p))
67+
68+
p <- SCpubr::do_CorrelationHeatmap(sample = sample,
69+
input_gene_list = genes,
70+
group.by = "seurat_clusters",
71+
mode = "jaccard")
72+
testthat::expect_true("ggplot" %in% class(p))
73+
74+
p <- SCpubr::do_CorrelationHeatmap(sample = sample,
75+
input_gene_list = genes,
76+
group.by = "seurat_clusters",
77+
mode = "jaccard",
78+
min.cutoff = 0.01,
79+
max.cutoff = 0.02)
80+
testthat::expect_true("ggplot" %in% class(p))
81+
82+
p <- SCpubr::do_CorrelationHeatmap(sample = sample,
83+
input_gene_list = genes,
84+
group.by = "seurat_clusters",
85+
mode = "jaccard",
86+
cluster = TRUE)
87+
testthat::expect_true("ggplot" %in% class(p))
88+
89+
p <- SCpubr::do_CorrelationHeatmap(sample = sample,
90+
input_gene_list = genes,
91+
group.by = "seurat_clusters",
92+
mode = "jaccard",
93+
values.show = TRUE,
94+
values.threshold = 0.01)
95+
testthat::expect_true("ggplot" %in% class(p))
6796
})
6897

6998
testthat::test_that("do_CorrelationHeatmap: PASS - group.by - rotate axis labels", {

0 commit comments

Comments
 (0)