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