0
|
1 #!/usr/bin/Rscript --vanilla --slave --no-site-file
|
|
2
|
1
|
3
|
|
4 #############################################################################
|
|
5 # WRAPPER for INTENSITY CHECK #
|
|
6 # #
|
|
7 #Script: Script_intensity_check.R #
|
|
8 #Xml: xml_intensity_check.xml #
|
|
9 # #
|
|
10 # #
|
|
11 # Input: Data Matrix, VariableMetadata, SampleMetadata #
|
3
|
12 # Output: VariableMetadata, Graphics #
|
1
|
13 # #
|
|
14 # #
|
|
15 #############################################################################
|
0
|
16
|
|
17 source_local <- function(...){
|
|
18 argv <- commandArgs(trailingOnly = FALSE)
|
|
19 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
|
|
20 for(i in 1:length(list(...))){source(paste(base_dir, list(...)[[i]], sep="/"))}
|
|
21 }
|
|
22 #Import the different functions
|
6
|
23 source_local("parseargs.R", "Script_intensity_check.R", "RcheckLibrary.R")
|
|
24
|
|
25 args = parse_args() #interpretation of arguments given in command line as an R list of objects
|
0
|
26
|
|
27
|
3
|
28 if(length(args) < 7){ stop("NOT enough argument !!!") }
|
1
|
29
|
4
|
30 cat('\nJob starting time:\n',format(Sys.time(), "%a %d %b %Y %X"),
|
|
31 '\n\n--------------------------------------------------------------------',
|
|
32 '\nIntensity Check parameters:\n\n')
|
|
33 print(args)
|
|
34 cat('--------------------------------------------------------------------\n\n')
|
|
35
|
3
|
36 class_col <- NULL
|
|
37 test_fold <- NULL
|
0
|
38 class1 <- NULL
|
1
|
39 fold_frac <- NULL
|
3
|
40 logarithm <- NULL
|
|
41 if(args$method == "each_class"){
|
|
42 class_col <- args$class_col
|
|
43 test_fold <- args$test_fold
|
|
44 if(args$test_fold == "Yes"){
|
|
45 logarithm <- args$logarithm
|
|
46 }
|
|
47 }
|
|
48 if(args$method == "one_class"){
|
|
49 class_col <- args$class_col
|
0
|
50 class1 <- args$class1
|
3
|
51 test_fold <- args$test_fold
|
|
52 if(args$test_fold == "Yes"){
|
|
53 fold_frac <- args$fold_frac
|
|
54 logarithm <- args$logarithm
|
|
55 }
|
|
56 }
|
|
57
|
|
58 err_no_option <- NULL
|
|
59
|
|
60 if(((args$method == "no_class")&&(args$chosen_stat == "None"))||
|
|
61 ((args$method != "no_class") && (args$chosen_stat == "None") && (test_fold == "No"))){
|
4
|
62 err_no_option<- "You did not select any computational option. Program can not be executed."
|
3
|
63 stop("\n- - - - - - - - -\n",err_no_option,"\n- - - - - - - - -\n")
|
0
|
64 }
|
|
65
|
1
|
66
|
3
|
67 if(is.null(err_no_option)){
|
0
|
68
|
3
|
69 intens_check(args$dataMatrix_in, args$sampleMetadata_in, args$variableMetadata_in, args$method, args$chosen_stat,
|
|
70 class_col, test_fold, class1, fold_frac, logarithm, args$variableMetadata_out, args$graphs_out)
|
|
71 }
|
4
|
72
|
|
73
|
|
74 cat('\n--------------------------------------------------------------------',
|
|
75 '\nInformation about R (version, Operating System, attached or loaded packages):\n\n')
|
0
|
76 sessionInfo()
|
4
|
77 cat('--------------------------------------------------------------------\n',
|
|
78 '\nJob ending time:\n',format(Sys.time(), "%a %d %b %Y %X"))
|
|
79
|
0
|
80
|
|
81 #delete the parameters to avoid the passage to the next tool in .RData image
|
|
82 rm(args)
|