Mercurial > repos > computational-metabolomics > mspurity_createdatabase
annotate combineAnnotations.R @ 11:fa84bfaab681 draft default tip
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 94f746247c464fb270358421399810d8a9fb9e8a
| author | computational-metabolomics | 
|---|---|
| date | Fri, 13 Sep 2024 13:39:28 +0000 | 
| parents | efd14b326007 | 
| children | 
| rev | line source | 
|---|---|
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 1 library(optparse) | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 2 library(msPurity) | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 3 print(sessionInfo()) | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 4 | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 5 # Get the parameter | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 6 option_list <- list( | 
| 6 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 7 make_option(c("-s", "--sm_resultPth"), type = "character"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 8 make_option(c("-m", "--metfrag_resultPth"), type = "character"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 9 make_option(c("-c", "--sirius_csi_resultPth"), type = "character"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 10 make_option(c("-p", "--probmetab_resultPth"), type = "character"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 11 make_option(c("-l", "--ms1_lookup_resultPth"), type = "character"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 12 make_option("--ms1_lookup_checkAdducts", action = "store_true"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 13 make_option("--ms1_lookup_keepAdducts", type = "character", default = NA), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 14 make_option("--ms1_lookup_dbSource", type = "character", default = "hmdb"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 15 make_option("--sm_weight", type = "numeric"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 16 make_option("--metfrag_weight", type = "numeric"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 17 make_option("--sirius_csi_weight", type = "numeric"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 18 make_option("--probmetab_weight", type = "numeric"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 19 make_option("--ms1_lookup_weight", type = "numeric"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 20 make_option("--biosim_weight", type = "numeric"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 21 make_option("--summaryOutput", action = "store_true"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 22 make_option("--create_new_database", action = "store_true"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 23 make_option("--outdir", type = "character", default = "."), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 24 make_option("--compoundDbType", type = "character", default = "sqlite"), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 25 make_option("--compoundDbPth", type = "character", default = NA), | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 26 make_option("--compoundDbHost", type = "character", default = NA) | 
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 27 ) | 
| 6 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 28 opt <- parse_args(OptionParser(option_list = option_list)) | 
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 29 | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 30 print(opt) | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 31 | 
| 6 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 32 if (!is.null(opt$create_new_database)) { | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 33 sm_resultPth <- file.path(opt$outdir, "combined_annotations.sqlite") | 
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 34 file.copy(opt$sm_resultPth, sm_resultPth) | 
| 8 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 35 } else { | 
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 36 sm_resultPth <- opt$sm_resultPth | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 37 } | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 38 | 
| 6 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 39 if (is.null(opt$ms1_lookup_checkAdducts)) { | 
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 40 opt$ms1_lookup_checkAdducts <- FALSE | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 41 } | 
| 6 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 42 if (!is.null(opt$ms1_lookup_keepAdducts)) { | 
| 8 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 43 opt$ms1_lookup_keepAdducts <- gsub("__ob__", "[", opt$ms1_lookup_keepAdducts) | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 44 opt$ms1_lookup_keepAdducts <- gsub("__cb__", "]", opt$ms1_lookup_keepAdducts) | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 45 ms1_lookup_keepAdducts <- strsplit(opt$ms1_lookup_keepAdducts, ",")[[1]] | 
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 46 } | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 47 | 
| 8 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 48 weights <- list( | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 49 "sm" = opt$sm_weight, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 50 "metfrag" = opt$metfrag_weight, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 51 "sirius_csifingerid" = opt$sirius_csi_weight, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 52 "probmetab" = opt$probmetab_weight, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 53 "ms1_lookup" = opt$ms1_lookup_weight, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 54 "biosim" = opt$biosim_weight | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 55 ) | 
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 56 print(weights) | 
| 2 
a11892cb997d
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 242de155f13acd6cb88946e89b5196ac55578aa8"
 computational-metabolomics parents: 
0diff
changeset | 57 | 
| 6 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 58 if (is.null(opt$probmetab_resultPth)) { | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 59 opt$probmetab_resultPth <- NA | 
| 2 
a11892cb997d
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 242de155f13acd6cb88946e89b5196ac55578aa8"
 computational-metabolomics parents: 
0diff
changeset | 60 } | 
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 61 | 
| 6 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 62 if (round(!sum(unlist(weights), 0) == 1)) { | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 63 stop(paste0("The weights should sum to 1 not ", sum(unlist(weights)))) | 
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 64 } | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 65 | 
| 6 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 66 if (is.null(opt$summaryOutput)) { | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 67 summaryOutput <- FALSE | 
| 8 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 68 } else { | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 69 summaryOutput <- TRUE | 
| 2 
a11892cb997d
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 242de155f13acd6cb88946e89b5196ac55578aa8"
 computational-metabolomics parents: 
0diff
changeset | 70 } | 
| 
a11892cb997d
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 242de155f13acd6cb88946e89b5196ac55578aa8"
 computational-metabolomics parents: 
0diff
changeset | 71 | 
| 6 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 72 if (opt$compoundDbType == "local_config") { | 
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 73 # load in compound config | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 74 # Soure local function taken from workflow4metabolomics | 
| 6 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 75 source_local <- function(fname) { | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 76 argv <- commandArgs(trailingOnly = FALSE) | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 77 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 78 source(paste(base_dir, fname, sep = "/")) | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 79 } | 
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 80 source_local("dbconfig.R") | 
| 8 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 81 } else { | 
| 6 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 82 compoundDbPth <- opt$compoundDbPth | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 83 compoundDbType <- opt$compoundDbType | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 84 compoundDbName <- NA | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 85 compoundDbHost <- NA | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 86 compoundDbPort <- NA | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 87 compoundDbUser <- NA | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 88 compoundDbPass <- NA | 
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 89 } | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 90 | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 91 summary_output <- msPurity::combineAnnotations( | 
| 8 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 92 sm_resultPth = sm_resultPth, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 93 compoundDbPth = compoundDbPth, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 94 metfrag_resultPth = opt$metfrag_resultPth, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 95 sirius_csi_resultPth = opt$sirius_csi_resultPth, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 96 probmetab_resultPth = opt$probmetab_resultPth, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 97 ms1_lookup_resultPth = opt$ms1_lookup_resultPth, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 98 ms1_lookup_keepAdducts = ms1_lookup_keepAdducts, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 99 ms1_lookup_checkAdducts = opt$ms1_lookup_checkAdducts, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 100 compoundDbType = compoundDbType, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 101 compoundDbName = compoundDbName, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 102 compoundDbHost = compoundDbHost, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 103 compoundDbPort = compoundDbPort, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 104 compoundDbUser = compoundDbUser, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 105 compoundDbPass = compoundDbPass, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 106 weights = weights, | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 107 summaryOutput = summaryOutput | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 108 ) | 
| 6 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 109 if (summaryOutput) { | 
| 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 110 write.table(summary_output, | 
| 8 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 111 file.path(opt$outdir, "combined_annotations.tsv"), | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 112 sep = "\t", row.names = FALSE | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 113 ) | 
| 2 
a11892cb997d
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 242de155f13acd6cb88946e89b5196ac55578aa8"
 computational-metabolomics parents: 
0diff
changeset | 114 } | 
| 
a11892cb997d
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 242de155f13acd6cb88946e89b5196ac55578aa8"
 computational-metabolomics parents: 
0diff
changeset | 115 | 
| 6 
2f71b3495221
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
 computational-metabolomics parents: 
2diff
changeset | 116 write.table(summary_output, | 
| 8 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 117 file.path(opt$outdir, "combined_annotations.tsv"), | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 118 sep = "\t", row.names = FALSE | 
| 
efd14b326007
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 7e1748612a9f9dce11a9e54ff36752b600e7aea3
 computational-metabolomics parents: 
6diff
changeset | 119 ) | 
| 0 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 120 | 
| 
f52287a06c02
"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
 computational-metabolomics parents: diff
changeset | 121 closeAllConnections() | 
