comparison TableMerge/tablemerge_wrap.R @ 0:902ab790fb7b draft

Uploaded
author melpetera
date Thu, 23 Feb 2017 04:37:49 -0500
parents
children e44c5246247a
comparison
equal deleted inserted replaced
-1:000000000000 0:902ab790fb7b
1 #!/usr/bin/Rscript --vanilla --slave --no-site-file
2
3 ################################################################################################
4 # WRAPPER FOR tablemerge_script.R (TABLE MERGE) #
5 # #
6 # Author: Melanie PETERA #
7 # User: Galaxy #
8 # Original data: used with tablemerge_script.R #
9 # Starting date: 11-05-2015 #
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("tablemerge_script.R","RcheckLibrary.R","miniTools.R")
29
30
31 if(length(args) < 4){ stop("NOT enough argument !!!") }
32
33
34 tab.merge(args$dataMatrix_in, args$Metadata_in, args$metatype, args$combined_out)
35
36
37 #delete the parameters to avoid the passage to the next tool in .RData image
38 rm(args)