From e62f580200935fd7938902c37c9ca9ad94705e09 Mon Sep 17 00:00:00 2001 From: HediaTnani Date: Tue, 9 Jan 2024 14:11:34 -0500 Subject: [PATCH] Add error message for check if the length of 'common' is greater than 0 --- R/DEqual.R | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/R/DEqual.R b/R/DEqual.R index e3c31f5..45862d9 100644 --- a/R/DEqual.R +++ b/R/DEqual.R @@ -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))]