Mercurial > repos > ethevenot > qualitymetrics
comparison qualitymetrics_wrapper.R @ 0:b4f5b5bc01dd draft
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
author | ethevenot |
---|---|
date | Sat, 06 Aug 2016 12:01:17 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:b4f5b5bc01dd |
---|---|
1 #!/usr/bin/Rscript --vanilla --slave --no-site-file | |
2 | |
3 ################################################################################################ | |
4 # WRAPPER FOR QC_script.R (ANALYSES FOR QUALITY CONTROL) # | |
5 # # | |
6 # Author: Melanie PETERA based on Marion LANDI's filters' wrapper # | |
7 # User: Galaxy # | |
8 # Original data: used with QC_script.R # | |
9 # Starting date: 04-09-2014 # | |
10 # V-1: Restriction of old filter wrapper to quality control (CV) # | |
11 # # | |
12 # # | |
13 # Input files: dataMatrix.txt ; sampleMetadata.txt ; variableMetadata.txt # | |
14 # Output files: dataMatrix.txt ; sampleMetadata.txt ; variableMetadata.txt # | |
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("qualitymetrics_script.R", "easyrlibrary-lib/RcheckLibrary.R", "easyrlibrary-lib/miniTools.R") | |
29 | |
30 | |
31 suppressMessages(library(ropls)) ## to be used in qualityMetricsF | |
32 | |
33 if(packageVersion("ropls") < "1.4.0") | |
34 stop("Please use 'ropls' versions of 1.4.0 and above") | |
35 | |
36 if(length(args) < 9){ stop("NOT enough arguments !!!") } | |
37 | |
38 args$Compa <- as.logical(args$Compa) | |
39 args$poolAsPool1L <- as.logical(args$poolAsPool1L) | |
40 | |
41 QualityControl(args$dataMatrix_in, args$sampleMetadata_in, args$variableMetadata_in, | |
42 args$CV, args$Compa, args$seuil, args$poolAsPool1L, | |
43 args$dataMatrix_out, args$sampleMetadata_out, args$variableMetadata_out, args$figure, args$information) | |
44 | |
45 #QualityControl(ion.file.in, meta.samp.file.in, meta.ion.file.in, | |
46 # CV, Compa, seuil, | |
47 # ion.file.out, meta.samp.file.out, meta.ion.file.out) | |
48 | |
49 #delete the parameters to avoid the passage to the next tool in .RData image | |
50 rm(args) | |
51 |