annotate table-union.xml @ 14:1af2524f48b7 tip

planemo upload
author jpayne
date Tue, 30 Oct 2018 16:18:02 -0400
parents 15230438f7f5
children
rev   line source
jpayne@0 1 <tool id="table-union" name="Merge tabular datasets" version="0.1.0">
jpayne@1 2 <description>by combining their rows and unionizing columns</description>
jpayne@0 3 <requirements>
jpayne@12 4 <!-- <requirement type="package" version="3.4">python</requirement> -->
jpayne@0 5 </requirements>
jpayne@0 6 <command detect_errors="exit_code"><![CDATA[
jpayne@14 7 #if $input_type.source_select == 'two'
jpayne@14 8 #set tables=($table_1, $table_2)
jpayne@14 9 #else
jpayne@14 10 #set tables=$input_type.tables
jpayne@14 11 #end if
jpayne@14 12 python $__tool_directory__/table-union.py "$union"
jpayne@0 13 #for $table in $tables
jpayne@0 14 $table
jpayne@0 15 #end for
jpayne@0 16 > $combined_table
jpayne@0 17 ]]></command>
jpayne@0 18 <inputs>
jpayne@14 19 <param name="union" type="boolean" label="Attempt to unionize on an autodetected key column" checked="false" falsevalue="" />
jpayne@14 20 <conditional name="input_type">
jpayne@14 21 <param name="source_select" type="select" label="Mode">
jpayne@14 22 <option value="two">Combine two tables</option>
jpayne@14 23 <option value="collection">Combine a collection of tables</option>
jpayne@14 24 </param>
jpayne@14 25 <when value="collection">
jpayne@14 26 <param name="tables" type="data_collection" format="tabular,tsv" collection_type="list" />
jpayne@14 27 </when>
jpayne@14 28 <when value="two">
jpayne@14 29 <param name="table_1" type="data" format="tabular,tsv" />
jpayne@14 30 <param name="table_2" type="data" format="tabular,tsv" />
jpayne@14 31 </when>
jpayne@14 32 </conditional>
jpayne@0 33 </inputs>
jpayne@0 34 <outputs>
jpayne@0 35 <data name="combined_table" format="tsv" label="Combined table" />
jpayne@0 36 </outputs>
jpayne@0 37
jpayne@0 38 <tests>
jpayne@0 39 <test>
jpayne@14 40 <param name="source_select" value="collection" />
jpayne@14 41 <param name="union" value="true" />
jpayne@0 42 <param name="tables">
jpayne@0 43 <collection type="list">
jpayne@0 44 <element name="1" value="dingbat.tsv" />
jpayne@0 45 <element name="2" value="loki.tsv" />
jpayne@0 46 </collection>
jpayne@0 47 </param>
jpayne@0 48 <output name="combined_table" value="combined.tsv" />
jpayne@0 49 </test>
jpayne@14 50 <test>
jpayne@14 51 <param name="source_select" value="two" />
jpayne@14 52 <param name="union" value="false" />
jpayne@14 53 <param name="table_1" value="dingbat.tsv" />
jpayne@14 54 <param name="table_2" value="loki.tsv" />
jpayne@14 55 <output name="combined_table" value="no_union.tsv" />
jpayne@14 56 </test>
jpayne@0 57 </tests>
jpayne@0 58 <help><![CDATA[
jpayne@0 59 Concatenate a collection of TSV files wile preserving and unionizing headers.
jpayne@0 60 ]]></help>
jpayne@0 61
jpayne@0 62 <citations>
jpayne@0 63 </citations>
jpayne@0 64 </tool>