diff xcms_merge.r @ 14:5bd125a3f3b0 draft

"planemo upload for repository https://github.com/workflow4metabolomics/xcms commit dcc90f9cf76e6980c0a7d9698c89fab826e7adae"
author workflow4metabolomics
date Wed, 07 Apr 2021 12:07:13 +0000
parents 772290533d6e
children 58b5a4b6e1da
line wrap: on
line diff
--- a/xcms_merge.r	Wed Feb 12 08:29:39 2020 -0500
+++ b/xcms_merge.r	Wed Apr 07 12:07:13 2021 +0000
@@ -1,14 +1,16 @@
 #!/usr/bin/env Rscript
 
 #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="/")) }
+source_local <- function(fname) {
+  argv <- commandArgs(trailingOnly = FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep = "/"))
+}
 source_local("lib.r")
 
-pkgs <- c("xcms","batch")
+pkgs <- c("xcms", "batch")
 loadAndDisplayPackages(pkgs)
 cat("\n\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
 
 
 cat("\tXSET MERGING...\n")
@@ -22,7 +24,7 @@
 chromBPI <- mergeXDataReturn$chromBPI
 
 # Create a sampleMetada file
-sampleNamesList <- getSampleMetadata(xdata=xdata, sampleMetadataOutput="sampleMetadata.tsv")
+sampleNamesList <- getSampleMetadata(xdata = xdata, sampleMetadataOutput = "sampleMetadata.tsv")
 
 cat("\n\n")
 
@@ -41,4 +43,4 @@
 cat("\tSAVE RData\n")
 #saving R data in .Rdata file to save the variables used in the present tool
 objects2save <- c("xdata", "zipfile", "singlefile", "md5sumList", "sampleNamesList") #, "chromTIC", "chromBPI")
-save(list=objects2save[objects2save %in% ls()], file="merged.RData")
+save(list = objects2save[objects2save %in% ls()], file = "merged.RData")