diff Intchecks/wrapper_intensity_check.R @ 0:51c39ea1fd54 draft

Uploaded
author melpetera
date Mon, 14 Jan 2019 08:37:27 -0500
parents
children d1133a7c26f9
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Intchecks/wrapper_intensity_check.R	Mon Jan 14 08:37:27 2019 -0500
@@ -0,0 +1,54 @@
+#!/usr/bin/Rscript --vanilla --slave --no-site-file
+
+
+#############################################################################
+# WRAPPER for INTENSITY CHECK                                               #
+#                                                                           #
+#Script: Script_intensity_check.R                                           #
+#Xml: xml_intensity_check.xml                                               #
+#                                                                           #
+#                                                                           #
+# Input: Data Matrix, VariableMetadata, SampleMetadata                      #
+# Output: VariableMetadata, Graphics (barplots and boxplots)                #
+#                                                                           #
+#                                                                           #
+#############################################################################
+
+
+library(batch) #necessary for parseCommandArgs function
+args = parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects
+
+source_local <- function(...){
+  argv <- commandArgs(trailingOnly = FALSE)
+  base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
+  for(i in 1:length(list(...))){source(paste(base_dir, list(...)[[i]], sep="/"))}
+}
+#Import the different functions
+source_local("Script_intensity_check.R", "RcheckLibrary.R")
+
+
+if(length(args) < 8){ stop("NOT enough argument !!!") }
+
+
+class1 <- NULL
+fold_frac <- NULL
+if(args$type == "One_class"){
+  class1 <- args$class1
+  fold_frac <- args$fold_frac
+}
+
+
+#print args
+cat("\n-------------------------------\nIntensity Check parameters:\n\n")
+print(args)
+cat("--------------------------------\n")
+
+
+intens_check(args$dataMatrix_in, args$sampleMetadata_in, args$variableMetadata_in, args$class_col, args$type,
+            class1, fold_frac, args$logarithm, args$variableMetadata_out, args$graphs_out)
+
+sessionInfo()
+cat("--------------------------------\n")
+
+#delete the parameters to avoid the passage to the next tool in .RData image
+rm(args)