diff testandplot.R @ 74:2bb6b44093ba draft

Uploaded 20170619
author fabio
date Mon, 19 Jun 2017 12:08:59 -0400
parents 1e677d6b1aaf
children
line wrap: on
line diff
--- a/testandplot.R	Wed Jun 14 15:20:56 2017 -0400
+++ b/testandplot.R	Mon Jun 19 12:08:59 2017 -0400
@@ -32,16 +32,16 @@
   id_region2=regionids[region2]
   id_features_subset=featureids[features_subset]
   if(length(setdiff(c(id_region1,id_region2),idRegions(regionsFeatures)))!=0){
+    write("Wrong region ids.", stderr())
     quit(save="no", status=10)
-    stop('Wrong region ids')
   }
   if(length(setdiff(id_features_subset,idFeatures(regionsFeatures)))!=0){
+    write("Wrong feature ids.", stderr())
     quit(save="no", status=20)
-    stop('Wrong feature ids')
   }
   if(sum(duplicated(paste0(id_region1,id_region2)))){
+    write("Same test repeated multiple times.", stderr())
     quit(save="no", status=30)
-    stop('Same test repeated multiple times.')
   }
   
   # perform test
@@ -67,8 +67,8 @@
       }
     }
   }, error = function(err) {
+    write("Testing error.", stderr())
     quit(save="no", status=40) #error testing
-    stop(err)
   })
   
   # plot test results
@@ -94,6 +94,6 @@
   write.table(as.data.frame(t(idFeatures(regionsFeatures_test))),file=iwtomicsselectedfeatures,quote=FALSE,sep='\t',row.names=FALSE,col.names=FALSE)
   save(regionsFeatures_test,file=iwtomicsrdata)
 }else{
+  write("Missing IWTomics package. Please be sure to have it installed before using this tool.", stderr())
   quit(save="no", status=255)
-  stop("Missing IWTomics package")
 }
\ No newline at end of file