Skip to content

Commit

Permalink
Change the error message in the unit test and remove the check in the…
Browse files Browse the repository at this point in the history
… DEqual function

Co-authored-by: Nick Eagles <[email protected]>
  • Loading branch information
HediaTnani and Nick-Eagles committed Jan 11, 2024
1 parent 5fef6c3 commit 0ef284c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions R/DEqual.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ DEqual <- function(DE) {
stop("'DE' and degradation t-statistics rownames mismatch error.")
}

# Check if all rownames start with "ENST"
if (!all(grepl("^ENST", rownames(DE)))) {
stop("Some rownames do not start with 'ENST'.")
}

## Locate common transcripts
is_gencode = all(grepl("^ENST.*?\\.", rownames(DE)))
is_ensembl = all(grepl("^ENST", rownames(DE)) & !grepl("\\.", rownames(DE)))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-DEqual.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test_that("DEqual correctly processes random_de", {
rownames(altered_random_de)[1] <- "INVALID0001" # Change the first rowname to an invalid one

# Expect an error when rownames do not start with "ENST"
expect_error(DEqual(altered_random_de), "Error: Some rownames do not start with 'ENST'.")
expect_error(DEqual(altered_random_de), "The rownames of the input dataframe should be either GENCODE or ENSEMBL transcript IDs.")
})

# Test: None of the DE rownames are in degradation_tstats rownames
Expand Down

0 comments on commit 0ef284c

Please sign in to comment.