From 580da5ddccf636b6ebd2966c0ff4072ef799aadc Mon Sep 17 00:00:00 2001 From: PauBadiaM Date: Thu, 22 Feb 2024 10:29:58 +0100 Subject: [PATCH] Fixed test for Seurat v5 --- tests/testthat/test-viper_wrapper.R | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/testthat/test-viper_wrapper.R b/tests/testthat/test-viper_wrapper.R index 51b7bd2..af36742 100644 --- a/tests/testthat/test-viper_wrapper.R +++ b/tests/testthat/test-viper_wrapper.R @@ -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, @@ -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( @@ -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_")) })