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