Mercurial > repos > lecorguille > xcms_merge
comparison xcms_merge.r @ 25:7e2770b86a0e draft default tip
planemo upload for repository https://github.com/workflow4metabolomics/tools-metabolomics/ commit 95721ced8347c09e79340e6d67ecb41c5cc64163
| author | workflow4metabolomics |
|---|---|
| date | Mon, 03 Feb 2025 14:39:35 +0000 |
| parents | bf452dc6e4b0 |
| children |
comparison
equal
deleted
inserted
replaced
| 24:bf452dc6e4b0 | 25:7e2770b86a0e |
|---|---|
| 1 #!/usr/bin/env Rscript | 1 #!/usr/bin/env Rscript |
| 2 | 2 |
| 3 #Import the different functions | 3 # Import the different functions |
| 4 source_local <- function(fname) { | 4 source_local <- function(fname) { |
| 5 argv <- commandArgs(trailingOnly = FALSE) | 5 argv <- commandArgs(trailingOnly = FALSE) |
| 6 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) | 6 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) |
| 7 source(paste(base_dir, fname, sep = "/")) | 7 source(paste(base_dir, fname, sep = "/")) |
| 8 } | 8 } |
| 9 source_local("lib.r") | 9 source_local("lib.r") |
| 10 | 10 |
| 11 pkgs <- c("xcms", "batch") | 11 pkgs <- c("xcms", "batch") |
| 12 loadAndDisplayPackages(pkgs) | 12 loadAndDisplayPackages(pkgs) |
| 13 cat("\n\n") | 13 cat("\n\n") |
| 14 | 14 |
| 15 args <- parseCommandArgs(evaluate = FALSE) #interpretation of arguments given in command line as an R list of objects | 15 args <- parseCommandArgs(evaluate = FALSE) # interpretation of arguments given in command line as an R list of objects |
| 16 | 16 |
| 17 | 17 |
| 18 cat("\tXSET MERGING...\n") | 18 cat("\tXSET MERGING...\n") |
| 19 | 19 |
| 20 mergeXDataReturn <- mergeXData(args) | 20 mergeXDataReturn <- mergeXData(args) |
| 41 print(xset@phenoData) | 41 print(xset@phenoData) |
| 42 print(xset) | 42 print(xset) |
| 43 cat("\n\n") | 43 cat("\n\n") |
| 44 | 44 |
| 45 cat("\tSAVE RData\n") | 45 cat("\tSAVE RData\n") |
| 46 #saving R data in .Rdata file to save the variables used in the present tool | 46 # saving R data in .Rdata file to save the variables used in the present tool |
| 47 objects2save <- c("xdata", "zipfile", "singlefile", "md5sumList", "sampleNamesList") #, "chromTIC", "chromBPI") | 47 objects2save <- c("xdata", "zipfile", "singlefile", "md5sumList", "sampleNamesList") # , "chromTIC", "chromBPI") |
| 48 save(list = objects2save[objects2save %in% ls()], file = "merged.RData") | 48 save(list = objects2save[objects2save %in% ls()], file = "merged.RData") |
