diff xcms_fillpeaks.r @ 34:d8bac1291473 draft

planemo upload for repository https://github.com/workflow4metabolomics/xcms commit f01148783819c37e474790dbd56619862960448a
author lecorguille
date Tue, 03 Apr 2018 11:40:32 -0400
parents 8fd5b5afa24d
children e67cbb96d9e9
line wrap: on
line diff
--- a/xcms_fillpeaks.r	Thu Mar 08 05:55:04 2018 -0500
+++ b/xcms_fillpeaks.r	Tue Apr 03 11:40:32 2018 -0400
@@ -31,18 +31,10 @@
 #saving the specific parameters
 method <- "FillChromPeaks"
 
-if (!is.null(args$convertRTMinute)){
-    convertRTMinute <- args$convertRTMinute; args$convertRTMinute <- NULL
-}
-if (!is.null(args$numDigitsMZ)){
-    numDigitsMZ <- args$numDigitsMZ; args$numDigitsMZ <- NULL
-}
-if (!is.null(args$numDigitsRT)){
-    numDigitsRT <- args$numDigitsRT; args$numDigitsRT <- NULL
-}
-if (!is.null(args$intval)){
-    intval <- args$intval; args$intval <- NULL
-}
+if (!is.null(args$convertRTMinute)) convertRTMinute <- args$convertRTMinute
+if (!is.null(args$numDigitsMZ)) numDigitsMZ <- args$numDigitsMZ
+if (!is.null(args$numDigitsRT)) numDigitsRT <- args$numDigitsRT
+if (!is.null(args$intval)) intval <- args$intval
 
 cat("\n\n")
 
@@ -51,7 +43,7 @@
 cat("\tINFILE PROCESSING INFO\n")
 
 #image is an .RData file necessary to use xset variable given by previous tools
-load(args$image); args$image=NULL
+load(args$image)
 if (!exists("xdata")) stop("\n\nERROR: The RData doesn't contain any object called 'xdata'. This RData should have been created by an old version of XMCS 2.*")
 
 #Verification of a group step before doing the fillpeaks job.
@@ -63,7 +55,6 @@
 rawFilePath <- getRawfilePathFromArguments(singlefile, zipfile, args)
 zipfile <- rawFilePath$zipfile
 singlefile <- rawFilePath$singlefile
-args <- rawFilePath$args
 directory <- retrieveRawfileInTheWorkingDirectory(singlefile, zipfile)
 
 # Check some character issues
@@ -82,6 +73,9 @@
 cat("\t\tCOMPUTE\n")
 
 cat("\t\t\tFilling missing peaks using default settings\n")
+# clear the arguement list to remove unexpected key/value as singlefile_galaxyPath or method ...
+args <- args[names(args) %in% slotNames(do.call(paste0(method,"Param"), list()))]
+
 fillChromPeaksParam <- do.call(paste0(method,"Param"), args)
 print(fillChromPeaksParam)
 xdata <- fillChromPeaks(xdata, param=fillChromPeaksParam)