annotate metaMS_runGC.r @ 4:c10824185547 draft

planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
author workflow4metabolomics
date Wed, 03 Jul 2019 05:14:32 -0400
parents
children b8d4129dd2a6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
1 #!/usr/bin/env Rscript
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
2 # metaMS_runGC.r version="3.0.0"
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
3 #created by Yann GUITTON and updated by Julien SAINT-VANNE
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
4 #use RI options + add try on plotUnknown add session Info
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
5 #use make.names in sampleMetadata to avoid issues with files names
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
6
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
7
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
8 # ----- LOG FILE -----
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
9 #log_file=file("log.txt", open = "wt")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
10 #sink(log_file)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
11 #sink(log_file, type = "output")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
12
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
13
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
14 # ----- PACKAGE -----
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
15 cat("\tSESSION INFO\n\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
16
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
17 #Import the different functions and packages
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
18 source_local <- function(fname) {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
19 argv <- commandArgs(trailingOnly = FALSE)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
20 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
21 source(paste(base_dir, fname, sep="/"))
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
22 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
23 source_local("lib_metams.r")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
24
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
25 pkgs <- c("metaMS","stringr","batch","CAMERA") #"batch" necessary for parseCommandArgs function
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
26 loadAndDisplayPackages(pkgs)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
27
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
28 cat("\n\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
29
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
30 modNamC <- "metaMS:runGC" ## module name
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
31 cat("\nStart of the '", modNamC, "' Galaxy module call: ", format(Sys.time(), "%a %d %b %Y %X"), "\n", sep="")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
32
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
33
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
34 # ----- PROCESSING INFILE -----
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
35 cat("\n\n\tARGUMENTS PROCESSING INFO\n\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
36 args = parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
37 #write.table(as.matrix(args), col.names=F, quote=F, sep='\t\t')
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
38 print(cbind(value = unlist(args)))
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
39
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
40 # ----- PROCESSING INFILE -----
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
41 cat("\n\n\tARGUMENTS PROCESSING INFO\n\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
42
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
43 # Saving the specific parameters
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
44 #RI parameter
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
45 if (args$ri!="NULL"){
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
46 RIarg=read.table(args$ri)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
47 if (ncol(RIarg) < 2) RIarg=read.table(args$ri, h=T, sep=";")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
48 if (ncol(RIarg) < 2) RIarg=read.table(args$ri, h=T, sep="\t")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
49 if (ncol(RIarg) < 2) RIarg=read.table(args$ri, h=T, sep=",")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
50 if (ncol(RIarg) < 2) {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
51 error_message="Your RI file seems not well formatted. The column separators accepted are ; , and tabulation"
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
52 print(error_message)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
53 stop(error_message)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
54 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
55 #to do check real column names
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
56 colnames(RIarg)<-c("rt","RI")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
57 } else {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
58 RIarg = NULL
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
59 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
60
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
61 #RIshift parameter
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
62 if (args$rishift!="none"){
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
63 RIshift=args$rishift
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
64 } else {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
65 RIshift = "none"
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
66 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
67
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
68 #Personal database parameter
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
69 if (args$db!="NULL"){
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
70 DBgc=args$db
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
71 } else {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
72 DBgc = NULL
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
73 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
74
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
75 #settings process
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
76 if (args$settings=="default") {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
77 cat("Using default parameters")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
78 data(FEMsettings)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
79 if (args$rtrange[1]!="NULL") {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
80 rtrange=args$rtrange
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
81 } else {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
82 rtrange=NULL
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
83 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
84
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
85 if (!is.null(DBgc)){
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
86 manual <- read.msp(DBgc)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
87 DBgc <- createSTDdbGC(stdInfo = NULL, settings = TSQXLS.GC, manualDB = manual)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
88 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
89
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
90 #use RI instead of rt for time comparison vs DB
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
91 if (RIshift!="none"){
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
92 TSQXLS.GC@match2DB.timeComparison<-"RI"
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
93 TSQXLS.GC@match2DB.RIdiff<-as.numeric(RIshift)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
94 TSQXLS.GC@betweenSamples.timeComparison<-"RI"
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
95 TSQXLS.GC@betweenSamples.RIdiff<-as.numeric(RIshift)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
96 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
97 nSlaves=args$nSlaves
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
98 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
99
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
100 if (args$settings=="User_defined") {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
101 cat("Using user's parameters\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
102 fwhmparam=args$fwhm
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
103 rtdiffparam=args$rtdiff
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
104 minfeatparam=args$minfeat
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
105 simthreshparam=args$simthreshold
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
106 minclassfractionparam=args$minclassfraction
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
107 minclasssizeparam=args$minclasssize
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
108
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
109 if (args$rtrange!="NULL") {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
110 rtrange=args$rtrange
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
111 cat("rtrange= ",rtrange)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
112 } else {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
113 rtrange=NULL
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
114 cat("rtrange= ",rtrange)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
115 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
116
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
117 nSlaves=args$nSlaves
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
118
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
119 GALAXY.GC <-
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
120 metaMSsettings("protocolName" = "GALAXY.GC",
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
121 "chrom" = "GC",
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
122 PeakPicking = list(
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
123 method = "matchedFilter",
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
124 step = 0.5,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
125 steps = 2,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
126 mzdiff = .5,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
127 fwhm = fwhmparam,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
128 snthresh = 2,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
129 max = 500),
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
130 CAMERA = list(perfwhm = 1))
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
131
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
132 metaSetting(GALAXY.GC, "DBconstruction") <- list(
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
133 minintens = 0.0,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
134 rttol = rtdiffparam,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
135 intensityMeasure = "maxo",
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
136 DBthreshold = .80,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
137 minfeat = minfeatparam)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
138 metaSetting(GALAXY.GC, "match2DB") <- list(
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
139 simthresh = simthreshparam,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
140 timeComparison = "rt",
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
141 rtdiff = rtdiffparam,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
142 RIdiff = 5,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
143 minfeat = minfeatparam)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
144
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
145 #to used if contaminant filter
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
146
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
147 # metaSetting(GALAXY.GC, "matchIrrelevants") <- list(
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
148 # irrelevantClasses = c("Bleeding", "Plasticizers"),
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
149 # timeComparison = "RI",
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
150 # RIdiff = RIdiffparam,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
151 # rtdiff = rtdiffparam,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
152 # simthresh = simthreshparam)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
153
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
154 metaSetting(GALAXY.GC, "betweenSamples") <- list(
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
155 min.class.fraction = minclassfractionparam,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
156 min.class.size = minclasssizeparam,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
157 timeComparison = "rt",
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
158 rtdiff = rtdiffparam,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
159 RIdiff = 2,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
160 simthresh = simthreshparam)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
161
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
162 #ONLY use RI instead of rt for time comparison vs DB or samples
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
163 if (RIshift!="none"){
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
164 GALAXY.GC@match2DB.timeComparison<-"RI"
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
165 GALAXY.GC@match2DB.RIdiff<-as.numeric(RIshift)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
166 GALAXY.GC@betweenSamples.timeComparison<-"RI"
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
167 GALAXY.GC@betweenSamples.RIdiff<-as.numeric(RIshift)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
168 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
169
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
170 if (!is.null(DBgc)){
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
171 manual <- read.msp(DBgc)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
172 DBgc <- createSTDdbGC(stdInfo = NULL, settings = GALAXY.GC, manualDB = manual)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
173 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
174 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
175
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
176
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
177 # ----- INFILE PROCESSING -----
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
178 cat("\n\n\n\tINFILE PROCESSING INFO\n\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
179
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
180 # Handle infiles
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
181 if (!exists("singlefile")) singlefile <- NULL
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
182 if (!exists("zipfile")) zipfile <- NULL
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
183 rawFilePath <- getRawfilePathFromArguments(singlefile, zipfile, args)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
184 zipfile <- rawFilePath$zipfile
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
185 singlefile <- rawFilePath$singlefile
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
186 directory <- retrieveRawfileInTheWorkingDirectory(singlefile, zipfile)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
187
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
188
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
189 # ----- MAIN PROCESSING INFO -----
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
190 cat("\n\tMAIN PROCESSING INFO\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
191
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
192 cat("\t\tCOMPUTE\n\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
193
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
194 #runGC accept either a list of files a zip folder or an xset object from xcms.xcmsSet tool
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
195 #From xset is an .RData file necessary to use the xcmsSet object generated by xcms.xcmsSet given by previous tools
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
196 if (!is.null(args$singlefile_galaxyPath)){
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
197 cat("Loading datas from XCMS file(s)...\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
198 load(args$singlefile_galaxyPath)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
199
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
200 #Transform XCMS object if needed
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
201 if(!exists("xset")) {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
202 if(exists("xdata")) {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
203 xset<-getxcmsSetObject(xdata)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
204 } else {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
205 error_message="no xset and no xdata... Probably a problem"
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
206 print(error_message)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
207 stop(error_message)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
208 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
209 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
210
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
211 #xset from xcms.xcmsSet is not well formatted for metaMS this function do the formatting
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
212 if (class(xset)=="xcmsSet"){
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
213 if (length(xset@rt$raw)>1){
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
214 #create an exceptable list of xset for metaMS
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
215 xset.l<-vector("list",length(xset@rt$raw))
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
216 for (i in 1:length(xset@rt$raw)){
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
217 xset.l[[i]]<-new("xcmsSet")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
218 xset.l[[i]]@peaks<-xset@peaks[which(xset@peaks[,"sample"]==i),]
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
219 df<-data.frame(class=xset@phenoData[i,])
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
220 rownames(df)<-rownames(xset@phenoData)[i]
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
221 xset.l[[i]]@phenoData<-df
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
222 xset.l[[i]]@rt$raw<-xset@rt$raw[[i]]
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
223 xset.l[[i]]@rt$corrected<-xset@rt$corrected[[i]]
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
224 xset.l[[i]]@filepaths<-xset@filepaths[i]
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
225 xset.l[[i]]@profinfo<-xset@profinfo
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
226 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
227 } else {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
228 xset.l<-xset
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
229 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
230
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
231 #create sampleMetadata, get sampleMetadata and class
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
232 sampleMetadata<-xset@phenoData
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
233 colnames(sampleMetadata) <- c("sampleMetadata","sample_group","class")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
234 sampleMetadata<-sampleMetadata[,-2]
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
235 row.names(sampleMetadata)<-NULL
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
236 samples<-xset@filepaths
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
237 } else {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
238 xset<-NULL
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
239 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
240 if(args$settings == "default") {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
241 settingslist=TSQXLS.GC
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
242 if (class(xset.l[[1]])!="xsAnnotate"){
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
243 cat("Process xsAnnotate with CAMERA package...\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
244 xsetCAM<-lapply(xset.l,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
245 function(x) {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
246 y <- xsAnnotate(x, sample = 1)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
247 capture.output(z <- groupFWHM(y, perfwhm = settingslist@CAMERA$perfwhm),
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
248 file = NULL)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
249 z})
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
250 } else {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
251 xsetCAM <- xset.l
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
252 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
253
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
254 #default settings for GC from Wehrens et al
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
255 cat("Process runGC with metaMS package...\n\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
256 print(str(TSQXLS.GC))
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
257 resGC<-runGC(xset=xsetCAM,settings=TSQXLS.GC, rtrange=rtrange, DB= DBgc, removeArtefacts = TRUE,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
258 findUnknowns = TRUE, returnXset = TRUE, RIstandards = RIarg, nSlaves = nSlaves)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
259 } else {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
260 if(args$settings == "User_defined") {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
261 settingslist=GALAXY.GC
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
262 if (class(xset.l[[1]])!="xsAnnotate") {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
263 cat("Process xsAnnotate with CAMERA package...\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
264 xsetCAM<-lapply(xset.l,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
265 function(x) {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
266 y <- xsAnnotate(x, sample = 1)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
267 capture.output(z <- groupFWHM(y, perfwhm = settingslist@CAMERA$perfwhm),
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
268 file = NULL)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
269 z})
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
270 } else {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
271 xsetCAM <- xset.l
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
272 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
273
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
274 #user settings for GC
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
275 cat("Process runGC with metaMS package...\n\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
276 print(str(GALAXY.GC))
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
277 resGC<-runGC(xset=xsetCAM,settings=GALAXY.GC,rtrange = rtrange, DB= DBgc, removeArtefacts = TRUE,
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
278 findUnknowns = TRUE, returnXset = TRUE, RIstandards = RIarg, nSlaves = nSlaves)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
279 } else {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
280 error_message <- "There is no xset"
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
281 print(error_message)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
282 stop(error_message)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
283 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
284 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
285 } else {
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
286 error_message <- "No galaxy path entered"
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
287 print(error_message)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
288 stop(error_message)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
289 }
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
290
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
291
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
292 # ----- EXPORT -----
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
293 #peakTable ordered by rt
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
294 cat("\nGenerating peakTable file")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
295 peaktable<-getCorrectFileName(resGC$PeakTable,sampleMetadata)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
296 cat("\t.\t.")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
297 write.table(peaktable, file="peaktable.tsv", sep="\t", row.names=FALSE)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
298 cat("\t.\tOK")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
299
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
300 #peakTable for PCA
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
301 #dataMatrix
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
302 cat("\nGenerating dataMatrix file")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
303 dataMatrix<-cbind(Name=peaktable[,"Name"],peaktable[,(colnames(peaktable) %in% sampleMetadata[,1])])
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
304 rownames(dataMatrix)<-NULL
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
305 cat("\t.\t.")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
306 write.table(dataMatrix, file="dataMatrix.tsv", sep="\t", row.names=FALSE, quote=FALSE)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
307 cat("\t.\tOK")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
308
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
309 #variableMetadata
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
310 cat("\nGenerating variableMetadata file")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
311 variableMetadata<-peaktable[,!(colnames(peaktable) %in% sampleMetadata[,1])]
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
312 rownames(variableMetadata)<-NULL
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
313 cat("\t.")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
314 write.table(variableMetadata, file="variableMetadata.tsv", sep="\t", row.names=FALSE, quote=FALSE)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
315 cat("\t.\tOK")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
316
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
317 #sampleMetadata
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
318 cat("\nGenerating sampleMetadata file")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
319 cat("\t.\t.")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
320 write.table(sampleMetadata, file="sampleMetadata.tsv", sep="\t", row.names=FALSE, quote=FALSE)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
321 cat("\t.\tOK")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
322
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
323 #peak spectrum as MSP for DB search
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
324 cat("\nGenerating",length(resGC$PseudoSpectra),"peakspectra in peakspectra.msp file\n")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
325 write.msp(resGC$PseudoSpectra, file="peakspectra.msp", newFile = TRUE)
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
326
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
327 #saving R data in .Rdata file to save the variables used in the present tool
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
328 objects2save <- c("resGC", "xset", "singlefile", "zipfile", "DBgc")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
329 save(list = objects2save[objects2save %in% ls()], file = "runGC.RData")
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
330
c10824185547 planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 174a1713024f246c1485cbd75218577e89353522
workflow4metabolomics
parents:
diff changeset
331 cat("\nEnd of '", modNamC, "' Galaxy module call: ", as.character(Sys.time()), "\n", sep = "")