Skip to content

Commit

Permalink
Add error message for check if the length of 'common' is greater than 0
Browse files Browse the repository at this point in the history
  • Loading branch information
HediaTnani committed Jan 9, 2024
1 parent bdb45a0 commit e62f580
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion R/DEqual.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ DEqual <- function(DE) {

## Locate common transcripts
common <- intersect(rownames(qsvaR::degradation_tstats), rownames(DE))
stopifnot(length(common) > 0)
#stopifnot(length(common) > 0)

# Check if the length of 'common' is greater than 0
if (length(common) <= 0) {
stop("Error: The length of 'common' should be greater than 0.")
}


common_data <- data.frame(
degradation_t = qsvaR::degradation_tstats$t[match(common, rownames(qsvaR::degradation_tstats))],
DE_t = DE$t[match(common, rownames(DE))]
Expand Down

0 comments on commit e62f580

Please sign in to comment.