diff Intchecks/wrapper_intensity_check.R @ 0:c2c2e1be904a draft

Uploaded
author melpetera
date Thu, 11 Oct 2018 05:33:19 -0400
parents
children 4973a2104cfd
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Intchecks/wrapper_intensity_check.R	Thu Oct 11 05:33:19 2018 -0400
@@ -0,0 +1,49 @@
+#!/usr/bin/Rscript --vanilla --slave --no-site-file
+
+####################################################################
+# WRAPPER for INTENSITY CHECK
+#Script: Script_intensity_check_v1.R
+#Xml: xml_intensity_check_v1.xml
+#
+# V1: Fold and NA
+#
+# 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) < 7){ stop("NOT enough argument !!!") }
+
+class1 <- NULL
+if(args$type == "One_class"){
+  class1 <- args$class1
+}
+
+#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$type,
+          args$class_col, class1, 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)