Skip to content

Commit

Permalink
relax unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CATALYST-project committed Jun 27, 2024
1 parent b1f61de commit 1bbfee2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/testthat/test_plotMultiHeatmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test_that("plotMultiHeatmap() - hm2 = 'abundances'", {
p <- plotMultiHeatmap(x, hm2 = "abundances", k = k, normalize = FALSE)
y <- p@ht_list$frequency@matrix
expect_is(p, "HeatmapList")
expect_true(all(colSums(y) == 1))
expect_equivalent(colSums(y), rep(1, ncol(y)))
expect_equal(c(y), c(prop.table(table(kids, x$sample_id), 2)))
})

Expand All @@ -40,7 +40,7 @@ test_that("plotMultiHeatmap() - hm2 = 'state'", {
summarize_at(state_markers(x), median) %>%
do(.[, state_markers(x)]) %>%
do.call(what = "cbind")
expect_identical(c(y), c(ms))
expect_equal(c(y), c(ms))
})

test_that("plotMultiHeatmap() - hm2 = specific state markers", {
Expand All @@ -54,8 +54,8 @@ test_that("plotMultiHeatmap() - hm2 = specific state markers", {
replace(., is.na(.), 0) %>% {( lapply(ms, function(m)
acast(., cluster_id~sample_id, value.var = m)) )}
for (i in seq_along(ms)) {
expect_identical(p@ht_list[[i+1]]@column_title, ms[i])
expect_identical(p@ht_list[[i+1]]@matrix, meds[[i]])
expect_equal(p@ht_list[[i+1]]@column_title, ms[i])
expect_equal(p@ht_list[[i+1]]@matrix, meds[[i]])
}
})

Expand Down

0 comments on commit 1bbfee2

Please sign in to comment.