comparison purityX.R @ 10:13034c3886f2 draft

planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f10386dee95f3b1fbc8d1eeec52d450381ba89c5
author computational-metabolomics
date Fri, 13 Sep 2024 12:24:27 +0000
parents 374022b7b469
children
comparison
equal deleted inserted replaced
9:374022b7b469 10:13034c3886f2
14 make_option("--isotope_matrix", type = "character"), 14 make_option("--isotope_matrix", type = "character"),
15 make_option("--purityType", default = "purityFWHMmedian"), 15 make_option("--purityType", default = "purityFWHMmedian"),
16 make_option("--singleFile", default = 0), 16 make_option("--singleFile", default = 0),
17 make_option("--cores", default = 4), 17 make_option("--cores", default = 4),
18 make_option("--xgroups", type = "character"), 18 make_option("--xgroups", type = "character"),
19 make_option("--rdata_name", default = "xset"),
20 make_option("--camera_xcms", default = "xset"), 19 make_option("--camera_xcms", default = "xset"),
21 make_option("--files", type = "character"), 20 make_option("--files", type = "character"),
22 make_option("--galaxy_files", type = "character"), 21 make_option("--galaxy_files", type = "character"),
23 make_option("--choose_class", type = "character"), 22 make_option("--choose_class", type = "character"),
24 make_option("--ignore_files", type = "character"), 23 make_option("--ignore_files", type = "character"),
61 rtraw_columns <- FALSE 60 rtraw_columns <- FALSE
62 } else { 61 } else {
63 rtraw_columns <- TRUE 62 rtraw_columns <- TRUE
64 } 63 }
65 64
66 loadRData <- function(rdata_path, xset_name) { 65 loadRData <- function(rdata_path, xnames) {
67 # loads an RData file, and returns the named xset object if it is there 66 # loads an RData file, and returns the named xset object if it is there
68 load(rdata_path) 67 load(rdata_path)
69 return(get(ls()[ls() == xset_name])) 68 return(get(ls()[ls() %in% xnames]))
70 } 69 }
71 70
72 71
73 72
74 73
88 } 87 }
89 return(xset) 88 return(xset)
90 } 89 }
91 } 90 }
92 91
93 target_obj <- loadRData(opt$xset_path, opt$rdata_name) 92 target_obj <- loadRData(opt$xset_path, c('xset', 'xa', 'xdata'))
94 93
95 if (opt$camera_xcms == "camera") { 94 if (opt$camera_xcms == "camera") {
96 xset <- target_obj@xcmsSet 95 xset <- target_obj@xcmsSet
97 } else { 96 } else {
98 xset <- target_obj 97 xset <- target_obj