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 #
|
1
|
10 # V-1: First version of wrapper #
|
|
11 # V-2: Additional information in stdout #
|
0
|
12 # #
|
|
13 # #
|
|
14 # Input files: dataMatrix ; Metadata file #
|
|
15 # Output files: dataMatrix ; Metadata file #
|
|
16 # #
|
|
17 ################################################################################################
|
|
18
|
|
19
|
|
20 library(batch) #necessary for parseCommandArgs function
|
|
21 args = parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects
|
|
22
|
|
23 source_local <- function(...){
|
|
24 argv <- commandArgs(trailingOnly = FALSE)
|
|
25 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
|
|
26 for(i in 1:length(list(...))){source(paste(base_dir, list(...)[[i]], sep="/"))}
|
|
27 }
|
|
28 #Import the different functions
|
|
29 source_local("IDchoice_script.R","easyrlibrary-lib/RcheckLibrary.R","easyrlibrary-lib/miniTools.R")
|
|
30
|
|
31
|
|
32 if(length(args) < 7){ stop("NOT enough argument !!!") }
|
|
33
|
|
34
|
1
|
35 cat('\nJob starting time:\n',format(Sys.time(), "%a %d %b %Y %X"),
|
|
36 '\n\n--------------------------------------------------------------------',
|
|
37 '\nParameters used in "ID choice":\n\n')
|
|
38 print(args)
|
|
39 cat('--------------------------------------------------------------------\n\n')
|
|
40
|
|
41
|
0
|
42 id.choice(args$dataMatrix_in, args$Metadata_in, args$metatype, args$col_name, args$makeunique, args$DM_out, args$meta_out)
|
|
43
|
|
44
|
1
|
45 cat('\n--------------------------------------------------------------------',
|
|
46 '\nInformation about R (version, Operating System, attached or loaded packages):\n\n')
|
|
47 sessionInfo()
|
|
48 cat('--------------------------------------------------------------------\n',
|
|
49 '\nJob ending time:\n',format(Sys.time(), "%a %d %b %Y %X"))
|
|
50
|
|
51
|
0
|
52 #delete the parameters to avoid the passage to the next tool in .RData image
|
|
53 rm(args)
|