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