annotate tabular2HTML.xml @ 0:a5814dd5a11a default tip

Uploaded
author ondovb
date Fri, 23 Sep 2011 17:06:15 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
1 <tool id="tabular2HTML" name="Tabular-to-HTML" version="1.0.0">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
2 <description>for easier table viewing</description>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
3 <command interpreter="perl">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
4 tabular2HTML.pl
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
5 $tableHeader
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
6 $input
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
7 $output
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
8 #if $headerSource.source == 'explicit':
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
9 #for $header in $headerSource.headers
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
10 #if len($header.subheaders) > 0
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
11 ${len($header.subheaders)}
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
12 #else
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
13 1
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
14 #end if
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
15 #end for
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
16 #end if
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
17 </command>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
18 <inputs>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
19 <param name="input" type="data" format="tabular" label="Tabular data"/>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
20 <conditional name="headerSource">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
21 <param name="source" type="select" label="Header">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
22 <option value="numbers">Column numbers</option>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
23 <option value="names">Column names (if available)</option>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
24 <option value="explicit">Specify headers and subheaders</option>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
25 <option value="none">None</option>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
26 </param>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
27 <when value="numbers">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
28 </when>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
29 <when value="names">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
30 </when>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
31 <when value="explicit">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
32 <repeat name="headers" title="Header">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
33 <param name="name" type="text" label="Name">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
34 <sanitizer>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
35 <valid initial="string.printable">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
36 <remove value="&lt;"/>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
37 <remove value="&gt;"/>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
38 </valid>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
39 <mapping initial="none">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
40 <add source="&lt;" target="&amp;lt;"/>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
41 <add source="&gt;" target="&amp;gt;"/>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
42 </mapping>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
43 </sanitizer>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
44 </param>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
45 <repeat name="subheaders" title="Subheader">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
46 <param name="name" type="text" label="Name"/>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
47 </repeat>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
48 </repeat>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
49 </when>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
50 <when value="none">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
51 </when>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
52 </conditional>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
53 </inputs>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
54 <outputs>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
55 <data format="html" name="output"/>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
56 </outputs>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
57 <configfiles>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
58 <configfile name="tableHeader">
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
59 &lt;html&gt;&lt;head&gt;&lt;style type="text/css"&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
60 table,td,th
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
61 {
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
62 border: 1px solid #dddddd;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
63 border-collapse: collapse;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
64 padding: 4px;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
65 font-size: 10pt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
66 }
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
67 th{border-width:2px; background-color: #888888; color: #ffffff}
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
68 tr.odd {background-color: #f2fff2}
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
69 tr.even {background-color: #f2f2ff}
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
70 td.darkRight {border-right: 2px solid #888888}
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
71 &lt;/style&gt;&lt;/head&gt;&lt;body&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
72 &lt;table style="border-collapse:collapse"&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
73 #if $headerSource.source == 'numbers':
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
74 &lt;tr&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
75 #for $i in range(int($input.metadata.columns)):
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
76 &lt;th&gt;${i + 1}&lt;/th&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
77 #end for
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
78 &lt;/tr&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
79 #elif $headerSource.source == 'names' and hasattr($input.datatype, 'column_names'):
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
80 &lt;tr&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
81 #for $columnName in $input.datatype.column_names:
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
82 &lt;th&gt;$columnName&lt;/th&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
83 #end for
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
84 &lt;/tr&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
85 #elif $headerSource.source == 'explicit':
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
86 &lt;tr&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
87 #for $header in $headerSource.headers:
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
88 &lt;th
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
89 #if len($header.subheaders) > 0:
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
90 colspan="${len($header.subheaders)}"
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
91 #else
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
92 rowspan="2"
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
93 #end if
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
94 &gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
95 $header.name
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
96 &lt;/th&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
97 #end for
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
98 &lt;tr&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
99 #for $header in $headerSource.headers:
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
100 #for $subheader in $header.subheaders:
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
101 &lt;th&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
102 ${subheader.name}
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
103 &lt;/th&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
104 #end for
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
105 #end for
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
106 &lt;/tr&gt;
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
107 #end if
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
108 </configfile>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
109 </configfiles>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
110 <help>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
111 **===What it does===**
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
112
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
113 Wraps tabular data in an HTML table for easier viewing.
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
114
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
115 ------
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
116
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
117 **===Headers===**
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
118
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
119 **Column numbers** - The header will show the order of the columns.
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
120
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
121 **Column names** - The header will show column names if the data file is a
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
122 specific type of tabular file that has column names in
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
123 Galaxy (such as *sam* or *taxonomy*). Otherwise, no header will be shown.
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
124
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
125 **Specify headers and subheaders** - This allows custom headers, which can span
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
126 multiple columns if subheaders are included. For example, the tabular file::
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
127
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
128 1 2 3 4
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
129 read1 100 12345 50
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
130 read2 150 56789 60
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
131
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
132 ...with the headers and subheaders::
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
133
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
134 Query
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
135 ID
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
136 length
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
137 Hit
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
138 gi
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
139 score
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
140
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
141 ...would create an html table with the format:
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
142
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
143 +----------------+---------------+
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
144 | Query | Hit |
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
145 +-------+--------+-------+-------+
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
146 | ID | length | gi | score |
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
147 +=======+========+=======+=======+
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
148 | read1 | 100 | 12345 | 50 |
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
149 +-------+--------+-------+-------+
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
150 | read2 | 150 | 56789 | 60 |
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
151 +-------+--------+-------+-------+
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
152
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
153 </help>
a5814dd5a11a Uploaded
ondovb
parents:
diff changeset
154 </tool>