comparison xcms_retcor.r @ 49:177b5847a211 draft

planemo upload for repository https://github.com/workflow4metabolomics/tools-metabolomics/ commit eca29d4347fe2f4802091c4a06715232a6fd9253
author workflow4metabolomics
date Mon, 15 Jul 2024 15:55:13 +0000
parents 366ff564f949
children 0bc08f128b42
comparison
equal deleted inserted replaced
48:366ff564f949 49:177b5847a211
9 # ----- PACKAGE ----- 9 # ----- PACKAGE -----
10 cat("\tSESSION INFO\n") 10 cat("\tSESSION INFO\n")
11 11
12 #Import the different functions 12 #Import the different functions
13 source_local <- function(fname) { 13 source_local <- function(fname) {
14 argv <- commandArgs(trailingOnly = FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep = "/")) 14 argv <- commandArgs(trailingOnly = FALSE)
15 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
16 source(paste(base_dir, fname, sep = "/"))
15 } 17 }
16 source_local("lib.r") 18 source_local("lib.r")
17 19
18 pkgs <- c("xcms", "batch", "RColorBrewer") 20 pkgs <- c("xcms", "batch", "RColorBrewer")
19 loadAndDisplayPackages(pkgs) 21 loadAndDisplayPackages(pkgs)
20 cat("\n\n"); 22 cat("\n\n")
21 23
22 24
23 # ----- ARGUMENTS ----- 25 # ----- ARGUMENTS -----
24 cat("\tARGUMENTS INFO\n") 26 cat("\tARGUMENTS INFO\n")
25 args <- parseCommandArgs(evaluate = FALSE) #interpretation of arguments given in command line as an R list of objects 27 args <- parseCommandArgs(evaluate = FALSE) #interpretation of arguments given in command line as an R list of objects
26 write.table(as.matrix(args), col.names = F, quote = F, sep = "\t") 28 write.table(as.matrix(args), col.names = FALSE, quote = FALSE, sep = "\t")
27 29
28 cat("\n\n") 30 cat("\n\n")
29 31
30 # ----- PROCESSING INFILE ----- 32 # ----- PROCESSING INFILE -----
31 cat("\tARGUMENTS PROCESSING INFO\n") 33 cat("\tARGUMENTS PROCESSING INFO\n")
38 40
39 # ----- ARGUMENTS PROCESSING ----- 41 # ----- ARGUMENTS PROCESSING -----
40 cat("\tINFILE PROCESSING INFO\n") 42 cat("\tINFILE PROCESSING INFO\n")
41 43
42 #image is an .RData file necessary to use xset variable given by previous tools 44 #image is an .RData file necessary to use xset variable given by previous tools
43 load(args$image); args$image <- NULL 45 load(args$image)
46 args$image <- NULL
44 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.*")
45 48
46 # Handle infiles 49 # Handle infiles
47 if (!exists("singlefile")) singlefile <- NULL 50 if (!exists("singlefile")) singlefile <- NULL
48 if (!exists("zipfile")) zipfile <- NULL 51 if (!exists("zipfile")) zipfile <- NULL