Mercurial > repos > computational-metabolomics > mspurity_puritya
annotate spectralMatching.R @ 0:56cce1a90b73 draft
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
| author | computational-metabolomics | 
|---|---|
| date | Wed, 27 Nov 2019 14:26:04 -0500 | 
| parents | |
| children | 1c770b10974a | 
| rev | line source | 
|---|---|
| 
0
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
1 library(msPurity) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
2 library(msPurityData) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
3 library(optparse) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
4 print(sessionInfo()) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
5 # load in library spectra config | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
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="/")) } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
7 source_local("dbconfig.R") | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
8 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
9 option_list <- list( | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
10 make_option(c("-o", "--outDir"), type="character"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
11 make_option("--q_dbPth", type="character"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
12 make_option("--l_dbPth", type="character"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
13 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
14 make_option("--q_dbType", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
15 make_option("--l_dbType", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
16 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
17 make_option("--q_msp", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
18 make_option("--l_msp", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
19 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
20 make_option("--q_defaultDb", action="store_true"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
21 make_option("--l_defaultDb", action="store_true"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
22 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
23 make_option("--q_ppmPrec", type="double"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
24 make_option("--l_ppmPrec", type="double"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
25 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
26 make_option("--q_ppmProd", type="double"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
27 make_option("--l_ppmProd", type="double"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
28 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
29 make_option("--q_raThres", type="double", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
30 make_option("--l_raThres", type="double", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
31 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
32 make_option("--q_polarity", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
33 make_option("--l_polarity", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
34 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
35 make_option("--q_purity", type="double", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
36 make_option("--l_purity", type="double", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
37 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
38 make_option("--q_xcmsGroups", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
39 make_option("--l_xcmsGroups", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
40 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
41 make_option("--q_pids", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
42 make_option("--l_pids", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
43 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
44 make_option("--q_rtrangeMin", type="double", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
45 make_option("--l_rtrangeMin", type="double", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
46 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
47 make_option("--q_rtrangeMax", type="double", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
48 make_option("--l_rtrangeMax", type="double", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
49 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
50 make_option("--q_accessions", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
51 make_option("--l_accessions", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
52 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
53 make_option("--q_sources", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
54 make_option("--l_sources", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
55 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
56 make_option("--q_sourcesUser", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
57 make_option("--l_sourcesUser", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
58 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
59 make_option("--q_instrumentTypes", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
60 make_option("--l_instrumentTypes", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
61 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
62 make_option("--q_instrumentTypesUser", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
63 make_option("--l_instrumentTypesUser", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
64 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
65 make_option("--q_instruments", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
66 make_option("--l_instruments", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
67 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
68 make_option("--q_spectraTypes", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
69 make_option("--l_spectraTypes", type="character", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
70 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
71 make_option("--q_spectraFilter", action="store_true"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
72 make_option("--l_spectraFilter", action="store_true"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
73 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
74 make_option("--usePrecursors", action="store_true"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
75 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
76 make_option("--mzW", type="double"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
77 make_option("--raW", type="double"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
78 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
79 make_option("--rttol", type="double", default=NA), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
80 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
81 make_option("--updateDb", action="store_true"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
82 make_option("--copyDb", action="store_true"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
83 make_option("--cores", default=1) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
84 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
85 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
86 ) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
87 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
88 # store options | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
89 opt<- parse_args(OptionParser(option_list=option_list)) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
90 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
91 print(opt) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
92 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
93 # check if the sqlite databases have any spectra | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
94 checkSPeakMeta <- function(dbPth, nme){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
95 if(is.null(dbPth)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
96 return(TRUE) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
97 }else if ((file.exists(dbPth)) & (file.info(dbPth)$size>0)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
98 con <- DBI::dbConnect(RSQLite::SQLite(), dbPth) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
99 if (DBI::dbExistsTable(con, "s_peak_meta")){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
100 spm <- DBI::dbGetQuery(con, 'SELECT * FROM s_peak_meta ORDER BY ROWID ASC LIMIT 1') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
101 return(TRUE) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
102 }else if(DBI::dbExistsTable(con, "library_spectra_meta")){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
103 spm <- DBI::dbGetQuery(con, 'SELECT * FROM library_spectra_meta ORDER BY ROWID ASC LIMIT 1') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
104 return(TRUE) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
105 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
106 print(paste("No spectra available for ",nme)) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
107 return(FALSE) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
108 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
109 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
110 print(paste("file empty or does not exist for", nme)) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
111 return(FALSE) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
112 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
113 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
114 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
115 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
116 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
117 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
118 addQueryNameColumn <- function(sm){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
119 if (is.null(sm$matchedResults) || length(sm$matchedResults)==1 || nrow(sm$matchedResults)==0){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
120 return(sm) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
121 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
122 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
123 con <- DBI::dbConnect(RSQLite::SQLite(),sm$q_dbPth) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
124 if (DBI::dbExistsTable(con, "s_peak_meta")){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
125 spm <- DBI::dbGetQuery(con, 'SELECT pid, name AS query_entry_name FROM s_peak_meta') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
126 }else if(DBI::dbExistsTable(con, "library_spectra_meta")){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
127 spm <- DBI::dbGetQuery(con, 'SELECT id AS pid, name AS query_entry_name FROM library_spectra_meta') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
128 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
129 print(sm$matchedResults) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
130 if ('pid' %in% colnames(sm$matchedResults)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
131 sm$matchedResults <- merge(sm$matchedResults, spm, by.x='pid', by.y='pid') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
132 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
133 sm$matchedResults <- merge(sm$matchedResults, spm, by.x='qpid', by.y='pid') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
134 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
135 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
136 print(sm$xcmsMatchedResults) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
137 if (is.null(sm$xcmsMatchedResults) || length(sm$xcmsMatchedResults)==1 || nrow(sm$xcmsMatchedResults)==0){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
138 return(sm) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
139 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
140 if ('pid' %in% colnames(sm$xcmsMatchedResults)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
141 sm$xcmsMatchedResults<- merge(sm$xcmsMatchedResults, spm, by.x='pid', by.y='pid') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
142 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
143 sm$xcmsMatchedResults <- merge(sm$xcmsMatchedResults, spm, by.x='qpid', by.y='pid') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
144 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
145 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
146 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
147 return(sm) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
148 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
149 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
150 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
151 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
152 updateDbF <- function(q_con, l_con){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
153 message('Adding extra details to database') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
154 q_con <- DBI::dbConnect(RSQLite::SQLite(),sm$q_dbPth) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
155 if (DBI::dbExistsTable(q_con, "l_s_peak_meta")){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
156 l_s_peak_meta <- DBI::dbGetQuery(q_con, 'SELECT * FROM l_s_peak_meta') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
157 colnames(l_s_peak_meta)[1] <- 'pid' | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
158 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
159 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
160 l_con <- DBI::dbConnect(RSQLite::SQLite(),l_dbPth) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
161 if (DBI::dbExistsTable(l_con, "s_peaks")){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
162 l_s_peaks <- DBI::dbGetQuery(q_con, sprintf("SELECT * FROM s_peaks WHERE pid in (%s)", paste(unique(l_s_peak_meta$pid), collapse=','))) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
163 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
164 }else if(DBI::dbExistsTable(l_con, "library_spectra")){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
165 l_s_peaks <- DBI::dbGetQuery(l_con, sprintf("SELECT * FROM library_spectra | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
166 WHERE library_spectra_meta_id in (%s)", paste(unique(l_s_peak_meta$pid), collapse=','))) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
167 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
168 l_s_peaks = NULL | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
169 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
170 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
171 if (DBI::dbExistsTable(l_con, "source")){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
172 l_source <- DBI::dbGetQuery(l_con, 'SELECT * FROM source') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
173 }else if (DBI::dbExistsTable(l_con, "library_spectra_source")) { | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
174 l_source <- DBI::dbGetQuery(l_con, 'SELECT * FROM library_spectra_source') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
175 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
176 l_source = NULL | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
177 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
178 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
179 if (!is.null(l_s_peaks)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
180 DBI::dbWriteTable(q_con, name='l_s_peaks', value=l_s_peaks, row.names=FALSE, append=TRUE) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
181 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
182 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
183 if (!is.null(l_source)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
184 DBI::dbWriteTable(q_con, name='l_source', value=l_source, row.names=FALSE, append=TRUE) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
185 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
186 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
187 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
188 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
189 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
190 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
191 extractMultiple <- function(optParam){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
192 if (!is.na(optParam)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
193 param <- trimws(strsplit(optParam, ',')[[1]]) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
194 param <- param[param != ""] | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
195 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
196 param <- NA | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
197 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
198 return(param) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
199 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
200 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
201 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
202 if(!is.null(opt$q_defaultDb)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
203 q_dbPth <- system.file("extdata", "library_spectra", "library_spectra.db", package="msPurityData") | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
204 q_dbType <- 'sqlite' | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
205 }else if (!opt$q_dbType=='local_config'){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
206 q_dbType <- opt$q_dbType | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
207 q_dbPth <- opt$q_dbPth | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
208 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
209 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
210 if(!is.null(opt$l_defaultDb)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
211 l_dbPth <- system.file("extdata", "library_spectra", "library_spectra.db", package="msPurityData") | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
212 l_dbType <- 'sqlite' | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
213 }else if (!opt$l_dbType=='local_config'){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
214 l_dbType <- opt$l_dbType | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
215 l_dbPth <- opt$l_dbPth | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
216 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
217 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
218 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
219 q_polarity <- extractMultiple(opt$q_polarity) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
220 l_polarity <- extractMultiple(opt$l_polarity) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
221 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
222 q_xcmsGroups <- extractMultiple(opt$q_xcmsGroups) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
223 l_xcmsGroups <- extractMultiple(opt$l_xcmsGroups) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
224 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
225 q_pids <- extractMultiple(opt$q_pids) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
226 l_pids <- extractMultiple(opt$l_pids) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
227 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
228 q_sources <- extractMultiple(opt$q_sources) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
229 l_sources <- extractMultiple(opt$l_sources) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
230 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
231 q_sourcesUser <- extractMultiple(opt$q_sourcesUser) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
232 l_sourcesUser <- extractMultiple(opt$l_sourcesUser) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
233 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
234 q_sources <-c(q_sources, q_sourcesUser) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
235 l_sources <-c(l_sources, l_sourcesUser) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
236 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
237 q_instrumentTypes <- extractMultiple(opt$q_instrumentTypes) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
238 l_instrumentTypes <- extractMultiple(opt$l_instrumentTypes) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
239 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
240 q_instrumentTypes <-c(q_instrumentTypes, q_instrumentTypes) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
241 l_instrumentTypes <-c(l_instrumentTypes, l_instrumentTypes) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
242 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
243 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
244 if(!is.null(opt$l_spectraFilter)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
245 l_spectraFilter <- TRUE | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
246 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
247 l_spectraFilter <- FALSE | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
248 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
249 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
250 if(!is.null(opt$q_spectraFilter)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
251 q_spectraFilter <- TRUE | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
252 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
253 q_spectraFilter <- FALSE | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
254 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
255 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
256 if(!is.null(opt$updateDb)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
257 updateDb <- TRUE | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
258 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
259 updateDb <- FALSE | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
260 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
261 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
262 if(!is.null(opt$copyDb)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
263 copyDb <- TRUE | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
264 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
265 copyDb <- FALSE | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
266 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
267 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
268 if(!is.null(opt$l_rtrangeMax)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
269 l_rtrangeMax <- opt$l_rtrangeMax | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
270 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
271 l_rtrangeMax <- NA | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
272 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
273 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
274 if(!is.null(opt$q_rtrangeMax)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
275 q_rtrangeMax <- opt$q_rtrangeMax | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
276 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
277 q_rtrangeMax <- NA | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
278 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
279 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
280 if(!is.null(opt$l_rtrangeMin)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
281 l_rtrangeMin <- opt$l_rtrangeMin | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
282 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
283 l_rtrangeMin <- NA | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
284 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
285 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
286 if(!is.null(opt$q_rtrangeMin)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
287 q_rtrangeMin <- opt$q_rtrangeMin | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
288 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
289 q_rtrangeMin <- NA | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
290 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
291 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
292 q_check <- checkSPeakMeta(opt$q_dbPth, 'query') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
293 l_check <- checkSPeakMeta(opt$l_dbPth, 'library') | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
294 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
295 if (q_check && l_check){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
296 sm <- msPurity::spectralMatching( | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
297 q_purity = opt$q_purity, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
298 l_purity = opt$l_purity, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
299 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
300 q_ppmProd = opt$q_ppmProd, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
301 l_ppmProd = opt$l_ppmProd, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
302 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
303 q_ppmPrec = opt$q_ppmPrec, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
304 l_ppmPrec = opt$l_ppmPrec, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
305 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
306 q_raThres = opt$q_raThres, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
307 l_raThres = opt$l_raThres, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
308 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
309 q_pol = q_polarity, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
310 l_pol = l_polarity, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
311 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
312 q_xcmsGroups = q_xcmsGroups, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
313 l_xcmsGroups = l_xcmsGroups, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
314 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
315 q_pids = q_pids, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
316 l_pids = l_pids, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
317 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
318 q_sources = q_sources, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
319 l_sources = l_sources, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
320 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
321 q_instrumentTypes = q_instrumentTypes, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
322 l_instrumentTypes = l_instrumentTypes, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
323 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
324 q_spectraFilter= q_spectraFilter, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
325 l_spectraFilter= l_spectraFilter, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
326 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
327 l_rtrange=c(l_rtrangeMin, l_rtrangeMax), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
328 q_rtrange=c(q_rtrangeMin, q_rtrangeMax), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
329 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
330 q_accessions = opt$q_accessions, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
331 l_accessions= opt$l_accessions, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
332 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
333 raW = opt$raW, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
334 mzW = opt$mzW, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
335 rttol=opt$rttol, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
336 cores=opt$cores, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
337 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
338 copyDb=copyDb, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
339 updateDb=updateDb, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
340 outPth = "db_with_spectral_matching.sqlite", | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
341 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
342 q_dbPth = q_dbPth, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
343 q_dbType = q_dbType, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
344 q_dbName = q_dbName, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
345 q_dbHost = q_dbHost, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
346 q_dbUser = q_dbUser, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
347 q_dbPass = q_dbPass, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
348 q_dbPort = q_dbPort, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
349 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
350 l_dbPth = l_dbPth, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
351 l_dbType = l_dbType, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
352 l_dbName = l_dbName, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
353 l_dbHost = l_dbHost, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
354 l_dbUser = l_dbUser, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
355 l_dbPass = l_dbPass, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
356 l_dbPort = l_dbPort | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
357 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
358 ) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
359 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
360 sm <- addQueryNameColumn(sm) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
361 # Get name of the query results (and merged with the data frames) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
362 write.table(sm$matchedResults, 'matched_results.tsv', sep = '\t', row.names = FALSE, col.names = TRUE) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
363 write.table(sm$xcmsMatchedResults, 'xcms_matched_results.tsv', sep = '\t', row.names = FALSE, col.names = TRUE) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
364 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
365 if(updateDb){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
366 updateDbF(q_con, l_con) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
367 } | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
368 } | 
