annotate assess_purity_msms.R @ 22:c8b34df46dae draft

planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 04023134d8f28e85927ca293373c506484149ead-dirty
author tomnl
date Fri, 01 Jun 2018 13:41:15 -0400
parents b83bcc259b76
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
1 library(msPurity)
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
2 library(optparse)
2
b83bcc259b76 planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2e847122cf605951c334858455fc1d3ebdb189e9-dirty
tomnl
parents: 0
diff changeset
3 print(sessionInfo())
0
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
4
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
5 option_list <- list(
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
6 make_option(c("-o", "--out_dir"), type="character"),
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
7 make_option("--mzML_files", type="character"),
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
8 make_option("--galaxy_names", type="character"),
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
9 make_option("--minOffset", default=0.5),
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
10 make_option("--maxOffset", default=0.5),
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
11 make_option("--ilim", default=0.05),
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
12 make_option("--iwNorm", default="none", type="character"),
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
13 make_option("--exclude_isotopes", action="store_true"),
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
14 make_option("--isotope_matrix", type="character"),
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
15 make_option("--mostIntense", action="store_true"),
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
16 make_option("--plotP", action="store_true"),
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
17 make_option("--nearest", action="store_true"),
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
18 make_option("--cores", default=4)
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
19 )
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
20
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
21 # store options
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
22 opt<- parse_args(OptionParser(option_list=option_list))
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
23
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
24 minOffset = as.numeric(opt$minOffset)
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
25 maxOffset = as.numeric(opt$maxOffset)
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
26
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
27 if (opt$iwNorm=='none'){
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
28 iwNorm = FALSE
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
29 iwNormFun = NULL
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
30 }else if (opt$iwNorm=='gauss'){
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
31 iwNorm = TRUE
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
32 iwNormFun = msPurity::iwNormGauss(minOff=-minOffset, maxOff=maxOffset)
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
33 }else if (opt$iwNorm=='rcosine'){
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
34 iwNorm = TRUE
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
35 iwNormFun = msPurity::iwNormRcosine(minOff=-minOffset, maxOff=maxOffset)
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
36 }else if (opt$iwNorm=='QE5'){
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
37 iwNorm = TRUE
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
38 iwNormFun = msPurity::iwNormQE.5()
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
39 }
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
40
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
41 filepaths <- trimws(strsplit(opt$mzML_files, ',')[[1]])
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
42 filepaths <- filepaths[filepaths != ""]
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
43
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
44
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
45
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
46 if(is.null(opt$minOffset) || is.null(opt$maxOffset)){
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
47 offsets = NA
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
48 }else{
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
49 offsets = as.numeric(c(opt$minOffset, opt$maxOffset))
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
50 }
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
51
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
52
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
53 if(is.null(opt$mostIntense)){
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
54 mostIntense = FALSE
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
55 }else{
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
56 mostIntense = TRUE
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
57 }
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
58
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
59 if(is.null(opt$nearest)){
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
60 nearest = FALSE
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
61 }else{
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
62 nearest = TRUE
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
63 }
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
64
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
65 if(is.null(opt$plotP)){
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
66 plotP = FALSE
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
67 plotdir = NULL
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
68 }else{
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
69 plotP = TRUE
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
70 plotdir = opt$out_dir
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
71 }
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
72
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
73
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
74 if (is.null(opt$isotope_matrix)){
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
75 im <- NULL
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
76 }else{
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
77 im <- read.table(opt$isotope_matrix,
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
78 header = TRUE, sep='\t', stringsAsFactors = FALSE)
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
79 }
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
80
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
81 if (is.null(opt$exclude_isotopes)){
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
82 isotopes <- FALSE
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
83 }else{
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
84 isotopes <- TRUE
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
85 }
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
86
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
87 pa <- msPurity::purityA(filepaths,
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
88 cores = opt$cores,
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
89 mostIntense = mostIntense,
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
90 nearest = nearest,
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
91 offsets = offsets,
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
92 plotP = plotP,
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
93 plotdir = plotdir,
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
94 interpol = "linear",
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
95 iwNorm = iwNorm,
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
96 iwNormFun = iwNormFun,
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
97 ilim = opt$ilim,
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
98 mzRback = "pwiz",
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
99 isotopes = isotopes,
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
100 im = im)
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
101
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
102
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
103 if (!is.null(opt$galaxy_names)){
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
104 galaxy_names <- trimws(strsplit(opt$galaxy_names, ',')[[1]])
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
105 galaxy_names <- galaxy_names[galaxy_names != ""]
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
106 names(pa@fileList) <- galaxy_names
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
107 }
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
108
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
109 print(pa)
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
110
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
111 save(pa, file=file.path(opt$out_dir, 'purity_msms.RData'))
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
112
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
113 print(head(pa@puritydf))
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
114 write.table(pa@puritydf, file.path(opt$out_dir, 'purity_msms.tsv'), row.names=FALSE, sep='\t')
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
115
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
116 # removed_peaks <- data.frame(removed_peaks)
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
117 # write.table(data.frame('ID'=rownames(removed_peaks),removed_peaks),
dc00b7222a3c planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
tomnl
parents:
diff changeset
118 # file.path(opt$out_dir, 'removed_peaks.txt'), row.names=FALSE, sep='\t')