annotate createMSP.R @ 6:090775983be7 draft

"planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
author computational-metabolomics
date Thu, 04 Mar 2021 12:24:27 +0000
parents 8f5877c6d5f4
children 75b761fbacc0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
1 library(optparse)
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
2 library(msPurity)
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
3 print(sessionInfo())
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
4
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
5 # Get the parameter
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
6 option_list <- list(
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
7 make_option("--rdata_input", type = "character"),
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
8 make_option("--method", type = "character"),
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
9 make_option("--metadata", type = "character"),
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
10 make_option("--metadata_cols", type = "character"),
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
11 make_option("--metadata_cols_filter", type = "character"),
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
12 make_option("--adduct_split", action = "store_true"),
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
13 make_option("--xcms_groupids", type = "character"),
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
14 make_option("--filter", action = "store_true"),
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
15 make_option("--intensity_ra", type = "character"),
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
16 make_option("--include_adducts", type = "character"),
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
17 make_option("--msp_schema", type = "character"),
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
18 make_option("--include_adducts_custom", type = "character", default = ""),
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
19 make_option("--out_dir", type = "character", default = ".")
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
20 )
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
21 opt <- parse_args(OptionParser(option_list = option_list))
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
22
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
23 print(opt)
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
24
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
25 load(opt$rdata_input)
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
26
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
27 if (is.null(opt$metadata)) {
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
28 metadata <- NULL
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
29 }else{
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
30 metadata <- read.table(opt$metadata, header = TRUE, sep = "\t",
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
31 stringsAsFactors = FALSE, check.names = FALSE)
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
32
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
33 if (!opt$metadata_cols_filter == "") {
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
34 metadata_cols_filter <- strsplit(opt$metadata_cols_filter, ",")[[1]]
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
35
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
36 metadata <- metadata[, metadata_cols_filter, drop = FALSE]
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
37 print(metadata)
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
38
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
39 if (!"grpid" %in% colnames(metadata)) {
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
40 metadata$grpid <- seq_len(nrow(metadata))
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
41 }
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
42
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
43 print(metadata)
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
44
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
45 }
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
46
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
47 }
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
48
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
49
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
50
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
51 if (is.null(opt$metadata_cols) || opt$metadata_cols == "") {
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
52 metadata_cols <- NULL
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
53 }else{
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
54 metadata_cols <- opt$metadata_cols
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
55
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
56 }
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
57
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
58
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
59 if (is.null(opt$adduct_split)) {
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
60 adduct_split <- FALSE
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
61 }else{
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
62 adduct_split <- TRUE
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
63 }
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
64
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
65 if (is.null(opt$xcms_groupids)) {
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
66 xcms_groupids <- NULL
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
67 }else{
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
68 xcms_groupids <- trimws(strsplit(opt$xcms_groupids, ",")[[1]])
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
69 }
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
70
3
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
71
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
72 if (is.null(opt$include_adducts_custom)) {
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
73 include_adducts_custom <- ""
3
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
74 }else{
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
75 include_adducts_custom <- opt$include_adducts_custom
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
76 }
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
77
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
78
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
79 if (opt$include_adducts == "None") {
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
80 include_adducts <- ""
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
81 }else{
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
82 include_adducts <- opt$include_adducts
3
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
83 }
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
84
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
85 include_adducts_all <- paste(include_adducts_custom, ",", include_adducts, sep = "")
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
86
3
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
87 include_adducts_all <- gsub("^,", "", include_adducts_all)
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
88 include_adducts_all <- gsub(",$", "", include_adducts_all)
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
89
3
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
90 include_adducts_all <- gsub("__ob__", "[", include_adducts_all)
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
91 include_adducts_all <- gsub("__cb__", "]", include_adducts_all)
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
92 include_adducts_all <- trimws(include_adducts_all)
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
93 include_adducts_all <- gsub(",", " ", include_adducts_all)
8f5877c6d5f4 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 89bf304d12233004031de3c3e703a472b0ba5459"
computational-metabolomics
parents: 0
diff changeset
94
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
95
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
96
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
97 if (is.null(opt$filter)) {
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
98 filter <- FALSE
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
99 }else{
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
100 filter <- TRUE
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
101 }
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
102
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
103
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
104
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
105 msPurity::createMSP(pa,
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
106 msp_file_pth = file.path(opt$out_dir, "lcmsms_spectra.msp"),
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
107 metadata = metadata,
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
108 metadata_cols = metadata_cols,
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
109 method = opt$method,
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
110 adduct_split = adduct_split,
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
111 xcms_groupids = xcms_groupids,
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
112 filter = filter,
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
113 intensity_ra = opt$intensity_ra,
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
114 include_adducts = include_adducts_all,
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
115 msp_schema = opt$msp_schema)
0
e96082a25ff0 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit cb903cd93f9378cfb5eeb68512a54178dcea7bbc-dirty"
computational-metabolomics
parents:
diff changeset
116
6
090775983be7 "planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 2579c8746819670348c378f86116f83703c493eb"
computational-metabolomics
parents: 3
diff changeset
117 print("msp created")