Mercurial > repos > lecorguille > msnbase_readmsdata
comparison msnbase_readmsdata.r @ 16:733d32b30aff draft default tip
planemo upload for repository https://github.com/workflow4metabolomics/tools-metabolomics/ commit 95721ced8347c09e79340e6d67ecb41c5cc64163
| author | workflow4metabolomics |
|---|---|
| date | Mon, 03 Feb 2025 14:43:08 +0000 |
| parents | b25a582ab6c1 |
| children |
comparison
equal
deleted
inserted
replaced
| 15:b25a582ab6c1 | 16:733d32b30aff |
|---|---|
| 7 | 7 |
| 8 | 8 |
| 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) | 14 argv <- commandArgs(trailingOnly = FALSE) |
| 15 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) | 15 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) |
| 16 source(paste(base_dir, fname, sep = "/")) | 16 source(paste(base_dir, fname, sep = "/")) |
| 17 } | 17 } |
| 18 source_local("lib.r") | 18 source_local("lib.r") |
| 19 | 19 |
| 20 pkgs <- c("MSnbase", "batch") | 20 pkgs <- c("MSnbase", "batch") |
| 21 loadAndDisplayPackages(pkgs) | 21 loadAndDisplayPackages(pkgs) |
| 22 cat("\n\n") | 22 cat("\n\n") |
| 23 | 23 |
| 24 | 24 |
| 25 # ----- ARGUMENTS ----- | 25 # ----- ARGUMENTS ----- |
| 26 cat("\tARGUMENTS INFO\n") | 26 cat("\tARGUMENTS INFO\n") |
| 27 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 |
| 28 write.table(as.matrix(args), col.names = FALSE, quote = FALSE, sep = "\t") | 28 write.table(as.matrix(args), col.names = FALSE, quote = FALSE, sep = "\t") |
| 29 | 29 |
| 30 cat("\n\n") | 30 cat("\n\n") |
| 31 | 31 |
| 32 | 32 |
| 81 print(raw_data) | 81 print(raw_data) |
| 82 cat("\t\tphenoData\n") | 82 cat("\t\tphenoData\n") |
| 83 print(raw_data@phenoData@data) | 83 print(raw_data@phenoData@data) |
| 84 cat("\n\n") | 84 cat("\n\n") |
| 85 | 85 |
| 86 #saving R data in .Rdata file to save the variables used in the present tool | 86 # saving R data in .Rdata file to save the variables used in the present tool |
| 87 objects2save <- c("raw_data", "zipfile", "singlefile", "md5sumList", "sampleNamesList") #, "chromTIC", "chromBPI") | 87 objects2save <- c("raw_data", "zipfile", "singlefile", "md5sumList", "sampleNamesList") # , "chromTIC", "chromBPI") |
| 88 save(list = objects2save[objects2save %in% ls()], file = "readmsdata.RData") | 88 save(list = objects2save[objects2save %in% ls()], file = "readmsdata.RData") |
| 89 | 89 |
| 90 | 90 |
| 91 cat("\tDONE\n") | 91 cat("\tDONE\n") |
