-
Notifications
You must be signed in to change notification settings - Fork 0
/
tablemerge_wrap.R
38 lines (28 loc) · 2.09 KB
/
tablemerge_wrap.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/Rscript --vanilla --slave --no-site-file
################################################################################################
# WRAPPER FOR tablemerge_script.R (TABLE MERGE) #
# #
# Author: Melanie PETERA #
# User: Galaxy #
# Original data: used with tablemerge_script.R #
# Starting date: 11-05-2015 #
# V-1: Firt version of wrapper #
# #
# #
# Input files: dataMatrix ; Metadata file #
# Output files: dataMatrix ; Metadata file #
# #
################################################################################################
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("tablemerge_script.R","RcheckLibrary.R","miniTools.R")
if(length(args) < 4){ stop("NOT enough argument !!!") }
tab.merge(args$dataMatrix_in, args$Metadata_in, args$metatype, args$combined_out)
#delete the parameters to avoid the passage to the next tool in .RData image
rm(args)