@sjcrh/proteinpaint-server 2.120.1 → 2.121.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/utils/edge.R CHANGED
@@ -107,6 +107,13 @@ filter_using_cpm_time <- system.time({
107
107
  })
108
108
  #cat("Filter using cpm time: ", as.difftime(filter_using_cpm_time, units = "secs")[3], " seconds\n")
109
109
 
110
+ if (dim(y)[1]==0) { # Its possible after filtering there might not be any genes left in the matrix, in such a case the R code must exit gracefully with an error.
111
+ stop("Number of genes after filtering = 0, cannot proceed any further")
112
+ }
113
+ if (dim(y)[2]==0) { # Its possible after filtering there might not be any samples left in the matrix, in such a case the R code must exit gracefully with an error.
114
+ stop("Number of samples after filtering = 0, cannot proceed any further")
115
+ }
116
+
110
117
  # Saving MDS plot image
111
118
 
112
119
  if (dim(read_counts)[1] * dim(read_counts)[2] < as.numeric(input$mds_cutoff)) { # If the dimensions of the read counts matrix is below this threshold, only then the mds image will be generated as its very compute intensive