Mercurial > repos > lecorguille > xcms_retcor
diff xcms_retcor.r @ 50:0bc08f128b42 draft default tip
planemo upload for repository https://github.com/workflow4metabolomics/tools-metabolomics/ commit 95721ced8347c09e79340e6d67ecb41c5cc64163
author | workflow4metabolomics |
---|---|
date | Mon, 03 Feb 2025 14:41:19 +0000 |
parents | 177b5847a211 |
children |
line wrap: on
line diff
--- a/xcms_retcor.r Mon Jul 15 15:55:13 2024 +0000 +++ b/xcms_retcor.r Mon Feb 03 14:41:19 2025 +0000 @@ -9,11 +9,11 @@ # ----- PACKAGE ----- cat("\tSESSION INFO\n") -#Import the different functions +# Import the different functions source_local <- function(fname) { - argv <- commandArgs(trailingOnly = FALSE) - base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) - source(paste(base_dir, fname, sep = "/")) + argv <- commandArgs(trailingOnly = FALSE) + base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) + source(paste(base_dir, fname, sep = "/")) } source_local("lib.r") @@ -24,7 +24,7 @@ # ----- ARGUMENTS ----- cat("\tARGUMENTS INFO\n") -args <- parseCommandArgs(evaluate = FALSE) #interpretation of arguments given in command line as an R list of objects +args <- parseCommandArgs(evaluate = FALSE) # interpretation of arguments given in command line as an R list of objects write.table(as.matrix(args), col.names = FALSE, quote = FALSE, sep = "\t") cat("\n\n") @@ -32,7 +32,7 @@ # ----- PROCESSING INFILE ----- cat("\tARGUMENTS PROCESSING INFO\n") -#saving the specific parameters +# saving the specific parameters method <- args$method cat("\n\n") @@ -41,7 +41,7 @@ # ----- ARGUMENTS PROCESSING ----- cat("\tINFILE PROCESSING INFO\n") -#image is an .RData file necessary to use xset variable given by previous tools +# image is an .RData file necessary to use xset variable given by previous tools load(args$image) args$image <- NULL 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.*") @@ -70,9 +70,9 @@ print(adjustRtimeParam) if (hasAdjustedRtime(xdata)) { - cat("WARNING: a retention time ajustment had already been applied to your data.\nThe function applyAdjustedRtime was processed to cumulate the ajustment") - cat("Replace raw retention times with adjusted retention times.\n") - xdata <- applyAdjustedRtime(xdata) + cat("WARNING: a retention time ajustment had already been applied to your data.\nThe function applyAdjustedRtime was processed to cumulate the ajustment") + cat("Replace raw retention times with adjusted retention times.\n") + xdata <- applyAdjustedRtime(xdata) } xdata <- adjustRtime(xdata, param = adjustRtimeParam) @@ -97,7 +97,7 @@ print(xset) cat("\n\n") -#saving R data in .Rdata file to save the variables used in the present tool +# saving R data in .Rdata file to save the variables used in the present tool objects2save <- c("xdata", "zipfile", "singlefile", "md5sumList", "sampleNamesList") save(list = objects2save[objects2save %in% ls()], file = "retcor.RData")