annotate profia_wrapper.R @ 3:5215be2bdc9e draft

planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
author ethevenot
date Tue, 09 Jan 2018 12:44:23 -0500
parents e29c563df582
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
1 #!/usr/bin/env Rscript
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
2
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
3 library(batch) ## parseCommandArgs
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
4
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
5 argVc <- unlist(parseCommandArgs(evaluate=FALSE))
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
6
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
7 ##------------------------------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
8 ## Initializing
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
9 ##------------------------------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
10
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
11
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
12 ## libraries
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
13 ##----------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
14
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
15 suppressMessages(library(proFIA))
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
16
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
17
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
18 ## constants
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
19 ##----------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
20
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
21 modNamC <- "proFIA" ## module name
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
22
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
23
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
24 ## log file
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
25 ##---------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
26
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
27 sink(argVc["information"])
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
28
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
29 cat("\nStart of the '", modNamC, "' Galaxy module call: ",
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
30 format(Sys.time(), "%a %d %b %Y %X"), "\n", sep="")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
31
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
32
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
33 ## arguments
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
34 ##----------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
35
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
36
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
37 if("zipfile" %in% names(argVc)) {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
38
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
39 zipfile <- argVc["zipfile"]
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
40
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
41 ## We unzip automatically the raw files from the zip file
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
42
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
43 if(exists("zipfile") && (zipfile!="")) {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
44 if(!file.exists(zipfile)){
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
45 error_message=paste("Cannot access the Zip file:", zipfile)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
46 print(error_message)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
47 stop(error_message)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
48 }
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
49
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
50 ## unzip
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
51
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
52 suppressWarnings(unzip(zipfile, unzip="unzip"))
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
53
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
54 ## get the directory name
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
55
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
56 filesInZip=unzip(zipfile, list=T);
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
57 directories=unique(unlist(lapply(strsplit(filesInZip$Name,"/"), function(x) x[1])));
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
58 directories=directories[!(directories %in% c("__MACOSX")) & file.info(directories)$isdir]
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
59 directory = "."
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
60 if (length(directories) == 1) directory = directories
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
61
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
62 cat("files_root_directory\t",directory,"\n")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
63
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
64 }
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
65
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
66 } else if ("library" %in% names(argVc)) {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
67
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
68 directory <- argVc["library"]
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
69
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
70 if(!file.exists(directory)) {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
71
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
72 error_message=paste("Cannot access the directory:", directory,". Please check that the directory really exists.")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
73 print(error_message)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
74 stop(error_message)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
75
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
76 }
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
77
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
78 } else {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
79
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
80 error_message <- "No zipfile nor input library available"
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
81 print(error_message)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
82 stop(error_message)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
83
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
84 }
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
85
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
86 ##------------------------------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
87 ## Computations
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
88 ##------------------------------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
89
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
90
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
91 optWrnN <- options()$warn
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
92 options(warn = -1)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
93
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
94 stpI <- 1
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
95
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
96 cat("\n", stpI, ") Peak detection step ('proFIAset'):\n", sep = "")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
97
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
98 if("sizeMinN" %in% names(argVc) && argVc["sizeMinN"] != "none") {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
99 if("scanMaxI" %in% names(argVc) && argVc["scanMaxI"] != "none") {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
100 fiaset <- proFIAset(directory,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
101 ppm = as.numeric(argVc["ppmN"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
102 dmz = as.numeric(argVc["dmzN"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
103 bandCoverage = as.numeric(ifelse("bandCoverageN" %in% names(argVc), argVc["bandCoverageN"], "0.3")),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
104 sizeMin = as.numeric(argVc["sizeMinN"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
105 scanmin = as.numeric(ifelse("scanMinI" %in% names(argVc), argVc["scanMinI"], "1")),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
106 scanmax = as.numeric(argVc["scanMaxI"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
107 parallel = TRUE)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
108 } else {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
109 fiaset <- proFIAset(directory,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
110 ppm = as.numeric(argVc["ppmN"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
111 dmz = as.numeric(argVc["dmzN"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
112 bandCoverage = as.numeric(ifelse("bandCoverageN" %in% names(argVc), argVc["bandCoverageN"], "0.3")),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
113 sizeMin = as.numeric(argVc["sizeMinN"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
114 scanmin = as.numeric(ifelse("scanMinI" %in% names(argVc), argVc["scanMinI"], "1")),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
115 parallel = TRUE)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
116 }
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
117 } else {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
118 if("scanMaxI" %in% names(argVc) && argVc["scanMaxI"] != "none") {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
119 fiaset <- proFIAset(directory,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
120 ppm = as.numeric(argVc["ppmN"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
121 dmz = as.numeric(argVc["dmzN"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
122 bandCoverage = as.numeric(ifelse("bandCoverageN" %in% names(argVc), argVc["bandCoverageN"], "0.3")),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
123 scanmin = as.numeric(ifelse("scanMinI" %in% names(argVc), argVc["scanMinI"], "1")),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
124 scanmax = as.numeric(argVc["scanMaxI"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
125 parallel = TRUE)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
126 } else {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
127 fiaset <- proFIAset(directory,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
128 ppm = as.numeric(argVc["ppmN"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
129 dmz = as.numeric(argVc["dmzN"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
130 bandCoverage = as.numeric(ifelse("bandCoverageN" %in% names(argVc), argVc["bandCoverageN"], "0.3")),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
131 scanmin = as.numeric(ifelse("scanMinI" %in% names(argVc), argVc["scanMinI"], "1")),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
132 parallel = TRUE)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
133 }
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
134 }
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
135
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
136 stpI <- stpI + 1
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
137
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
138 cat("\n", stpI, ") Peak alignment ('group.FIA'):\n", sep = "")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
139
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
140 fiaset <- group.FIA(fiaset,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
141 ppmGroup = as.numeric(argVc["ppmGroupN"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
142 dmz = as.numeric(argVc["dmzGroupN"]),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
143 fracGroup = as.numeric(argVc["fracGroupN"]))
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
144
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
145 stpI <- stpI + 1
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
146
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
147 cat("\n", stpI, ") Creating the peak table ('makeDataMatrix'):\n", sep = "")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
148
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
149 fiaset <- makeDataMatrix(fiaset,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
150 maxo = FALSE)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
151
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
152 stpI <- stpI + 1
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
153
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
154
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
155 if(argVc["imputeC"] == "randomForest") {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
156
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
157 cat("\n", stpI, ") Imputing missing values ('impute.randomForest'):\n", sep = "")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
158
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
159 set.seed(123)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
160
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
161 fiaset <- impute.randomForest(fiaset,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
162 parallel = FALSE)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
163
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
164 set.seed(NULL)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
165
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
166 stpI <- stpI + 1
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
167 }
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
168 ###TODO Fix the error message to set 'parallel' to TRUE: You must register a 'foreach' parallel backend to run 'missForest' in parallel. Set 'parallelize' to 'no' to compute serially.
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
169 ###TODO add the impute.KNN_TN method
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
170
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
171
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
172 options(warn = optWrnN)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
173
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
174
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
175 ##------------------------------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
176 ## Ending
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
177 ##------------------------------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
178
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
179
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
180 ## Plotting
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
181 ##---------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
182
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
183 cat("\n", stpI, ") Plotting ('plot'):\n", sep = "")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
184
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
185 pdf(argVc["figure"])
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
186
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
187 plot(fiaset)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
188
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
189 dev.off()
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
190
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
191 stpI <- stpI + 1
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
192
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
193 ## Printing
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
194 ##---------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
195
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
196 cat("\n", stpI, ") Printing ('show'):\n", sep = "")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
197
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
198 fiaset
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
199
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
200 stpI <- stpI + 1
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
201
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
202 ## Exporting
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
203 ##----------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
204
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
205 cat("\n", stpI, ") Exporting ('exportDataMatrix', 'exportSampleMetadata', 'exportVariableMetadata'):\n", sep = "")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
206
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
207 datMN <- exportDataMatrix(fiaset)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
208 samDF <- exportSampleMetadata(fiaset)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
209 varDF <- exportVariableMetadata(fiaset)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
210
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
211 if(nrow(datMN) == nrow(samDF) && ncol(datMN) == nrow(varDF)) {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
212 datDF <- as.data.frame(t(datMN))
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
213 } else {
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
214 datDF <- as.data.frame(datMN)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
215 }
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
216 rownames(varDF) <- rownames(datDF)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
217
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
218 datDF <- cbind.data.frame(dataMatrix = rownames(datDF),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
219 datDF)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
220 write.table(datDF,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
221 file = argVc["dataMatrix_out"],
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
222 quote = FALSE,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
223 row.names = FALSE,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
224 sep = "\t")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
225
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
226 samDF <- cbind.data.frame(sampleMetadata = samDF[, "sampleID"],
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
227 class = samDF[, "class"])
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
228 write.table(samDF,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
229 file = argVc["sampleMetadata_out"],
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
230 quote = FALSE,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
231 row.names = FALSE,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
232 sep = "\t")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
233
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
234 varDF <- cbind.data.frame(variableMetadata = rownames(varDF),
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
235 varDF)
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
236 write.table(varDF,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
237 file = argVc["variableMetadata_out"],
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
238 quote = FALSE,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
239 row.names = FALSE,
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
240 sep = "\t")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
241
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
242
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
243 ## Closing
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
244 ##--------
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
245
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
246 cat("\nEnd of '", modNamC, "' Galaxy module call: ",
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
247 as.character(Sys.time()), "\n", sep = "")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
248
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
249 cat("\n\n\n============================================================================")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
250 cat("\nAdditional information about the call:\n")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
251 cat("\n1) Parameters:\n")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
252 print(cbind(value = argVc))
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
253
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
254 cat("\n2) Session Info:\n")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
255 sessioninfo <- sessionInfo()
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
256 cat(sessioninfo$R.version$version.string,"\n")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
257 cat("Main packages:\n")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
258 for (pkg in names(sessioninfo$otherPkgs)) { cat(paste(pkg,packageVersion(pkg)),"\t") }; cat("\n")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
259 cat("Other loaded packages:\n")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
260 for (pkg in names(sessioninfo$loadedOnly)) { cat(paste(pkg,packageVersion(pkg)),"\t") }; cat("\n")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
261
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
262 cat("============================================================================\n")
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
263
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
264 sink()
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
265
5215be2bdc9e planemo upload for repository https://github.com/workflow4metabolomics/profia.git commit 19ed25c048232776369a392ddb8c1860471acd29
ethevenot
parents: 2
diff changeset
266 rm(list = ls())