annotate combineAnnotations.R @ 6:52d48bcd3608 draft

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