Skip to content

Commit

Permalink
Fix for purityX xset object read
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomnl authored Sep 13, 2024
1 parent 468654b commit 21add9b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tools/msPurity/purityX.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ option_list <- list(
make_option("--singleFile", default = 0),
make_option("--cores", default = 4),
make_option("--xgroups", type = "character"),
make_option("--rdata_name", default = "xset"),
make_option("--camera_xcms", default = "xset"),
make_option("--files", type = "character"),
make_option("--galaxy_files", type = "character"),
Expand Down Expand Up @@ -63,10 +62,10 @@ if (is.null(opt$rtraw_columns)) {
rtraw_columns <- TRUE
}

loadRData <- function(rdata_path, xset_name) {
loadRData <- function(rdata_path, xnames) {
# loads an RData file, and returns the named xset object if it is there
load(rdata_path)
return(get(ls()[ls() == xset_name]))
return(get(ls()[ls() %in% xnames]))
}


Expand All @@ -90,7 +89,7 @@ getxcmsSetObject <- function(xobject) {
}
}

target_obj <- loadRData(opt$xset_path, opt$rdata_name)
target_obj <- loadRData(opt$xset_path, c('xset', 'xa', 'xdata'))

if (opt$camera_xcms == "camera") {
xset <- target_obj@xcmsSet
Expand Down

0 comments on commit 21add9b

Please sign in to comment.