annotate charts.r @ 1:344ac3ca7557 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
author iuc
date Wed, 17 Nov 2021 09:06:59 +0000
parents a87a3773d8ed
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
1 #!/usr/bin/Rscript
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
2
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
3 # load getopt library
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
4 library("getopt");
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
5
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
6 # convert multi parameter string (i.e. key1: value, key2: value, ...) to object
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
7 split <- function(argument) {
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
8 # process parameter string
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
9 options <- list()
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
10 list <- gsub("\\s", "", argument)
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
11 list <- strsplit(list, ",")
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
12 if (length(list) > 0) {
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
13 list <- list[[1]]
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
14 for (entry in list) {
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
15 pair <- strsplit(entry, ":")
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
16 if (length(pair) > 0) {
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
17 pair <- pair[[1]]
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
18 if (length(pair) == 2) {
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
19 options[[pair[1]]] <- pair[2]
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
20 }
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
21 }
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
22 }
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
23 }
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
24 return(options)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
25 }
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
26
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
27 # get options, using the spec as defined by the enclosed list.
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
28 spec <- matrix(c(
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
29 "workdir", "w", 1, "character", "Work directory",
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
30 "module", "m", 1, "character", "Module name",
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
31 "input", "i", 1, "character", "Input tabular file",
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
32 "columns", "c", 1, "character", "Columns string",
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
33 "settings", "s", 1, "character", "Settings string",
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
34 "output", "o", 1, "character", "Output tabular file",
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
35 "help", "h", 0, "", "Help",
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
36 "verbose", "v", 0, "", "Verbose"
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
37 ), byrow = TRUE, ncol = 5);
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
38 opt <- getopt(spec);
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
39
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
40 # show help
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
41 if (!is.null(opt$help) ||
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
42 is.null(opt$module) ||
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
43 is.null(opt$input) ||
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
44 is.null(opt$columns) ||
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
45 is.null(opt$output)) {
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
46 cat(getopt(spec, usage = TRUE))
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
47 q(status = 1);
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
48 }
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
49
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
50 # read columns/settings
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
51 columns <- split(opt$columns)
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
52 settings <- split(opt$settings)
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
53
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
54 # read table
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
55 table <- read.table(opt$input, comment.char = "#", fill = TRUE)
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
56
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
57 # identify module file
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
58 module_file <- paste(opt$workdir, opt$module, ".r", sep = "")
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
59
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
60 # source module
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
61 source(module_file)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
62
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
63 # run module
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
64 l <- wrapper(table, columns, settings)
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
65
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
66 # header
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
67 header_title <- "# title - Chart Utilities (charts)"
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
68 header_date <- paste("# date -", Sys.time(), sep = " ")
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
69 header_module <- paste("# module -", opt$module, sep = " ")
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
70 header_settings <- paste("# settings -", opt$settings, sep = " ")
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
71 header_columns <- paste("# columns -", opt$columns, sep = " ")
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
72
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
73 # check result
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
74 if (length(l) > 0) {
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
75 # print details
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
76 if (!is.null(opt$verbose)) {
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
77 print("Columns:")
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
78 print(columns)
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
79 print("Settings:")
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
80 print(settings)
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
81 print("Result:")
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
82 print(l)
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
83 }
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
84
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
85 # create output file
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
86 output <- file(opt$output, open = "wt")
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
87
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
88 # write header
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
89 writeLines("#", output)
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
90 writeLines(header_title, output)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
91 writeLines(header_date, output)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
92 writeLines(header_module, output)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
93 writeLines(header_settings, output)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
94 writeLines(header_columns, output)
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
95 writeLines("#", output)
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
96
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
97 # pad columns
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
98 rows <- max(unlist(lapply(l, length)))
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
99 padded <- lapply(l, function(col) {
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
100 length(col) <- rows;
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
101 col
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
102 })
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
103
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
104 # write table
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
105 write.table(padded, file = output, row.names = FALSE, col.names = FALSE, quote = FALSE, sep = "\t")
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
106
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
107 # close file
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
108 close(output)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
109 } else {
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
110 # print details
1
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
111 print("Columns:")
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
112 print(columns)
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
113 print("Settings:")
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
114 print(settings)
344ac3ca7557 "planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 4494db13b69987fbc97d47177d2a5956e46e927b"
iuc
parents: 0
diff changeset
115 print("No output generated.")
0
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
116 }