From bd1ff441a1775942164287831c14079d8640db07 Mon Sep 17 00:00:00 2001 From: HediaTnani Date: Thu, 4 Jan 2024 11:47:59 -0500 Subject: [PATCH] Add comments to the tests of getDegTx --- tests/testthat/test-getDegTx.R | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/testthat/test-getDegTx.R b/tests/testthat/test-getDegTx.R index 6db9e79..a30013d 100644 --- a/tests/testthat/test-getDegTx.R +++ b/tests/testthat/test-getDegTx.R @@ -1,16 +1,21 @@ +# Filter out lowly expressed transcripts and test if the number of rows in getDegTx output matches expected transcript count rse_tx_low <- covComb_tx_deg[rowMeans(assays(covComb_tx_deg)$tpm) < 1, ] test_that("length for number of rows is the same a length sig_transcripts", { expect_equal(length(rownames(getDegTx(covComb_tx_deg))), length(select_transcripts("cell_component"))) }) +# Test if number of columns in getDegTx output matches number of columns in original dataset test_that("length for number of columns is the same a length sig_transcripts", { expect_equal(length(colnames(getDegTx(covComb_tx_deg))), length(colnames(covComb_tx_deg))) }) +# Test if getDegTx returns an object of the same class as its input test_that("output is an RSE", { expect_equal(class(getDegTx(covComb_tx_deg)), class(covComb_tx_deg)) }) +# Test for a warning when getDegTx is used on a dataset with lowly expressed transcripts test_that("test warning output for lowly expressed transcripts", { expect_warning(getDegTx(rse_tx_low)) }) +