Mercurial > repos > tomnl > mspurity_dimspredictpuritysingle
annotate spectralMatching.R @ 11:a90832e6acb2 draft
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
| author | tomnl |
|---|---|
| date | Fri, 13 Sep 2019 11:57:28 -0400 |
| parents | 1ce857d74106 |
| children | 1389e565f95e |
| rev | line source |
|---|---|
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
1 library(msPurity) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
2 library(msPurityData) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
3 library(optparse) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
4 print(sessionInfo()) |
|
11
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
5 # load in library spectra config |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
6 source_local <- function(fname){ argv <- commandArgs(trailingOnly=FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep="/")) } |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
7 source_local("dbconfig.R") |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
8 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
9 option_list <- list( |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
10 make_option(c("-o", "--outDir"), type="character"), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
11 make_option("--q_dbPth", type="character"), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
12 make_option("--l_dbPth", type="character"), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
13 |
|
11
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
14 make_option("--q_dbType", type="character", default=NA), |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
15 make_option("--l_dbType", type="character", default=NA), |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
16 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
17 make_option("--q_msp", type="character", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
18 make_option("--l_msp", type="character", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
19 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
20 make_option("--q_defaultDb", action="store_true"), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
21 make_option("--l_defaultDb", action="store_true"), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
22 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
23 make_option("--q_ppmPrec", type="double"), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
24 make_option("--l_ppmPrec", type="double"), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
25 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
26 make_option("--q_ppmProd", type="double"), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
27 make_option("--l_ppmProd", type="double"), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
28 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
29 make_option("--q_raThres", type="double", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
30 make_option("--l_raThres", type="double", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
31 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
32 make_option("--q_polarity", type="character", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
33 make_option("--l_polarity", type="character", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
34 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
35 make_option("--q_purity", type="double", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
36 make_option("--l_purity", type="double", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
37 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
38 make_option("--q_xcmsGroups", type="character", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
39 make_option("--l_xcmsGroups", type="character", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
40 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
41 make_option("--q_pids", type="character", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
42 make_option("--l_pids", type="character", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
43 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
44 make_option("--q_rtrangeMin", type="double", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
45 make_option("--l_rtrangeMin", type="double", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
46 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
47 make_option("--q_rtrangeMax", type="double", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
48 make_option("--l_rtrangeMax", type="double", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
49 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
50 make_option("--q_accessions", type="character", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
51 make_option("--l_accessions", type="character", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
52 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
53 make_option("--q_sources", type="character", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
54 make_option("--l_sources", type="character", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
55 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
56 make_option("--q_sourcesUser", type="character", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
57 make_option("--l_sourcesUser", type="character", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
58 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
59 make_option("--q_instrumentTypes", type="character", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
60 make_option("--l_instrumentTypes", type="character", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
61 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
62 make_option("--q_instrumentTypesUser", type="character", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
63 make_option("--l_instrumentTypesUser", type="character", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
64 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
65 make_option("--q_instruments", type="character", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
66 make_option("--l_instruments", type="character", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
67 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
68 make_option("--q_spectraTypes", type="character", default=NA), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
69 make_option("--l_spectraTypes", type="character", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
70 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
71 make_option("--q_spectraFilter", action="store_true"), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
72 make_option("--l_spectraFilter", action="store_true"), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
73 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
74 make_option("--usePrecursors", action="store_true"), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
75 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
76 make_option("--mzW", type="double"), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
77 make_option("--raW", type="double"), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
78 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
79 make_option("--rttol", type="double", default=NA), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
80 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
81 make_option("--updateDb", action="store_true"), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
82 make_option("--copyDb", action="store_true"), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
83 make_option("--cores", default=1) |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
84 |
|
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
85 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
86 ) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
87 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
88 # store options |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
89 opt<- parse_args(OptionParser(option_list=option_list)) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
90 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
91 print(opt) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
92 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
93 extractMultiple <- function(optParam){ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
94 if (!is.na(optParam)){ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
95 param <- trimws(strsplit(optParam, ',')[[1]]) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
96 param <- param[param != ""] |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
97 }else{ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
98 param <- NA |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
99 } |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
100 return(param) |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
101 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
102 } |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
103 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
104 if(!is.null(opt$q_defaultDb)){ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
105 q_dbPth <- system.file("extdata", "library_spectra", "library_spectra.db", package="msPurityData") |
|
11
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
106 q_dbType <- 'sqlite' |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
107 }else if (!opt$q_dbType=='local_config'){ |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
108 q_dbType <- opt$q_dbType |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
109 q_dbPth <- opt$q_dbPth |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
110 } |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
111 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
112 if(!is.null(opt$l_defaultDb)){ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
113 l_dbPth <- system.file("extdata", "library_spectra", "library_spectra.db", package="msPurityData") |
|
11
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
114 l_dbType <- 'sqlite' |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
115 }else if (!opt$l_dbType=='local_config'){ |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
116 l_dbType <- opt$l_dbType |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
117 l_dbPth <- opt$l_dbPth |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
118 } |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
119 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
120 |
|
11
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
121 |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
122 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
123 q_polarity <- extractMultiple(opt$q_polarity) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
124 l_polarity <- extractMultiple(opt$l_polarity) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
125 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
126 q_xcmsGroups <- extractMultiple(opt$q_xcmsGroups) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
127 l_xcmsGroups <- extractMultiple(opt$l_xcmsGroups) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
128 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
129 q_pids <- extractMultiple(opt$q_pids) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
130 l_pids <- extractMultiple(opt$l_pids) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
131 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
132 q_sources <- extractMultiple(opt$q_sources) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
133 l_sources <- extractMultiple(opt$l_sources) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
134 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
135 q_sourcesUser <- extractMultiple(opt$q_sourcesUser) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
136 l_sourcesUser <- extractMultiple(opt$l_sourcesUser) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
137 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
138 q_sources <-c(q_sources, q_sourcesUser) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
139 l_sources <-c(l_sources, l_sourcesUser) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
140 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
141 q_instrumentTypes <- extractMultiple(opt$q_instrumentTypes) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
142 l_instrumentTypes <- extractMultiple(opt$l_instrumentTypes) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
143 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
144 q_instrumentTypes <-c(q_instrumentTypes, q_instrumentTypes) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
145 l_instrumentTypes <-c(l_instrumentTypes, l_instrumentTypes) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
146 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
147 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
148 if(!is.null(opt$l_spectraFilter)){ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
149 l_spectraFilter <- TRUE |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
150 }else{ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
151 l_spectraFilter <- FALSE |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
152 } |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
153 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
154 if(!is.null(opt$q_spectraFilter)){ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
155 q_spectraFilter <- TRUE |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
156 }else{ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
157 q_spectraFilter <- FALSE |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
158 } |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
159 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
160 if(!is.null(opt$updateDb)){ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
161 updateDb <- TRUE |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
162 }else{ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
163 updateDb <- FALSE |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
164 } |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
165 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
166 if(!is.null(opt$copyDb)){ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
167 copyDb <- TRUE |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
168 }else{ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
169 copyDb <- FALSE |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
170 } |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
171 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
172 if(!is.null(opt$l_rtrangeMax)){ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
173 l_rtrangeMax <- opt$l_rtrangeMax |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
174 }else{ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
175 l_rtrangeMax <- NA |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
176 } |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
177 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
178 if(!is.null(opt$q_rtrangeMax)){ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
179 q_rtrangeMax <- opt$q_rtrangeMax |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
180 }else{ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
181 q_rtrangeMax <- NA |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
182 } |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
183 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
184 if(!is.null(opt$l_rtrangeMin)){ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
185 l_rtrangeMin <- opt$l_rtrangeMin |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
186 }else{ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
187 l_rtrangeMin <- NA |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
188 } |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
189 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
190 if(!is.null(opt$q_rtrangeMin)){ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
191 q_rtrangeMin <- opt$q_rtrangeMin |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
192 }else{ |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
193 q_rtrangeMin <- NA |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
194 } |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
195 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
196 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
197 |
|
11
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
198 sm <- msPurity::spectralMatching( |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
199 q_purity = opt$q_purity, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
200 l_purity = opt$l_purity, |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
201 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
202 q_ppmProd = opt$q_ppmProd, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
203 l_ppmProd = opt$l_ppmProd, |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
204 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
205 q_ppmPrec = opt$q_ppmPrec, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
206 l_ppmPrec = opt$l_ppmPrec, |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
207 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
208 q_raThres = opt$q_raThres, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
209 l_raThres = opt$l_raThres, |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
210 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
211 q_pol = q_polarity, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
212 l_pol = l_polarity, |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
213 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
214 q_xcmsGroups = q_xcmsGroups, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
215 l_xcmsGroups = l_xcmsGroups, |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
216 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
217 q_pids = q_pids, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
218 l_pids = l_pids, |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
219 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
220 q_sources = q_sources, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
221 l_sources = l_sources, |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
222 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
223 q_instrumentTypes = q_instrumentTypes, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
224 l_instrumentTypes = l_instrumentTypes, |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
225 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
226 q_spectraFilter= q_spectraFilter, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
227 l_spectraFilter= l_spectraFilter, |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
228 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
229 l_rtrange=c(l_rtrangeMin, l_rtrangeMax), |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
230 q_rtrange=c(q_rtrangeMin, q_rtrangeMax), |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
231 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
232 q_accessions = opt$q_accessions, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
233 l_accessions= opt$l_accessions, |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
234 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
235 raW = opt$raW, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
236 mzW = opt$mzW, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
237 rttol=opt$rttol, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
238 cores=opt$cores, |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
239 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
240 copyDb=copyDb, |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
241 updateDb=updateDb, |
|
11
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
242 outPth = "db_with_spectral_matching.sqlite", |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
243 |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
244 q_dbPth = q_dbPth, |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
245 q_dbType = q_dbType, |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
246 q_dbName = q_dbName, |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
247 q_dbHost = q_dbHost, |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
248 q_dbUser = q_dbUser, |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
249 q_dbPass = q_dbPass, |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
250 q_dbPort = q_dbPort, |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
251 |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
252 l_dbPth = l_dbPth, |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
253 l_dbType = l_dbType, |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
254 l_dbName = l_dbName, |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
255 l_dbHost = l_dbHost, |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
256 l_dbUser = l_dbUser, |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
257 l_dbPass = l_dbPass, |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
258 l_dbPort = l_dbPort |
|
a90832e6acb2
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit bbbcc75d51c020446fd00d76f908a6250266cfea
tomnl
parents:
10
diff
changeset
|
259 |
|
0
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
260 ) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
261 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
262 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
263 |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
264 write.table(sm$matchedResults, 'matched_results.tsv', sep = '\t', row.names = FALSE, col.names = TRUE) |
|
fc9bb7e49a3a
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2948ce35fa7fffe5a64711cb30be971031e79019-dirty
tomnl
parents:
diff
changeset
|
265 write.table(sm$xcmsMatchedResults, 'xcms_matched_results.tsv', sep = '\t', row.names = FALSE, col.names = TRUE) |
|
8
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
266 |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
267 |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
268 # Add extra details from library spectra in resulting database |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
269 # First get all the ids from the l_s_peak_meta from the query database |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
270 if(updateDb){ |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
271 message('Adding extra details to database') |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
272 q_con <- DBI::dbConnect(RSQLite::SQLite(),sm$q_dbPth) |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
273 if (DBI::dbExistsTable(q_con, "l_s_peak_meta")){ |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
274 l_s_peak_meta <- DBI::dbGetQuery(q_con, 'SELECT * FROM l_s_peak_meta') |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
275 colnames(l_s_peak_meta)[1] <- 'pid' |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
276 } |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
277 |
|
8
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
278 l_con <- DBI::dbConnect(RSQLite::SQLite(),l_dbPth) |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
279 if (DBI::dbExistsTable(l_con, "s_peaks")){ |
|
8
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
280 l_s_peaks <- DBI::dbGetQuery(q_con, sprintf("SELECT * FROM s_peaks WHERE pid in (%s)", paste(unique(l_s_peak_meta$pid), collapse=','))) |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
281 |
|
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
282 }else if(DBI::dbExistsTable(l_con, "library_spectra")){ |
|
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
283 l_s_peaks <- DBI::dbGetQuery(l_con, sprintf("SELECT * FROM library_spectra |
|
8
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
284 WHERE library_spectra_meta_id in (%s)", paste(unique(l_s_peak_meta$pid), collapse=','))) |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
285 }else{ |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
286 l_s_peaks = NULL |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
287 } |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
288 |
|
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
289 if (DBI::dbExistsTable(l_con, "source")){ |
|
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
290 l_source <- DBI::dbGetQuery(l_con, 'SELECT * FROM source') |
|
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
291 }else if (DBI::dbExistsTable(l_con, "library_spectra_source")) { |
|
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
292 l_source <- DBI::dbGetQuery(l_con, 'SELECT * FROM library_spectra_source') |
|
8
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
293 }else{ |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
294 l_source = NULL |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
295 } |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
296 |
|
8
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
297 if (!is.null(l_s_peaks)){ |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
298 DBI::dbWriteTable(q_con, name='l_s_peaks', value=l_s_peaks, row.names=FALSE, append=TRUE) |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
299 } |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
300 |
|
8
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
301 if (!is.null(l_source)){ |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
302 DBI::dbWriteTable(q_con, name='l_source', value=l_source, row.names=FALSE, append=TRUE) |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
303 } |
|
10
1ce857d74106
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit b6b8da66a6eef180ca8e333f98fc4b7575bac7b3
tomnl
parents:
8
diff
changeset
|
304 |
|
8
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
305 } |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
306 |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
307 |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
308 |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
309 |
|
a507a2ccb46d
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
tomnl
parents:
0
diff
changeset
|
310 |
