Mercurial > repos > marie-tremblay-metatoul > nmr_preprocessing
annotate NmrPreprocessing_wrapper.R @ 2:5e64657b4fe5 draft
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
author | lecorguille |
---|---|
date | Wed, 28 Mar 2018 08:05:12 -0400 |
parents | |
children |
rev | line source |
---|---|
2
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
1 #!/usr/local/public/bin/Rscript --vanilla --slave --no-site-file |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
2 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
3 ## 170116_NmrPreprocessing.R |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
4 ## Manon Martin and Marie Tremblay-Franco |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
5 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
6 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
7 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
8 # Preamble |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
9 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
10 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
11 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
12 runExampleL <- FALSE |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
13 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
14 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
15 ##------------------------------ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
16 ## Options |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
17 ##------------------------------ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
18 strAsFacL <- options()$stringsAsFactors |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
19 options(stringsAsFactors = FALSE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
20 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
21 ##------------------------------ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
22 ## Libraries laoding |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
23 ##------------------------------ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
24 library(batch) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
25 library(ptw) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
26 library(Matrix) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
27 library(ggplot2) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
28 library(gridExtra) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
29 library(reshape2) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
30 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
31 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
32 # R script call |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
33 source_local <- function(fname) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
34 { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
35 argv <- commandArgs(trailingOnly = FALSE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
36 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
37 source(paste(base_dir, fname, sep="/")) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
38 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
39 #Import the different functions |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
40 source_local("NmrPreprocessing_script.R") |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
41 source_local("DrawFunctions.R") |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
42 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
43 ##------------------------------ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
44 ## Script |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
45 ##------------------------------ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
46 runExampleL <- FALSE |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
47 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
48 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
49 if(!runExampleL) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
50 argLs <- parseCommandArgs(evaluate=FALSE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
51 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
52 sink(argLs$logOut) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
53 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
54 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
55 ##------------------------------ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
56 ## Errors ????????????????????? |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
57 ##------------------------------ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
58 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
59 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
60 ##------------------------------ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
61 ## Constants |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
62 ##------------------------------ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
63 topEnvC <- environment() |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
64 flagC <- "\n" |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
65 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
66 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
67 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
68 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
69 # log file |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
70 # print(argLs[["logOut"]]) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
71 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
72 ## Starting |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
73 cat("\nStart of 'Preprocessing' Galaxy module call: ", as.character(Sys.time()), "\n", sep = "") |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
74 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
75 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
76 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
77 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
78 ## Parameters Loading |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
79 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
80 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
81 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
82 # graphical inputs |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
83 FirstOPCGraph <- argLs[["FirstOPCGraph"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
84 SSGraph <- argLs[["SSGraph"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
85 ApodGraph <- argLs[["ApodGraph"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
86 FTGraph <- argLs[["FTGraph"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
87 SRGraph <- argLs[["SRGraph"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
88 ZeroOPCGraph <- argLs[["ZeroOPCGraph"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
89 BCGraph <- argLs[["BCGraph"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
90 FinalGraph <- argLs[["FinalGraph"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
91 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
92 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
93 # 1rst order phase correction ------------------------ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
94 # Inputs |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
95 ## Data matrix |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
96 Fid_data0 <- read.table(argLs[["dataMatrixFid"]],header=TRUE, check.names=FALSE, sep='\t') |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
97 # Fid_data0 <- Fid_data0[,-1] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
98 Fid_data0 <- as.matrix(Fid_data0) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
99 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
100 ## Samplemetadata |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
101 samplemetadataFid <- read.table(argLs[["sampleMetadataFid"]],check.names=FALSE,header=TRUE,sep="\t") |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
102 samplemetadataFid <- as.matrix(samplemetadataFid) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
103 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
104 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
105 # water and solvent(s) correction ------------------------ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
106 # Inputs |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
107 lambda <- argLs[["lambda"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
108 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
109 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
110 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
111 # apodization ----------------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
112 # Inputs |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
113 phase=0 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
114 rectRatio=1/2 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
115 gaussLB=1 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
116 expLB=1 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
117 apodization <- argLs[["apodizationMethod"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
118 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
119 if (apodization=='exp'){ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
120 expLB <- argLs[["expLB"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
121 } else if (apodization=='cos2'){ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
122 phase <- argLs[["phase"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
123 } else if (apodization=='hanning'){ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
124 phase <- argLs[["phase"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
125 } else if (apodization=='hamming'){ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
126 phase <- argLs[["phase"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
127 } else if (apodization=='blockexp'){ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
128 rectRatio <- argLs[["rectRatio"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
129 expLB <- argLs[["expLB"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
130 } else if (apodization=='blockcos2'){ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
131 rectRatio <- argLs[["rectRatio"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
132 } else if (apodization=='gauss'){ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
133 rectRatio <- argLs[["rectRatio"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
134 gaussLB <- argLs[["gaussLB"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
135 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
136 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
137 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
138 # Fourier transform ---------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
139 # Inputs |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
140 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
141 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
142 # Internal referencering ---------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
143 # Inputs |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
144 shiftTreshold = 2 # c |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
145 ppm = TRUE |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
146 shiftReferencingRangeList = NULL # fromto.RC |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
147 pctNearValue = 0.02 # pc |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
148 rowindex_graph = NULL |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
149 ppm_ref = 0 # ppm.ref |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
150 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
151 # |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
152 # shiftReferencing <- argLs[["shiftReferencing"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
153 # print(shiftReferencing) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
154 # |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
155 # if (shiftReferencing=="YES") |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
156 # { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
157 # |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
158 # shiftReferencingMethod <- argLs[["shiftReferencingMethod"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
159 # |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
160 # if (shiftReferencingMethod == "thres") { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
161 # shiftTreshold <- argLs[["shiftTreshold"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
162 # } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
163 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
164 shiftReferencingRange <- argLs[["shiftReferencingRange"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
165 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
166 if (shiftReferencingRange == "near0"){ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
167 pctNearValue <- argLs[["pctNearValue"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
168 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
169 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
170 if (shiftReferencingRange == "window"){ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
171 shiftReferencingRangeList <- list() |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
172 for(i in which(names(argLs)=="shiftReferencingRangeLeft")) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
173 { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
174 shiftReferencingRangeLeft <- argLs[[i]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
175 shiftReferencingRangeRight <- argLs[[i+1]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
176 shiftReferencingRangeList <- c(shiftReferencingRangeList,list(c(shiftReferencingRangeLeft,shiftReferencingRangeRight))) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
177 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
178 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
179 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
180 shiftHandling <- argLs[["shiftHandling"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
181 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
182 ppmvalue <- argLs[["ppmvalue"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
183 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
184 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
185 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
186 # } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
187 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
188 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
189 # Zero Order Phase Correction ------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
190 # Inputs |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
191 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
192 angle = NULL |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
193 excludeZOPC = NULL |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
194 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
195 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
196 zeroOrderPhaseMethod <- argLs[["zeroOrderPhaseMethod"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
197 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
198 if (zeroOrderPhaseMethod=='manual'){ |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
199 angle <- argLs[["angle"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
200 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
201 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
202 excludeZoneZeroPhase <- argLs[["excludeZoneZeroPhase.choice"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
203 if (excludeZoneZeroPhase == 'YES') { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
204 excludeZoneZeroPhaseList <- list() |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
205 for(i in which(names(argLs)=="excludeZoneZeroPhase_left")) { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
206 excludeZoneZeroPhaseLeft <- argLs[[i]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
207 excludeZoneZeroPhaseRight <- argLs[[i+1]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
208 excludeZoneZeroPhaseList <- c(excludeZoneZeroPhaseList,list(c(excludeZoneZeroPhaseLeft,excludeZoneZeroPhaseRight))) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
209 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
210 excludeZOPC <- excludeZoneZeroPhaseList |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
211 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
212 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
213 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
214 # Baseline Correction ------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
215 # Inputs |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
216 lambdaBc <- argLs[["lambdaBc"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
217 pBc <- argLs[["pBc"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
218 epsilon <- argLs[["epsilon"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
219 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
220 excludeBC = NULL |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
221 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
222 excludeZoneBC <- argLs[["excludeZoneBC.choice"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
223 if (excludeZoneBC == 'YES') { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
224 excludeZoneBCList <- list() |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
225 for(i in which(names(argLs)=="excludeZoneBC_left")) { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
226 excludeZoneBCLeft <- argLs[[i]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
227 excludeZoneBCRight <- argLs[[i+1]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
228 excludeZoneBCList <- c(excludeZoneBCList,list(c(excludeZoneBCLeft,excludeZoneBCRight))) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
229 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
230 excludeBC <- excludeZoneBCList |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
231 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
232 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
233 # transformation of negative values ------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
234 # Inputs |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
235 NegativetoZero <- argLs[["NegativetoZero"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
236 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
237 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
238 # Outputs |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
239 nomGraphe <- argLs[["graphOut"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
240 # dataMatrixOut <- argLs[["dataMatrixOut"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
241 log <- argLs[["logOut"]] |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
242 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
243 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
244 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
245 ## Checking arguments |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
246 ##------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
247 error.stock <- "\n" |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
248 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
249 if(length(error.stock) > 1) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
250 stop(error.stock) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
251 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
252 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
253 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
254 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
255 ## Computation |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
256 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
257 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
258 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
259 pdf(nomGraphe, onefile = TRUE, width = 13, height = 13) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
260 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
261 # FirstOrderPhaseCorrection --------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
262 Fid_data <- GroupDelayCorrection(Fid_data0, Fid_info = samplemetadataFid, group_delay = NULL) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
263 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
264 if (FirstOPCGraph == "YES") { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
265 title = "FIDs after Group Delay Correction" |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
266 DrawSignal(Fid_data, subtype = "stacked", |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
267 ReImModArg = c(TRUE, FALSE, FALSE, FALSE), vertical = T, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
268 xlab = "Frequency", num.stacked = 4, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
269 main = title, createWindow=FALSE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
270 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
271 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
272 # SolventSuppression --------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
273 Fid_data <- SolventSuppression(Fid_data, lambda.ss = lambda, ptw.ss = TRUE, plotSolvent = F, returnSolvent = F) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
274 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
275 if (SSGraph == "YES") { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
276 title = "FIDs after Solvent Suppression " |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
277 DrawSignal(Fid_data, subtype = "stacked", |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
278 ReImModArg = c(TRUE, FALSE, FALSE, FALSE), vertical = T, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
279 xlab = "Frequency", num.stacked = 4, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
280 main = title, createWindow=FALSE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
281 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
282 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
283 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
284 # Apodization --------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
285 Fid_data <- Apodization(Fid_data, Fid_info = samplemetadataFid, DT = NULL, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
286 type.apod = apodization, phase = phase, rectRatio = rectRatio, gaussLB = gaussLB, expLB = expLB, plotWindow = F, returnFactor = F) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
287 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
288 if (ApodGraph == "YES") { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
289 title = "FIDs after Apodization" |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
290 DrawSignal(Fid_data, subtype = "stacked", |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
291 ReImModArg = c(TRUE, FALSE, FALSE, FALSE), vertical = T, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
292 xlab = "Frequency", num.stacked = 4, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
293 main = title, createWindow=FALSE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
294 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
295 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
296 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
297 # FourierTransform --------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
298 Spectrum_data <- FourierTransform(Fid_data, Fid_info = samplemetadataFid, reverse.axis = TRUE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
299 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
300 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
301 if (FTGraph == "YES") { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
302 title = "Fourier transformed spectra" |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
303 DrawSignal(Spectrum_data, subtype = "stacked", |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
304 ReImModArg = c(TRUE, FALSE, FALSE, FALSE), vertical = T, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
305 xlab = "Frequency", num.stacked = 4, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
306 main = title, createWindow=FALSE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
307 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
308 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
309 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
310 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
311 # ZeroOrderPhaseCorrection --------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
312 Spectrum_data <- ZeroOrderPhaseCorrection(Spectrum_data, type.zopc = zeroOrderPhaseMethod, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
313 plot_rms = NULL, returnAngle = FALSE, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
314 createWindow = TRUE,angle = angle, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
315 plot_spectra = FALSE, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
316 ppm.zopc = TRUE, exclude.zopc = excludeZOPC) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
317 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
318 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
319 # InternalReferencing --------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
320 # if (shiftReferencing=="YES") { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
321 Spectrum_data <- InternalReferencing(Spectrum_data, samplemetadataFid, method = "max", range = shiftReferencingRange, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
322 ppm.value = ppmvalue, shiftHandling = shiftHandling, ppm.ir = TRUE, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
323 fromto.RC = shiftReferencingRangeList, pc = pctNearValue) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
324 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
325 if (SRGraph == "YES") { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
326 title = "Spectra after Shift Referencing" |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
327 DrawSignal(Spectrum_data, subtype = "stacked", |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
328 ReImModArg = c(TRUE, FALSE, FALSE, FALSE), vertical = T, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
329 xlab = "Frequency", num.stacked = 4, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
330 main = title, createWindow=FALSE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
331 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
332 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
333 # } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
334 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
335 if (ZeroOPCGraph == "YES") { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
336 title = "Spectra after Zero Order Phase Correction" |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
337 DrawSignal(Spectrum_data, subtype = "stacked", |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
338 ReImModArg = c(TRUE, FALSE, FALSE, FALSE), vertical = T, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
339 xlab = "Frequency", num.stacked = 4, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
340 main = title, createWindow=FALSE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
341 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
342 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
343 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
344 # BaselineCorrection --------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
345 Spectrum_data <- BaselineCorrection(Spectrum_data, ptw.bc = TRUE, lambda.bc = lambdaBc, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
346 p.bc = pBc, eps = epsilon, ppm.bc = TRUE, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
347 exclude.bc = excludeBC, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
348 returnBaseline = F) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
349 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
350 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
351 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
352 if (BCGraph == "YES") { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
353 title = "Spectra after Baseline Correction" |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
354 DrawSignal(Spectrum_data, subtype = "stacked", |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
355 ReImModArg = c(TRUE, FALSE, FALSE, FALSE), vertical = T, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
356 xlab = "Frequency", num.stacked = 4, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
357 main = title, createWindow=FALSE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
358 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
359 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
360 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
361 # NegativeValuesZeroing --------------------------------- |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
362 if (NegativetoZero=="YES") { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
363 Spectrum_data <- NegativeValuesZeroing(Spectrum_data) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
364 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
365 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
366 if (FinalGraph == "YES") { |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
367 title = "Final preprocessed spectra" |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
368 DrawSignal(Spectrum_data, subtype = "stacked", |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
369 ReImModArg = c(TRUE, FALSE, FALSE, FALSE), vertical = T, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
370 xlab = "Frequency", num.stacked = 4, |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
371 main = title, createWindow=FALSE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
372 } |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
373 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
374 invisible(dev.off()) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
375 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
376 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
377 data_variable <- matrix(NA, nrow = 1, ncol = dim(Spectrum_data)[2], dimnames = list("ID", NULL)) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
378 colnames(data_variable) <- colnames(Spectrum_data) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
379 data_variable[1,] <- colnames(data_variable) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
380 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
381 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
382 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
383 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
384 ## Saving |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
385 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
386 ##====================================================== |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
387 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
388 # Data Matrix |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
389 write.table(round(t(Re(Spectrum_data)),6), file=argLs$dataMatrix, quote=FALSE, row.names=TRUE, sep="\t", col.names=TRUE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
390 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
391 # Variable metadata |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
392 write.table(data_variable,file=argLs$variableMetadata, quote=FALSE, row.names=TRUE, sep="\t", col.names=TRUE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
393 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
394 # log file |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
395 # write.table(t(data.frame(argLs)), file = argLs$logOut, col.names = FALSE, quote=FALSE) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
396 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
397 # input arguments |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
398 cat("\n INPUT and OUTPUT ARGUMENTS :\n") |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
399 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
400 argLs |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
401 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
402 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
403 ## Ending |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
404 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
405 cat("\nEnd of 'Preprocessing' Galaxy module call: ", as.character(Sys.time()), sep = "") |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
406 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
407 sink() |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
408 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
409 options(stringsAsFactors = strAsFacL) |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
410 |
5e64657b4fe5
planemo upload for repository https://github.com/workflow4metabolomics/nmr_preprocessing commit 22ca8782d7c4c0211e13c95b425d4f29f53f995e
lecorguille
parents:
diff
changeset
|
411 rm(list = ls()) |