Skip to content

Commit

Permalink
Fixed test for Seurat v5
Browse files Browse the repository at this point in the history
  • Loading branch information
PauBadiaM committed Feb 22, 2024
1 parent 840f4d9 commit 580da5d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/testthat/test-viper_wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ test_that("test run_viper with seurat as input", {
m <- readRDS(
system.file("testdata", "toy_seurat.rds", package = "dorothea")
)
m <- Seurat::UpdateSeuratObject(m)
r <- dplyr::filter(dorothea_hs, confidence %in% c("A", "B"))

res <- run_viper(m, r, options = list(method = "scale", minsize = 4,
Expand All @@ -78,9 +79,9 @@ test_that("test run_viper with seurat as input", {
expected_res <- readRDS(
system.file("testdata", "output_seurat.rds", package = "dorothea")
)

expect_equal(res@assays$dorothea, expected_res@assays$dorothea)
expect_equal(tidy_res@assays$dorothea, expected_res@assays$dorothea)
expected_res <- Seurat::UpdateSeuratObject(expected_res)
expect_equal(res@assays$dorothea$data, expected_res@assays$dorothea$data)
expect_equal(tidy_res@assays$dorothea$data, expected_res@assays$dorothea$data)

# check raised warning when tidy is set to T
expect_warning(
Expand All @@ -92,7 +93,7 @@ test_that("test run_viper with seurat as input", {
"'tidy' is set to FALSE"))

# Check key of seurat assays
expect_equal(unname(Seurat::Key(res)), c("rna_","dorothea_"))
expect_equal(unname(Seurat::Key(res)), c("md_", "rna_","dorothea_"))
})


Expand Down

0 comments on commit 580da5d

Please sign in to comment.