Mercurial > repos > computational-metabolomics > mspurity_puritya
annotate createMSP.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 | 585b0d90e501 | 
| 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(optparse) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
2 library(msPurity) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
3 print(sessionInfo()) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
4 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
5 # Get the parameter | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
6 option_list <- list( | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
7 make_option("--rdata_input",type="character"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
8 make_option("--method",type="character"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
9 make_option("--metadata",type="character"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
10 make_option("--metadata_cols",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("--metadata_cols_filter",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("--adduct_split", action="store_true"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
13 make_option("--xcms_groupids",type="character"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
14 make_option("--filter",action="store_true"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
15 make_option("--intensity_ra",type="character"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
16 make_option("--include_adducts",type="character"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
17 make_option("--msp_schema",type="character"), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
18 make_option("--out_dir",type="character", default=".") | 
| 
 
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 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
 | 
21 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
22 print(opt) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
23 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
24 load(opt$rdata_input) | 
| 
 
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 if (is.null(opt$metadata)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
27 metadata <- NULL | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
28 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
29 metadata <- read.table(opt$metadata, header = TRUE, sep='\t', stringsAsFactors = FALSE, check.names = FALSE) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
30 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
31 if(!opt$metadata_cols_filter==''){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
32 metadata_cols_filter <- strsplit(opt$metadata_cols_filter, ',')[[1]] | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
33 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
34 metadata <- metadata[,metadata_cols_filter, drop=FALSE] | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
35 print(metadata) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
36 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
37 if (!"grpid" %in% colnames(metadata)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
38 metadata$grpid <- 1:nrow(metadata) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
39 } | 
| 
 
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 print(metadata) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
42 | 
| 
 
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 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
45 } | 
| 
 
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 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
48 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
49 if (is.null(opt$metadata_cols) || opt$metadata_cols==''){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
50 metadata_cols <- NULL | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
51 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
52 metadata_cols <- opt$metadata_cols | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
53 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
54 } | 
| 
 
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 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
57 if(is.null(opt$adduct_split)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
58 adduct_split <- FALSE | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
59 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
60 adduct_split <- TRUE | 
| 
 
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 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
63 if (is.null(opt$xcms_groupids)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
64 xcms_groupids <- NULL | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
65 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
66 xcms_groupids <- trimws(strsplit(opt$xcms_groupids, ',')[[1]]) | 
| 
 
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 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
69 if (opt$include_adducts=='None'){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
70 include_adducts <- '' | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
71 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
72 include_adducts <- opt$include_adducts | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
73 include_adducts <- gsub("__ob__", "[", include_adducts) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
74 include_adducts <- gsub("__cb__", "]", include_adducts) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
75 include_adducts <- trimws(include_adducts) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
76 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
77 include_adducts <- gsub(",", " ", include_adducts) | 
| 
 
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 } | 
| 
 
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 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
82 if(is.null(opt$filter)){ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
83 filter <- FALSE | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
84 }else{ | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
85 filter <- TRUE | 
| 
 
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 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
89 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
90 msPurity::createMSP(pa, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
91 msp_file_pth = file.path(opt$out_dir, 'lcmsms_spectra.msp'), | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
92 metadata = metadata, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
93 metadata_cols = metadata_cols, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
94 method = opt$method, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
95 adduct_split = adduct_split, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
96 xcms_groupids = xcms_groupids, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
97 filter = filter, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
98 intensity_ra=opt$intensity_ra, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
99 include_adducts=include_adducts, | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
100 msp_schema=opt$msp_schema) | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
101 | 
| 
 
56cce1a90b73
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 
computational-metabolomics 
parents:  
diff
changeset
 | 
102 print('msp created') | 
