Mercurial > repos > computational-metabolomics > mspurity_createdatabase
comparison createMSP.R @ 3:19fd19059791 draft
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
| author | computational-metabolomics |
|---|---|
| date | Thu, 09 Apr 2020 14:26:52 -0400 |
| parents | f52287a06c02 |
| children | 2f71b3495221 |
comparison
equal
deleted
inserted
replaced
| 2:a11892cb997d | 3:19fd19059791 |
|---|---|
| 13 make_option("--xcms_groupids",type="character"), | 13 make_option("--xcms_groupids",type="character"), |
| 14 make_option("--filter",action="store_true"), | 14 make_option("--filter",action="store_true"), |
| 15 make_option("--intensity_ra",type="character"), | 15 make_option("--intensity_ra",type="character"), |
| 16 make_option("--include_adducts",type="character"), | 16 make_option("--include_adducts",type="character"), |
| 17 make_option("--msp_schema",type="character"), | 17 make_option("--msp_schema",type="character"), |
| 18 make_option("--include_adducts_custom",type="character", default=""), | |
| 18 make_option("--out_dir",type="character", default=".") | 19 make_option("--out_dir",type="character", default=".") |
| 19 ) | 20 ) |
| 20 opt <- parse_args(OptionParser(option_list=option_list)) | 21 opt <- parse_args(OptionParser(option_list=option_list)) |
| 21 | 22 |
| 22 print(opt) | 23 print(opt) |
| 64 xcms_groupids <- NULL | 65 xcms_groupids <- NULL |
| 65 }else{ | 66 }else{ |
| 66 xcms_groupids <- trimws(strsplit(opt$xcms_groupids, ',')[[1]]) | 67 xcms_groupids <- trimws(strsplit(opt$xcms_groupids, ',')[[1]]) |
| 67 } | 68 } |
| 68 | 69 |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 if (is.null(opt$include_adducts_custom)){ | |
| 75 include_adducts_custom <- '' | |
| 76 }else{ | |
| 77 include_adducts_custom <- opt$include_adducts_custom | |
| 78 } | |
| 79 | |
| 80 | |
| 69 if (opt$include_adducts=='None'){ | 81 if (opt$include_adducts=='None'){ |
| 70 include_adducts <- '' | 82 include_adducts <- '' |
| 71 }else{ | 83 }else{ |
| 72 include_adducts <- opt$include_adducts | 84 include_adducts <- opt$include_adducts |
| 73 include_adducts <- gsub("__ob__", "[", include_adducts) | 85 } |
| 74 include_adducts <- gsub("__cb__", "]", include_adducts) | |
| 75 include_adducts <- trimws(include_adducts) | |
| 76 | 86 |
| 77 include_adducts <- gsub(",", " ", include_adducts) | 87 include_adducts_all <- paste(include_adducts_custom, ',', include_adducts, sep="") |
| 78 | 88 |
| 79 } | 89 include_adducts_all <- gsub("^,", "", include_adducts_all) |
| 90 include_adducts_all <- gsub(",$", "", include_adducts_all) | |
| 91 | |
| 92 include_adducts_all <- gsub("__ob__", "[", include_adducts_all) | |
| 93 include_adducts_all <- gsub("__cb__", "]", include_adducts_all) | |
| 94 include_adducts_all <- trimws(include_adducts_all) | |
| 95 include_adducts_all <- gsub(",", " ", include_adducts_all) | |
| 96 | |
| 80 | 97 |
| 81 | 98 |
| 82 if(is.null(opt$filter)){ | 99 if(is.null(opt$filter)){ |
| 83 filter <- FALSE | 100 filter <- FALSE |
| 84 }else{ | 101 }else{ |
| 94 method = opt$method, | 111 method = opt$method, |
| 95 adduct_split = adduct_split, | 112 adduct_split = adduct_split, |
| 96 xcms_groupids = xcms_groupids, | 113 xcms_groupids = xcms_groupids, |
| 97 filter = filter, | 114 filter = filter, |
| 98 intensity_ra=opt$intensity_ra, | 115 intensity_ra=opt$intensity_ra, |
| 99 include_adducts=include_adducts, | 116 include_adducts=include_adducts_all, |
| 100 msp_schema=opt$msp_schema) | 117 msp_schema=opt$msp_schema) |
| 101 | 118 |
| 102 print('msp created') | 119 print('msp created') |
