Mercurial > repos > tomnl > anticipated_purity_lcms
annotate spectral_matching.R @ 8:e28fc4fd51e9 draft
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 0aa10df0ec1ed71601f932cfb11d7d4d4f620d80-dirty
| author | tomnl | 
|---|---|
| date | Wed, 02 May 2018 13:21:00 -0400 | 
| parents | b83bcc259b76 | 
| children | e05068fe15a1 | 
| rev | line source | 
|---|---|
| 
0
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
1 library(msPurity) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
2 library(optparse) | 
| 
2
 
b83bcc259b76
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2e847122cf605951c334858455fc1d3ebdb189e9-dirty
 
tomnl 
parents: 
0 
diff
changeset
 | 
3 print(sessionInfo()) | 
| 
 
b83bcc259b76
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2e847122cf605951c334858455fc1d3ebdb189e9-dirty
 
tomnl 
parents: 
0 
diff
changeset
 | 
4 | 
| 
0
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
5 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
6 option_list <- list( | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
7 make_option(c("-o", "--out_dir"), type="character"), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
8 make_option("--target_db_pth", type="character"), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
9 make_option("--library_db_pth", type="character"), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
10 make_option("--ra_thres_l", default=0), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
11 make_option("--ra_thres_t", default=2), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
12 make_option("--cores", default=1), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
13 make_option("--pol", default='positive'), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
14 make_option("--ppm_tol_prod", default=10), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
15 make_option("--ppm_tol_prec", default=5), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
16 make_option("--score_thres", default=0.6), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
17 make_option("--instrument_types", type='character'), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
18 make_option("--library_sources", type='character'), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
19 make_option("--scan_ids", default=NA), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
20 make_option("--topn", default=NA), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
21 make_option("--mzML_files", type="character"), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
22 make_option("--galaxy_names", type="character"), | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
23 make_option("--create_new_database", action="store_true") | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
24 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
25 ) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
26 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
27 # store options | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
28 opt<- parse_args(OptionParser(option_list=option_list)) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
29 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
30 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
31 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
32 if (!is.null(opt$create_new_database)){ | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
33 target_db_pth <- file.path(opt$out_dir, 'db_with_spectral_matching.sqlite') | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
34 file.copy(opt$target_db_pth, target_db_pth) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
35 }else{ | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
36 target_db_pth <- opt$target_db_pth | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
37 } | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
38 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
39 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
40 if (opt$instrument_types=='None'){ | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
41 instrument_types <- NA | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
42 }else{ | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
43 instrument_types <- trimws(strsplit(opt$instrument_types, ',')[[1]]) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
44 } | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
45 if (opt$library_sources=='None'){ | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
46 library_sources <- NA | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
47 }else{ | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
48 library_sources <- trimws(strsplit(opt$library_sources, ',')[[1]]) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
49 } | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
50 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
51 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
52 if (!is.na(opt$scan_ids)){ | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
53 scan_ids <- trimws(strsplit(opt$scan_ids, ',')[[1]]) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
54 scan_ids <- scan_ids[scan_ids != ""] | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
55 }else{ | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
56 scan_ids <- NA | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
57 } | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
58 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
59 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
60 print(instrument_types) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
61 print(library_sources) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
62 print(scan_ids) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
63 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
64 result <- msPurity::spectral_matching( | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
65 target_db_pth =target_db_pth , | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
66 library_db_pth = opt$library_db_pth, | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
67 ra_thres_l = opt$ra_thres_l, | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
68 ra_thres_t = opt$ra_thres_t, | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
69 cores = opt$cores, | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
70 pol = opt$pol, | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
71 ppm_tol_prod = opt$ppm_tol_prod, | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
72 ppm_tol_prec = opt$ppm_tol_prec, | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
73 score_thres = opt$score_thres, | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
74 out_dir = opt$out_dir, | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
75 topn = opt$topn, | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
76 grp_peaklist = NA, | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
77 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
78 instrument_types = instrument_types, | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
79 library_sources = library_sources, | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
80 scan_ids = scan_ids) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
81 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
82 print(file.path(result$result_db_pth)) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
83 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
84 write.table(result$xcms_summary_df, file.path(opt$out_dir, 'xcms_hits.tsv'), row.names=FALSE, sep='\t') | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
85 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
86 con <- DBI::dbConnect(RSQLite::SQLite(), file.path(result$result_db_pth)) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
87 # con <- DBI::dbConnect(RSQLite::SQLite(), file.path(opt$out_dir, 'result.sqlite')) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
88 | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
89 cmd <- paste('SELECT * FROM matches | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
90 LEFT JOIN library_meta ON matches.lid=library_meta.lid | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
91 LEFT JOIN s_peak_meta ON matches.pid=s_peak_meta.pid | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
92 LEFT JOIN fileinfo ON s_peak_meta.fileid=fileinfo.fileid | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
93 WHERE matches.score >= ', opt$score_thres) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
94 print(cmd) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
95 scan_hits <- DBI::dbGetQuery(con, cmd) | 
| 
 
dc00b7222a3c
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f9591483bef88aef71a9f0cc0ffc75cf6eab480c
 
tomnl 
parents:  
diff
changeset
 | 
96 | 
| 
2
 
b83bcc259b76
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2e847122cf605951c334858455fc1d3ebdb189e9-dirty
 
tomnl 
parents: 
0 
diff
changeset
 | 
97 write.table(scan_hits, file.path(opt$out_dir, 'scan_hits.tsv'), row.names=FALSE, sep='\t') | 
