view Intchecks/wrapper_intensity_check.R @ 1:4973a2104cfd draft

Uploaded
author melpetera
date Wed, 05 Dec 2018 10:27:45 -0500
parents c2c2e1be904a
children bdee2c2c484b
line wrap: on
line source

#!/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)