Mercurial > repos > ethevenot > transformation
comparison transformation_wrapper.R @ 3:cc0e9eff0de2 draft default tip
planemo upload for repository https://github.com/workflow4metabolomics/transformation.git commit 60ebb3e8919c09c18f89a5362750ae45ca84d0c2
| author | ethevenot |
|---|---|
| date | Wed, 28 Feb 2018 09:15:47 -0500 |
| parents | 0ccfc3e15710 |
| children |
comparison
equal
deleted
inserted
replaced
| 2:0ccfc3e15710 | 3:cc0e9eff0de2 |
|---|---|
| 1 #!/usr/bin/env Rscript | 1 #!/usr/bin/env Rscript |
| 2 | 2 |
| 3 library(batch) ## parseCommandArgs | 3 library(batch) ## parseCommandArgs |
| 4 | |
| 5 # Constants | |
| 6 argv <- commandArgs(trailingOnly = FALSE) | |
| 7 script.path <- sub("--file=","",argv[grep("--file=",argv)]) | |
| 8 prog.name <- basename(script.path) | |
| 9 | |
| 10 # Print help | |
| 11 if (length(grep('-h', argv)) >0) { | |
| 12 cat("Usage:", prog.name, | |
| 13 "dataMatrix_in myDataMatrixInput.tsv", | |
| 14 "method log2|log10|sqrt", | |
| 15 "dataMatrix_out myDataMatrixOutput.tsv", | |
| 16 "information information.txt", | |
| 17 "\n") | |
| 18 quit(status = 0) | |
| 19 } | |
| 4 | 20 |
| 5 source_local <- function(fname){ | 21 source_local <- function(fname){ |
| 6 argv <- commandArgs(trailingOnly = FALSE) | 22 argv <- commandArgs(trailingOnly = FALSE) |
| 7 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) | 23 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)) |
| 8 source(paste(base_dir, fname, sep="/")) | 24 source(paste(base_dir, fname, sep="/")) |
