0
|
1 #!/usr/bin/Rscript --vanilla --slave --no-site-file
|
|
2
|
|
3 ################################################################################################
|
|
4 # WRAPPER FOR IDchoice_script.R (ID CHOICE) #
|
|
5 # #
|
|
6 # Author: Melanie PETERA #
|
|
7 # User: Galaxy #
|
|
8 # Original data: used with IDchoice_script.R #
|
|
9 # Starting date: 01-06-2017 #
|
|
10 # V-1: Firt version of wrapper #
|
|
11 # #
|
|
12 # #
|
|
13 # Input files: dataMatrix ; Metadata file #
|
|
14 # Output files: dataMatrix ; Metadata file #
|
|
15 # #
|
|
16 ################################################################################################
|
|
17
|
|
18
|
|
19 library(batch) #necessary for parseCommandArgs function
|
|
20 args = parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects
|
|
21
|
|
22 source_local <- function(...){
|
|
23 argv <- commandArgs(trailingOnly = FALSE)
|
|
24 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
|
|
25 for(i in 1:length(list(...))){source(paste(base_dir, list(...)[[i]], sep="/"))}
|
|
26 }
|
|
27 #Import the different functions
|
|
28 source_local("IDchoice_script.R","easyrlibrary-lib/RcheckLibrary.R","easyrlibrary-lib/miniTools.R")
|
|
29
|
|
30
|
|
31 if(length(args) < 7){ stop("NOT enough argument !!!") }
|
|
32
|
|
33
|
|
34 id.choice(args$dataMatrix_in, args$Metadata_in, args$metatype, args$col_name, args$makeunique, args$DM_out, args$meta_out)
|
|
35
|
|
36
|
|
37 #delete the parameters to avoid the passage to the next tool in .RData image
|
|
38 rm(args)
|