Browse code

adding extra check on the intgroup parameter to make sure it is encoded in the data to be plotted

Federico Marini authored on 10/03/2023 15:05:30
Showing 1 changed files

... ...
@@ -94,6 +94,13 @@ gene_plot <- function(dds,
94 94
     res_enrich <- gtl$res_enrich
95 95
     annotation_obj <- gtl$annotation_obj
96 96
   }
97
+  
98
+  if (!intgroup %in% colnames(colData(dds))) {
99
+    stop("`intgroup` not found in the colData slot of the dds object",
100
+         "\nPlease specify one of the following: \n",
101
+         paste0(colnames(colData(dds)), collapse = ", ")
102
+         )
103
+  }
97 104
 
98 105
   df <- get_expression_values(
99 106
     dds = dds,