comparison 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
comparison
equal deleted inserted replaced
33:ea611367e1da 34:d8bac1291473
29 cat("\tARGUMENTS PROCESSING INFO\n") 29 cat("\tARGUMENTS PROCESSING INFO\n")
30 30
31 #saving the specific parameters 31 #saving the specific parameters
32 method <- "FillChromPeaks" 32 method <- "FillChromPeaks"
33 33
34 if (!is.null(args$convertRTMinute)){ 34 if (!is.null(args$convertRTMinute)) convertRTMinute <- args$convertRTMinute
35 convertRTMinute <- args$convertRTMinute; args$convertRTMinute <- NULL 35 if (!is.null(args$numDigitsMZ)) numDigitsMZ <- args$numDigitsMZ
36 } 36 if (!is.null(args$numDigitsRT)) numDigitsRT <- args$numDigitsRT
37 if (!is.null(args$numDigitsMZ)){ 37 if (!is.null(args$intval)) intval <- args$intval
38 numDigitsMZ <- args$numDigitsMZ; args$numDigitsMZ <- NULL
39 }
40 if (!is.null(args$numDigitsRT)){
41 numDigitsRT <- args$numDigitsRT; args$numDigitsRT <- NULL
42 }
43 if (!is.null(args$intval)){
44 intval <- args$intval; args$intval <- NULL
45 }
46 38
47 cat("\n\n") 39 cat("\n\n")
48 40
49 41
50 # ----- ARGUMENTS PROCESSING ----- 42 # ----- ARGUMENTS PROCESSING -----
51 cat("\tINFILE PROCESSING INFO\n") 43 cat("\tINFILE PROCESSING INFO\n")
52 44
53 #image is an .RData file necessary to use xset variable given by previous tools 45 #image is an .RData file necessary to use xset variable given by previous tools
54 load(args$image); args$image=NULL 46 load(args$image)
55 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.*") 47 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.*")
56 48
57 #Verification of a group step before doing the fillpeaks job. 49 #Verification of a group step before doing the fillpeaks job.
58 if (!hasFeatures(xdata)) stop("You must always do a group step after a retcor. Otherwise it won't work for the fillpeaks step") 50 if (!hasFeatures(xdata)) stop("You must always do a group step after a retcor. Otherwise it won't work for the fillpeaks step")
59 51
61 if (!exists("singlefile")) singlefile <- NULL 53 if (!exists("singlefile")) singlefile <- NULL
62 if (!exists("zipfile")) zipfile <- NULL 54 if (!exists("zipfile")) zipfile <- NULL
63 rawFilePath <- getRawfilePathFromArguments(singlefile, zipfile, args) 55 rawFilePath <- getRawfilePathFromArguments(singlefile, zipfile, args)
64 zipfile <- rawFilePath$zipfile 56 zipfile <- rawFilePath$zipfile
65 singlefile <- rawFilePath$singlefile 57 singlefile <- rawFilePath$singlefile
66 args <- rawFilePath$args
67 directory <- retrieveRawfileInTheWorkingDirectory(singlefile, zipfile) 58 directory <- retrieveRawfileInTheWorkingDirectory(singlefile, zipfile)
68 59
69 # Check some character issues 60 # Check some character issues
70 md5sumList <- list("origin" = getMd5sum(directory)) 61 md5sumList <- list("origin" = getMd5sum(directory))
71 checkXmlStructure(directory) 62 checkXmlStructure(directory)
80 71
81 72
82 cat("\t\tCOMPUTE\n") 73 cat("\t\tCOMPUTE\n")
83 74
84 cat("\t\t\tFilling missing peaks using default settings\n") 75 cat("\t\t\tFilling missing peaks using default settings\n")
76 # clear the arguement list to remove unexpected key/value as singlefile_galaxyPath or method ...
77 args <- args[names(args) %in% slotNames(do.call(paste0(method,"Param"), list()))]
78
85 fillChromPeaksParam <- do.call(paste0(method,"Param"), args) 79 fillChromPeaksParam <- do.call(paste0(method,"Param"), args)
86 print(fillChromPeaksParam) 80 print(fillChromPeaksParam)
87 xdata <- fillChromPeaks(xdata, param=fillChromPeaksParam) 81 xdata <- fillChromPeaks(xdata, param=fillChromPeaksParam)
88 82
89 if (exists("intval")) { 83 if (exists("intval")) {