diff w4mcorcov_wrapper.R @ 1:0c2ad44b6c9c draft

planemo upload for repository https://github.com/HegemanLab/w4mcorcov_galaxy_wrapper/tree/master commit 01d4a951cf09e7b88fcec96b8043bc7568cc5c92
author eschen42
date Sun, 22 Oct 2017 18:47:57 -0400
parents 23f9fad4edfc
children e03582f26617
line wrap: on
line diff
--- a/w4mcorcov_wrapper.R	Mon Oct 16 14:56:52 2017 -0400
+++ b/w4mcorcov_wrapper.R	Sun Oct 22 18:47:57 2017 -0400
@@ -72,7 +72,25 @@
 my_env$pairSigFeatOnly <- as.logical(argVc["pairSigFeatOnly"])
 my_env$levCSV          <- as.character(argVc["levCSV"])
 my_env$matchingC       <- as.character(argVc["matchingC"])
-my_env$labelFeatures   <- as.logical(argVc["labelFeatures"])
+my_env$labelFeatures   <- as.character(argVc["labelFeatures"]) # number of features to label at each extreme of the loadings or 'ALL'
+
+label_features <- my_env$labelFeatures
+labelfeatures_check <- TRUE
+if ( is.na(label_features) ) {
+  labelfeatures_check <- FALSE
+} else if ( is.null(label_features) ) {
+  labelfeatures_check <- FALSE
+} else if (label_features != "ALL") {
+  if ( is.na(as.numeric(label_features)) )
+    labelfeatures_check <- FALSE
+  else if ( as.numeric(label_features) < 0 )
+    labelfeatures_check <- FALSE
+}
+if ( !labelfeatures_check ) {
+  my_log("invalid argument: labelFeatures")
+  print(label_features)
+  quit(save = "no", status = 10, runLast = TRUE)
+}
 
 tsv_action_factory <- function(file, colnames, append) {
   return (