annotate NmrNormalization_wrapper.R @ 0:a5e6499f1b4d draft default tip

planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
author marie-tremblay-metatoul
date Tue, 22 Nov 2016 06:42:44 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
1 #!/usr/local/public/bin/Rscript --vanilla --slave --no-site-file
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
2
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
3 ## 070115_NmrBucketing2galaxy_v1.R
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
4 ## Marie Tremblay-Franco
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
5 ## MetaboHUB: The French Infrastructure for Metabolomics and Fluxomics
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
6 ## www.metabohub.fr/en
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
7 ## marie.tremblay-franco@toulouse.inra.fr
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
8
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
9 runExampleL <- FALSE
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
10
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
11
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
12 ##------------------------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
13 ## Options
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
14 ##------------------------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
15 strAsFacL <- options()$stringsAsFactors
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
16 options(stringsAsFactors = FALSE)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
17
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
18
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
19 ##------------------------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
20 ## Libraries laoding
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
21 ##------------------------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
22 # For parseCommandArgs function
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
23 library(batch)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
24
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
25 # R script call
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
26 source_local <- function(fname)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
27 {
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
28 argv <- commandArgs(trailingOnly = FALSE)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
29 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
30 source(paste(base_dir, fname, sep="/"))
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
31 }
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
32 #Import the different functions
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
33 source_local("NmrNormalization_script.R")
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
34
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
35 ##------------------------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
36 ## Errors ?????????????????????
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
37 ##------------------------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
38
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
39
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
40 ##------------------------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
41 ## Constants
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
42 ##------------------------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
43 topEnvC <- environment()
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
44 flagC <- "\n"
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
45
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
46
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
47 ##------------------------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
48 ## Script
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
49 ##------------------------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
50 if(!runExampleL)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
51 argLs <- parseCommandArgs(evaluate=FALSE)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
52
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
53
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
54 ## Parameters Loading
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
55 ##-------------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
56 # Inputs
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
57 data <- read.table(argLs[["dataMatrix"]],check.names=FALSE,header=TRUE,sep="\t")
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
58 rownames(data) <- data[,1]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
59 data <- data[,-1]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
60
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
61 scaling <- argLs[["scalingMethod"]]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
62 graphique <- argLs[["graphType"]]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
63
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
64 if (scaling=='PQN')
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
65 {
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
66 metadataSample <- read.table(argLs[["sampleMetadata"]],check.names=FALSE,header=TRUE,sep="\t")
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
67 factor<- argLs[["factor"]]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
68 ControlGroup <- argLs[["controlGroup"]]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
69 }
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
70 if (scaling=='QuantitativeVariable')
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
71 {
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
72 metadataSample <- read.table(argLs[["sampleMetadata"]],check.names=FALSE,header=TRUE,sep="\t")
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
73 factor <- argLs[["factor"]]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
74 }
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
75
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
76 # Outputs
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
77 nomGraphe <- argLs[["graphOut"]]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
78 dataMatrixOut <- argLs[["dataMatrixOut"]]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
79 sampleMetadataOut <- argLs[["sampleMetadataOut"]]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
80 variableMetadataOut <- argLs[["variableMetadataOut"]]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
81 log <- argLs[["logOut"]]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
82
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
83 ## Checking arguments
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
84 ##-------------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
85 error.stock <- "\n"
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
86
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
87 if(length(error.stock) > 1)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
88 stop(error.stock)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
89
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
90
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
91 ## Computation
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
92 ##------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
93 NormalizationResults <- NmrNormalization(dataMatrix=data,scalingMethod=scaling,sampleMetadata=metadataSample,
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
94 bioFactor=factor,ControlGroup=ControlGroup,
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
95 graph=graphique,nomFichier=nomGraphe,savLog.txtC=log)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
96
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
97 data_normalized <- NormalizationResults[[1]]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
98 data_sample <- NormalizationResults[[2]]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
99 data_variable <- NormalizationResults[[3]]
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
100
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
101
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
102
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
103 ## Saving
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
104 ##-------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
105 # Data
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
106 data_normalized <- cbind(rownames(data_normalized),data_normalized)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
107 colnames(data_normalized) <- c("Bucket",colnames(data_normalized)[-1])
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
108 write.table(data_normalized,file=argLs$dataMatrixOut,quote=FALSE,row.names=FALSE,sep="\t")
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
109 # Sample
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
110 data_sample <- cbind(rownames(data_sample),data_sample)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
111 colnames(data_sample) <- c("Sample",colnames(data_sample)[-1])
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
112 write.table(data_sample,file=argLs$sampleMetadataOut,quote=FALSE,row.names=FALSE,sep="\t")
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
113 # Variable
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
114 data_variable <- cbind(rownames(data_variable),data_variable)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
115 colnames(data_variable) <- c("Bucket",colnames(data_variable)[-1])
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
116 write.table(data_variable,file=argLs$variableMetadataOut,quote=FALSE,row.names=FALSE,sep="\t")
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
117
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
118
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
119 ## Ending
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
120 ##---------------------
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
121
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
122 cat("\nEnd of 'Normalization' Galaxy module call: ", as.character(Sys.time()), sep = "")
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
123
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
124 ## sink(NULL)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
125
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
126 options(stringsAsFactors = strAsFacL)
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
127
a5e6499f1b4d planemo upload for repository https://github.com/workflow4metabolomics/spectral_normalization commit 559844c168f0450b9657346ba890d9c028d7537a
marie-tremblay-metatoul
parents:
diff changeset
128 rm(list = ls())