Mercurial > repos > ondovb > tabular2html
view tabular2HTML.xml @ 0:a5814dd5a11a default tip
Uploaded
author | ondovb |
---|---|
date | Fri, 23 Sep 2011 17:06:15 -0400 |
parents | |
children |
line wrap: on
line source
<tool id="tabular2HTML" name="Tabular-to-HTML" version="1.0.0"> <description>for easier table viewing</description> <command interpreter="perl"> tabular2HTML.pl $tableHeader $input $output #if $headerSource.source == 'explicit': #for $header in $headerSource.headers #if len($header.subheaders) > 0 ${len($header.subheaders)} #else 1 #end if #end for #end if </command> <inputs> <param name="input" type="data" format="tabular" label="Tabular data"/> <conditional name="headerSource"> <param name="source" type="select" label="Header"> <option value="numbers">Column numbers</option> <option value="names">Column names (if available)</option> <option value="explicit">Specify headers and subheaders</option> <option value="none">None</option> </param> <when value="numbers"> </when> <when value="names"> </when> <when value="explicit"> <repeat name="headers" title="Header"> <param name="name" type="text" label="Name"> <sanitizer> <valid initial="string.printable"> <remove value="<"/> <remove value=">"/> </valid> <mapping initial="none"> <add source="<" target="&lt;"/> <add source=">" target="&gt;"/> </mapping> </sanitizer> </param> <repeat name="subheaders" title="Subheader"> <param name="name" type="text" label="Name"/> </repeat> </repeat> </when> <when value="none"> </when> </conditional> </inputs> <outputs> <data format="html" name="output"/> </outputs> <configfiles> <configfile name="tableHeader"> <html><head><style type="text/css"> table,td,th { border: 1px solid #dddddd; border-collapse: collapse; padding: 4px; font-size: 10pt; } th{border-width:2px; background-color: #888888; color: #ffffff} tr.odd {background-color: #f2fff2} tr.even {background-color: #f2f2ff} td.darkRight {border-right: 2px solid #888888} </style></head><body> <table style="border-collapse:collapse"> #if $headerSource.source == 'numbers': <tr> #for $i in range(int($input.metadata.columns)): <th>${i + 1}</th> #end for </tr> #elif $headerSource.source == 'names' and hasattr($input.datatype, 'column_names'): <tr> #for $columnName in $input.datatype.column_names: <th>$columnName</th> #end for </tr> #elif $headerSource.source == 'explicit': <tr> #for $header in $headerSource.headers: <th #if len($header.subheaders) > 0: colspan="${len($header.subheaders)}" #else rowspan="2" #end if > $header.name </th> #end for <tr> #for $header in $headerSource.headers: #for $subheader in $header.subheaders: <th> ${subheader.name} </th> #end for #end for </tr> #end if </configfile> </configfiles> <help> **===What it does===** Wraps tabular data in an HTML table for easier viewing. ------ **===Headers===** **Column numbers** - The header will show the order of the columns. **Column names** - The header will show column names if the data file is a specific type of tabular file that has column names in Galaxy (such as *sam* or *taxonomy*). Otherwise, no header will be shown. **Specify headers and subheaders** - This allows custom headers, which can span multiple columns if subheaders are included. For example, the tabular file:: 1 2 3 4 read1 100 12345 50 read2 150 56789 60 ...with the headers and subheaders:: Query ID length Hit gi score ...would create an html table with the format: +----------------+---------------+ | Query | Hit | +-------+--------+-------+-------+ | ID | length | gi | score | +=======+========+=======+=======+ | read1 | 100 | 12345 | 50 | +-------+--------+-------+-------+ | read2 | 150 | 56789 | 60 | +-------+--------+-------+-------+ </help> </tool>