Mercurial > repos > yguitton > metams_rungc
annotate metams.r @ 0:2066efbafd7c draft
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
author | yguitton |
---|---|
date | Wed, 13 Jul 2016 06:46:45 -0400 |
parents | |
children | 142fbe102a9d |
rev | line source |
---|---|
0
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
1 #!/usr/local/public/bin/Rscript --vanilla --slave --no-site-file |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
2 # metams.r version="0.99.9" |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
3 #created by Yann GUITTON |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
4 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
5 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
6 #Redirect all stdout to the log file |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
7 log_file=file("metams.log", open = "wt") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
8 sink(log_file) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
9 sink(log_file, type = "out") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
10 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
11 library(metaMS) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
12 library(batch) #necessary for parseCommandArgs function |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
13 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
14 source_local <- function(fname) { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
15 argv <- commandArgs(trailingOnly = FALSE) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
16 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
17 source(paste(base_dir, fname, sep="/")) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
18 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
19 print("step1") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
20 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
21 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
22 listArguments = parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
23 print("new version 8") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
24 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
25 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
26 print(listArguments) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
27 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
28 if (listArguments[["ri"]]!="NULL"){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
29 RIarg=read.table(listArguments[["ri"]], h=T) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
30 colnames(RIarg)<-c("rt","RI") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
31 # print(RIarg) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
32 } else { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
33 RIarg = NULL |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
34 # cat("Ri= ",RIarg) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
35 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
36 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
37 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
38 DBarg=listArguments[["db"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
39 # if (listArguments[["use_db"]]!="NULL"){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
40 if (DBarg!="NULL"){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
41 DBarg=listArguments[["db"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
42 cat("Db= ",DBarg) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
43 } else { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
44 DBarg = NULL |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
45 cat("NO Db : ",DBarg) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
46 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
47 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
48 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
49 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
50 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
51 #for unknown EIC printing |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
52 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
53 if (listArguments[["unkn"]]!="NULL") { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
54 unknarg<-"" |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
55 } else { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
56 unknarg<-listArguments[["unkn"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
57 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
58 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
59 print(paste("Unkn:",unknarg)) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
60 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
61 #remove unused arguments |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
62 listArguments[["unkn"]]<-NULL |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
63 listArguments[["db"]] <- NULL |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
64 listArguments[["ri"]] <- NULL |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
65 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
66 print(" step2") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
67 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
68 #runGC accept either a list of files a zip folder or an xset object from xcms.xcmsSet tool |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
69 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
70 #CASE 2 from zip file |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
71 #necessary to unzip .zip file uploaded to Galaxy |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
72 #thanks to .zip file it's possible to upload many file as the same time conserving the tree hierarchy of directories |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
73 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
74 if (!is.null(listArguments[["zipfile"]])){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
75 print("CASE 2 from zip file") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
76 directory=unzip(listArguments[["zipfile"]]) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
77 listArguments=append(list(directory), listArguments) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
78 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
79 metams_zip_file= listArguments[["zipfile"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
80 listArguments[["zipfile"]]=NULL |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
81 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
82 filepattern <- c("[Cc][Dd][Ff]", "[Nn][Cc]", "([Mm][Zz])?[Xx][Mm][Ll]","[Mm][Zz][Dd][Aa][Tt][Aa]", "[Mm][Zz][Mm][Ll]") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
83 filepattern <- paste(paste("\\.", filepattern, "$", sep = ""),collapse = "|") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
84 #samples<-list.files(path=directory, pattern=filepattern, all.files=FALSE,recursive=TRUE,full.names=TRUE,ignore.case=FALSE) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
85 samples<-directory[grep(filepattern, directory)] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
86 # cat(samples) #debugg |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
87 #create sampleMetadata, get sampleMetadata and class |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
88 sampleMetadata<-xcms:::phenoDataFromPaths(samples) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
89 sampleMetadata<-cbind(sampleMetadata=rownames(sampleMetadata),sampleMetadata) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
90 row.names(sampleMetadata)<-NULL |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
91 } else { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
92 metams_zip_file="" |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
93 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
94 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
95 #CASE 3 from xset is an .RData file necessary to use the xcmsSet object generated by xcms.xcmsSet given by previous tools |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
96 if (!is.null(listArguments[["xset"]])){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
97 print("CASE 3 from xset") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
98 require(CAMERA, quietly = TRUE) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
99 load(listArguments[["xset"]]) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
100 cat(class(xset)) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
101 xsetparam=listArguments[["xset"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
102 listArguments[["xset"]]=NULL #remove xset from arguments |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
103 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
104 #xset from xcms.xcmsSet is not well formatted for metaMS this function do the formatting |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
105 if (class(xset)=="xcmsSet"){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
106 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
107 #treat case where Rdata came from xcmsSet with zip file entry |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
108 if(exists("zip_file")){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
109 if (zip_file!=""){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
110 directory=unzip(zip_file) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
111 print("CASE 3 from xset and with ZIP input") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
112 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
113 } else { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
114 print("CASE 3 from xset and with LIBRARY input") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
115 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
116 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
117 #end zip file case |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
118 if (length(xset@rt$raw)>1){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
119 #create an exceptable list of xset for metaMS |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
120 xset.l<-vector("list",length(xset@rt$raw)) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
121 for (i in 1:length(xset@rt$raw)){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
122 xset.l[[i]]<-new("xcmsSet") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
123 xset.l[[i]]@peaks<-xset@peaks[which(xset@peaks[,"sample"]==i),] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
124 df<-data.frame(class=xset@phenoData[i,]) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
125 rownames(df)<-rownames(xset@phenoData)[i] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
126 xset.l[[i]]@phenoData<-df |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
127 xset.l[[i]]@rt$raw<-xset@rt$raw[[i]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
128 xset.l[[i]]@rt$corrected<-xset@rt$corrected[[i]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
129 xset.l[[i]]@filepaths<-xset@filepaths[i] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
130 xset.l[[i]]@profinfo<-xset@profinfo |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
131 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
132 } else { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
133 xset.l<-xset |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
134 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
135 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
136 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
137 #create sampleMetadata, get sampleMetadata and class |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
138 sampleMetadata<-xset@phenoData |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
139 sampleMetadata<-cbind(sampleMetadata=rownames(sampleMetadata),sampleMetadata) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
140 row.names(sampleMetadata)<-NULL |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
141 samples<-xset@filepaths |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
142 } else { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
143 xsetparam<-NULL |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
144 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
145 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
146 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
147 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
148 #Import the different functions |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
149 source_local("lib_metams.r") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
150 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
151 #load function for ploting EICs and pspectra |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
152 # source_local("plotUnknown.r") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
153 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
154 #settings process |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
155 if (listArguments[["settings"]]=="default") { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
156 data(FEMsettings) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
157 if (listArguments[["rtrange"]][1]!="NULL") { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
158 rtrange=listArguments[["rtrange"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
159 } else { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
160 rtrange=NULL |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
161 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
162 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
163 if (!is.null(DBarg)){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
164 manual <- read.msp(DBarg) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
165 DBarg <- createSTDdbGC(stdInfo = NULL, settings = TSQXLS.GC, manualDB = manual) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
166 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
167 nSlaves=listArguments[["nSlaves"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
168 if(!metams_zip_file=="") { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
169 resGC<-runGC(files=samples,settings=TSQXLS.GC, rtrange=rtrange, DB= DBarg, removeArtefacts = TRUE, findUnknowns = TRUE, returnXset = TRUE, RIstandards = RIarg, nSlaves = nSlaves) #default settings for GC from Wehrens et al |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
170 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
171 if(!is.null(xsetparam)){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
172 settingslist=TSQXLS.GC |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
173 if (class(xset.l[[1]])!="xsAnnotate"){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
174 cat("Process xsAnnotate") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
175 xset<-lapply(xset.l, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
176 function(x) { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
177 y <- xsAnnotate(x, sample = 1) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
178 capture.output(z <- groupFWHM(y, perfwhm = settingslist@CAMERA$perfwhm), |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
179 file = NULL) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
180 z}) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
181 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
182 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
183 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
184 resGC<-runGC(xset=xset,settings=TSQXLS.GC, rtrange=rtrange, DB= DBarg, removeArtefacts = TRUE, findUnknowns = TRUE, returnXset = TRUE, RIstandards = RIarg, nSlaves = nSlaves) #default settings for GC from Wehrens et al |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
185 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
186 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
187 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
188 if (listArguments[["settings"]]=="User_defined") { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
189 listArguments[["settings"]]=NULL #delete from the list of arguments |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
190 fwhmparam=listArguments[["fwhm"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
191 rtdiffparam=listArguments[["rtdiff"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
192 #RIdiffparam=listArguments[["RIdiff"]] #only if timeComparison = "RI" |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
193 minfeatparam=listArguments[["minfeat"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
194 simthreshparam=listArguments[["simthreshold"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
195 minclassfractionparam=listArguments[["minclassfraction"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
196 minclasssizeparam=listArguments[["minclasssize"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
197 if (listArguments[["rtrange"]]!="NULL") { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
198 rtrange=listArguments[["rtrange"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
199 cat("rtrange= ",rtrange) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
200 } else { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
201 rtrange=NULL |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
202 cat("rtrange= ",rtrange) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
203 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
204 nSlaves=listArguments[["nSlaves"]] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
205 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
206 GALAXY.GC <- metaMSsettings("protocolName" = "GALAXY.GC", |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
207 "chrom" = "GC", |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
208 PeakPicking = list( |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
209 method = "matchedFilter", |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
210 step = 0.5, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
211 steps = 2, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
212 mzdiff = .5, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
213 fwhm = fwhmparam, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
214 snthresh = 2, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
215 max = 500), |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
216 CAMERA = list(perfwhm = 1)) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
217 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
218 metaSetting(GALAXY.GC, "DBconstruction") <- list( |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
219 minintens = 0.0, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
220 rttol = rtdiffparam, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
221 intensityMeasure = "maxo", |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
222 DBthreshold = .80, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
223 minfeat = minfeatparam) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
224 metaSetting(GALAXY.GC, "match2DB") <- list( |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
225 simthresh = simthreshparam, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
226 timeComparison = "rt", |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
227 rtdiff = rtdiffparam, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
228 RIdiff = 5, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
229 minfeat = minfeatparam) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
230 #to be used when DB option will be available |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
231 # metaSetting(GALAXY.GC, "matchIrrelevants") <- list( |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
232 # irrelevantClasses = c("Bleeding", "Plasticizers"), |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
233 # timeComparison = "rt", |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
234 # RIdiff = 2, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
235 # rtdiff = rtdiffparam, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
236 # simthresh = simthreshparam) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
237 metaSetting(GALAXY.GC, "betweenSamples") <- list( |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
238 min.class.fraction = minclassfractionparam, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
239 min.class.size = minclasssizeparam, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
240 timeComparison = "rt", |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
241 rtdiff = rtdiffparam, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
242 RIdiff = 2, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
243 simthresh = simthreshparam) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
244 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
245 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
246 # files, xset, settings, rtrange = NULL, DB = NULL, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
247 # removeArtefacts = TRUE, findUnknowns = nexp > 1, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
248 # returnXset = FALSE, RIstandards = NULL, nSlaves = 0 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
249 if (!is.null(DBarg)){ |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
250 manual <- read.msp(DBarg) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
251 DBarg <- createSTDdbGC(stdInfo = NULL, settings = GALAXY.GC, manualDB = manual) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
252 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
253 if (!metams_zip_file=="") { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
254 resGC<-runGC(files=samples,settings=GALAXY.GC,rtrange = rtrange, DB= DBarg , removeArtefacts = TRUE, findUnknowns = TRUE, returnXset = TRUE, RIstandards = RIarg, nSlaves = nSlaves) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
255 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
256 if(!is.null(xsetparam)) { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
257 settingslist=GALAXY.GC |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
258 if (class(xset.l[[1]])!="xsAnnotate") { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
259 print("Process xsAnnotate") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
260 xset<-lapply(xset.l, |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
261 function(x) { |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
262 y <- xsAnnotate(x, sample = 1) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
263 capture.output(z <- groupFWHM(y, perfwhm = settingslist@CAMERA$perfwhm), |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
264 file = NULL) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
265 z}) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
266 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
267 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
268 resGC<-runGC(xset=xset,settings=GALAXY.GC,rtrange = rtrange, DB= DBarg, removeArtefacts = TRUE, findUnknowns = TRUE, returnXset = TRUE, RIstandards = RIarg, nSlaves = nSlaves) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
269 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
270 } |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
271 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
272 #peakTable ordered by rt |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
273 peaktable<-resGC$PeakTable<-resGC$PeakTable[order(resGC$PeakTable[,"rt"]),] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
274 write.table(peaktable, file="peaktable.tsv", sep="\t", row.names=FALSE) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
275 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
276 #peakTable for PCA |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
277 #dataMatrix |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
278 dataMatrix<-cbind(Name=resGC$PeakTable[,"Name"],resGC$PeakTable[,(colnames(resGC$PeakTable) %in% sampleMetadata[,1])]) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
279 rownames(dataMatrix)<-NULL |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
280 write.table(dataMatrix, file="dataMatrix.tsv", sep="\t", row.names=FALSE, quote=FALSE) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
281 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
282 #variableMetadata |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
283 variableMetadata<-resGC$PeakTable[,!(colnames(resGC$PeakTable) %in% sampleMetadata[,1])] |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
284 rownames(variableMetadata)<-NULL |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
285 write.table(variableMetadata, file="variableMetadata.tsv", sep="\t", row.names=FALSE, quote=FALSE) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
286 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
287 #sampleMetadata |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
288 write.table(sampleMetadata, file="sampleMetadata.tsv", sep="\t", row.names=FALSE, quote=FALSE) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
289 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
290 #peak spectrum as MSP for DB search |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
291 write.msp(resGC$PseudoSpectra, file="peakspectra.msp", newFile = TRUE) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
292 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
293 #TIC/BPC picture generation |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
294 # use files as entry not xset that do not exist |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
295 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
296 print("TICs") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
297 #Use getTIC2s and getBPC2s because getTICs and getBPCs can exists due to transfert of function in Rdata |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
298 b<-getTIC2s(files = samples, pdfname="TICs_raw.pdf", rt="raw") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
299 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
300 print("BPCs") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
301 c<-getBPC2s(files=samples, rt="raw", pdfname="BPCs_raw.pdf") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
302 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
303 print("Step QC plot") |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
304 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
305 #Quality controls plots but only working in R (don't know why) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
306 a<-plotUnknowns(resGC=resGC, unkn=unknarg) #use unknparam value |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
307 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
308 # create a mergpdf |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
309 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
310 #test |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
311 system(paste('gs -o TICsBPCs_merged.pdf -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress *Cs_raw.pdf')) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
312 system(paste('gs -o GCMS_EIC.pdf -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress Unknown_*')) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
313 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
314 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
315 ############################################TEST FUNCTION START################################################################# |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
316 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
317 ############################################TEST FUNCTION END################################################################# |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
318 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
319 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
320 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
321 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
322 #zip files of all runGC outputs |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
323 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
324 system(paste('ls . | grep -e "tsv$" -e "msp$" -e "GCMS_" | zip -r -@ "rungc.zip"')) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
325 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
326 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
327 #delete the parameters to avoid the passage to the next tool in .RData image |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
328 rm(listArguments) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
329 |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
330 #saving R data in .Rdata file to save the variables used in the present tool |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
331 save.image(paste("runGC","RData",sep=".")) |
2066efbafd7c
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 6384fcf4496a64affe0b8a173c3f7ea09a275ffb
yguitton
parents:
diff
changeset
|
332 |