annotate checkformat_wrapper.R @ 0:059eb452931e draft

planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
author ethevenot
date Tue, 24 Oct 2017 08:44:02 -0400
parents
children b642f4f87022
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
1 #!/usr/bin/env Rscript
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
2
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
3 library(batch) ## parseCommandArgs
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
4
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
5 source_local <- function(fname){
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
6 argv <- commandArgs(trailingOnly = FALSE)
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
7 base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
8 source(paste(base_dir, fname, sep="/"))
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
9 }
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
10
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
11 source_local("checkformat_script.R")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
12
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
13 argVc <- unlist(parseCommandArgs(evaluate = FALSE))
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
14
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
15
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
16 ##------------------------------
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
17 ## Initializing
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
18 ##------------------------------
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
19
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
20 ## options
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
21 ##--------
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
22
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
23 strAsFacL <- options()$stringsAsFactors
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
24 options(stringsAsFactors = FALSE)
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
25
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
26 ## constants
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
27 ##----------
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
28
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
29 modNamC <- "Check Format" ## module name
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
30
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
31 ## log file
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
32 ##---------
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
33
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
34 sink(argVc["information"])
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
35
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
36 cat("\nStart of the '", modNamC, "' Galaxy module call: ",
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
37 format(Sys.time(), "%a %d %b %Y %X"), "\n", sep="")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
38
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
39
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
40 ##------------------------------
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
41 ## Computation
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
42 ##------------------------------
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
43
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
44
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
45 resLs <- readAndCheckF(argVc["dataMatrix_in"],
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
46 argVc["sampleMetadata_in"],
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
47 argVc["variableMetadata_in"])
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
48 chkL <- resLs[["chkL"]]
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
49
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
50
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
51 ##------------------------------
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
52 ## Ending
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
53 ##------------------------------
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
54
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
55
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
56 if(chkL) {
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
57
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
58 cat("\nTable formats are OK; enjoy your analyses!\n", sep="")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
59
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
60 cat("\nEnd of the '", modNamC, "' Galaxy module call: ",
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
61 format(Sys.time(), "%a %d %b %Y %X"), "\n", sep="")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
62
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
63 cat("\n\n\n============================================================================")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
64 cat("\nAdditional information about the call:\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
65 cat("\n1) Parameters:\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
66 print(cbind(value = argVc))
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
67
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
68 cat("\n2) Session Info:\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
69 sessioninfo <- sessionInfo()
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
70 cat(sessioninfo$R.version$version.string,"\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
71 cat("Main packages:\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
72 for (pkg in names(sessioninfo$otherPkgs)) { cat(paste(pkg,packageVersion(pkg)),"\t") }; cat("\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
73 cat("Other loaded packages:\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
74 for (pkg in names(sessioninfo$loadedOnly)) { cat(paste(pkg,packageVersion(pkg)),"\t") }; cat("\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
75
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
76 cat("============================================================================\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
77
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
78 sink()
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
79
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
80 } else {
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
81
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
82 cat("\n\n\n============================================================================")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
83 cat("\nAdditional information about the call:\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
84 cat("\n1) Parameters:\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
85 print(cbind(value = argVc))
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
86
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
87 cat("\n2) Session Info:\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
88 sessioninfo <- sessionInfo()
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
89 cat(sessioninfo$R.version$version.string,"\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
90 cat("Main packages:\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
91 for (pkg in names(sessioninfo$otherPkgs)) { cat(paste(pkg,packageVersion(pkg)),"\t") }; cat("\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
92 cat("Other loaded packages:\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
93 for (pkg in names(sessioninfo$loadedOnly)) { cat(paste(pkg,packageVersion(pkg)),"\t") }; cat("\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
94
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
95 cat("============================================================================\n")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
96
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
97 sink()
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
98 stop("Please check the generated 'information' file")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
99
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
100 }
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
101
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
102 ## closing
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
103 ##--------
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
104
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
105 options(stringsAsFactors = strAsFacL)
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
106
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
107 rm(list = ls())