annotate TableMerge/tablemerge_wrap.R @ 1:a97044d8dd40 draft

version 1.0.1
author melpetera
date Fri, 17 Feb 2017 05:36:13 -0500
parents
children fb42f8b52942
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
1 #!/usr/bin/Rscript --vanilla --slave --no-site-file
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
2
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
3 ################################################################################################
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
4 # WRAPPER FOR tablemerge_script.R (TABLE MERGE) #
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
5 # #
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
6 # Author: Melanie PETERA #
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
7 # User: Galaxy #
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
8 # Original data: used with tablemerge_script.R #
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
9 # Starting date: 11-05-2015 #
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
10 # V-1: Firt version of wrapper #
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
11 # #
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
12 # #
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
13 # Input files: dataMatrix ; Metadata file #
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
14 # Output files: dataMatrix ; Metadata file #
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
15 # #
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
16 ################################################################################################
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
17
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
18
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
19 library(batch) #necessary for parseCommandArgs function
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
20 args = parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
21
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
22 source_local <- function(...){
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
23 argv <- commandArgs(trailingOnly = FALSE)
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
24 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
25 for(i in 1:length(list(...))){source(paste(base_dir, list(...)[[i]], sep="/"))}
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
26 }
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
27 #Import the different functions
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
28 source_local("tablemerge_script.R","RcheckLibrary.R","miniTools.R")
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
29
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
30
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
31 if(length(args) < 4){ stop("NOT enough argument !!!") }
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
32
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
33
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
34 tab.merge(args$dataMatrix_in, args$Metadata_in, args$metatype, args$combined_out)
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
35
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
36
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
37 #delete the parameters to avoid the passage to the next tool in .RData image
a97044d8dd40 version 1.0.1
melpetera
parents:
diff changeset
38 rm(args)