Mercurial > repos > ethevenot > qualitymetrics
annotate qualitymetrics_wrapper.R @ 3:acdf51018708 draft default tip
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit b7e47e59ea753fe9f73f2b83bcaae895b21269f6
author | ethevenot |
---|---|
date | Wed, 28 Feb 2018 09:32:42 -0500 |
parents | b4f5b5bc01dd |
children |
rev | line source |
---|---|
0
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
1 #!/usr/bin/Rscript --vanilla --slave --no-site-file |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
2 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
3 ################################################################################################ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
4 # WRAPPER FOR QC_script.R (ANALYSES FOR QUALITY CONTROL) # |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
5 # # |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
6 # Author: Melanie PETERA based on Marion LANDI's filters' wrapper # |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
7 # User: Galaxy # |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
8 # Original data: used with QC_script.R # |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
9 # Starting date: 04-09-2014 # |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
10 # V-1: Restriction of old filter wrapper to quality control (CV) # |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
11 # # |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
12 # # |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
13 # Input files: dataMatrix.txt ; sampleMetadata.txt ; variableMetadata.txt # |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
14 # Output files: dataMatrix.txt ; sampleMetadata.txt ; variableMetadata.txt # |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
15 # # |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
16 ################################################################################################ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
17 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
18 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
19 library(batch) #necessary for parseCommandArgs function |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
20 args = parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
21 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
22 source_local <- function(...){ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
23 argv <- commandArgs(trailingOnly = FALSE) |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
24 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
25 for(i in 1:length(list(...))){source(paste(base_dir, list(...)[[i]], sep="/"))} |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
26 } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
27 #Import the different functions |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
28 source_local("qualitymetrics_script.R", "easyrlibrary-lib/RcheckLibrary.R", "easyrlibrary-lib/miniTools.R") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
29 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
30 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
31 suppressMessages(library(ropls)) ## to be used in qualityMetricsF |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
32 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
33 if(packageVersion("ropls") < "1.4.0") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
34 stop("Please use 'ropls' versions of 1.4.0 and above") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
35 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
36 if(length(args) < 9){ stop("NOT enough arguments !!!") } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
37 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
38 args$Compa <- as.logical(args$Compa) |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
39 args$poolAsPool1L <- as.logical(args$poolAsPool1L) |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
40 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
41 QualityControl(args$dataMatrix_in, args$sampleMetadata_in, args$variableMetadata_in, |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
42 args$CV, args$Compa, args$seuil, args$poolAsPool1L, |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
43 args$dataMatrix_out, args$sampleMetadata_out, args$variableMetadata_out, args$figure, args$information) |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
44 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
45 #QualityControl(ion.file.in, meta.samp.file.in, meta.ion.file.in, |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
46 # CV, Compa, seuil, |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
47 # ion.file.out, meta.samp.file.out, meta.ion.file.out) |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
48 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
49 #delete the parameters to avoid the passage to the next tool in .RData image |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
50 rm(args) |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
51 |