annotate charts.r @ 0:a87a3773d8ed draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
author iuc
date Fri, 09 Mar 2018 08:23:08 -0500
parents
children 344ac3ca7557
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
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
4 library('getopt');
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
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
7 split <- function(argument){
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()
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
10 list <- gsub("\\s","", argument)
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.
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
28 spec = matrix(c(
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
29 'workdir', 'w', 1, 'character', 'Work directory',
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
30 'module', 'm', 1, 'character', 'Module name',
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
31 'input', 'i', 1, 'character', 'Input tabular file',
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
32 'columns', 'c', 1, 'character', 'Columns string',
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
33 'settings', 's', 1, 'character', 'Settings string',
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
34 'output', 'o', 1, 'character', 'Output tabular file',
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
35 'help', 'h', 0, '', 'Help',
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
36 'verbose', 'v', 0, '', 'Verbose'
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
37 ), byrow=TRUE, ncol=5);
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
38 opt = getopt(spec);
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
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
41 if ( !is.null(opt$help) ||
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)) {
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
46 cat(getopt(spec, usage=TRUE))
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
47 q(status=1);
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
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
51 columns = split(opt$columns)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
52 settings = split(opt$settings)
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
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
55 table <- read.table(opt$input, comment.char='#', fill=TRUE)
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
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
58 module_file = paste(opt$workdir, opt$module, '.r', sep='')
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
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
64 l = wrapper (table, columns, settings)
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
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
67 header_title <- '# title - Chart Utilities (charts)'
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
68 header_date <- paste('# date -', Sys.time(), sep=' ')
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
69 header_module <- paste('# module -', opt$module, sep=' ')
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
70 header_settings <- paste('# settings -', opt$settings, sep=' ')
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
71 header_columns <- paste('# columns -', opt$columns, sep=' ')
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)) {
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
77 print ('Columns:')
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
78 print (columns)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
79 print ('Settings:')
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
80 print (settings)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
81 print ('Result:')
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
82 print (l)
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
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
86 output <- file(opt$output, open='wt')
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
87
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
88 # write header
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
89 writeLines('#', output)
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)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
95 writeLines('#', output)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
96
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) {
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
100 length(col) = rows;
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 })
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
103
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
104 # write table
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
105 write.table(padded, file=output, row.names=FALSE, col.names = FALSE, quote=FALSE, sep='\t')
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
106
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
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
111 print ('Columns:')
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
112 print (columns)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
113 print ('Settings:')
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
114 print (settings)
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
115 print ('No output generated.')
a87a3773d8ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/charts/ commit 87080d49913cfd40a77eda7e5834ac9c4bc30b0b
iuc
parents:
diff changeset
116 }