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