comparison IDchoice/IDchoice_wrap.R @ 0:b7a6a88f518a draft

Uploaded
author melpetera
date Thu, 11 Oct 2018 05:47:29 -0400
parents
children bb19b1d15732
comparison
equal deleted inserted replaced
-1:000000000000 0:b7a6a88f518a
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)