comparison checkFormat_wrapper.R @ 0:0d8099822c49 draft

planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 217d97da5c733c3628997666c73867e81af0a0ee
author ethevenot
date Sat, 30 Jul 2016 12:06:35 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:0d8099822c49
1 #!/usr/bin/Rscript --vanilla --slave --no-site-file
2
3 library(batch) ## parseCommandArgs
4
5 source_local <- function(fname){
6 argv <- commandArgs(trailingOnly = FALSE)
7 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
8 source(paste(base_dir, fname, sep="/"))
9 }
10
11 source_local("checkFormat_script.R")
12
13 argVc <- unlist(parseCommandArgs(evaluate = FALSE))
14
15
16 ##------------------------------
17 ## Initializing
18 ##------------------------------
19
20 ## options
21 ##--------
22
23 strAsFacL <- options()$stringsAsFactors
24 options(stringsAsFactors = FALSE)
25
26 ## constants
27 ##----------
28
29 modNamC <- "Check Format" ## module name
30
31 ## log file
32 ##---------
33
34 sink(argVc["information"])
35
36 cat("\nStart of the '", modNamC, "' Galaxy module call: ",
37 format(Sys.time(), "%a %d %b %Y %X"), "\n", sep="")
38
39
40 ##------------------------------
41 ## Computation
42 ##------------------------------
43
44
45 resLs <- readAndCheckF(argVc["dataMatrix_in"],
46 argVc["sampleMetadata_in"],
47 argVc["variableMetadata_in"])
48 chkL <- resLs[["chkL"]]
49
50
51 ##------------------------------
52 ## Ending
53 ##------------------------------
54
55
56 if(chkL) {
57
58 cat("\nTable formats are OK; enjoy your analyses!\n", sep="")
59
60 cat("\nEnd of the '", modNamC, "' Galaxy module call: ",
61 format(Sys.time(), "%a %d %b %Y %X"), "\n", sep="")
62
63 sink()
64
65 } else {
66
67 sink()
68 stop("Please check the generated 'information' file")
69
70 }
71
72 ## closing
73 ##--------
74
75 options(stringsAsFactors = strAsFacL)
76
77 rm(list = ls())