Mercurial > repos > jpayne > tableops
comparison table-union.xml @ 0:402b58f45844 draft default tip
planemo upload commit 9cc4dc1db55299bf92ec6bd359161ece4592bd16-dirty
| author | jpayne |
|---|---|
| date | Mon, 08 Dec 2025 15:03:06 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:402b58f45844 |
|---|---|
| 1 <tool id="table-union" name="Table Union: Merge tabular datasets" version="0.1.0"> | |
| 2 <description>by combining their rows and unionizing columns</description> | |
| 3 <requirements> | |
| 4 <container type="docker">cfsanbiostatistics/tableops:latest</container> | |
| 5 </requirements> | |
| 6 <command detect_errors="exit_code"><![CDATA[ | |
| 7 #if $input_type.source_select == 'two' | |
| 8 #set tables=($table_1, $table_2) | |
| 9 #else | |
| 10 #set tables=$input_type.tables | |
| 11 #end if | |
| 12 python $__tool_directory__/table-union.py $adv.union $adv.tuple_mode | |
| 13 #for $table in $tables | |
| 14 $table | |
| 15 #end for | |
| 16 > $combined_table | |
| 17 ]]></command> | |
| 18 <inputs> | |
| 19 <conditional name="input_type"> | |
| 20 <param name="source_select" type="select" label="Mode"> | |
| 21 <option value="two">Combine two tables</option> | |
| 22 <option value="collection">Combine a collection of tables</option> | |
| 23 </param> | |
| 24 <when value="collection"> | |
| 25 <param name="tables" type="data_collection" format="tabular,tsv" collection_type="list" optional="true" /> | |
| 26 </when> | |
| 27 <when value="two"> | |
| 28 <param name="table_1" type="data" format="tabular,tsv" optional="true" /> | |
| 29 <param name="table_2" type="data" format="tabular,tsv" optional="true"/> | |
| 30 </when> | |
| 31 </conditional> | |
| 32 <!-- Advanced options, click to show --> | |
| 33 <section name="adv" title="Advanced options"> | |
| 34 <param name="union" type="boolean" label="Attempt to unionize on an autodetected key column" checked="false" truevalue="--unionize" falsevalue="" /> | |
| 35 <param name="tuple_mode" type="boolean" label="For tables with inconsistent headers - unionize by column order instead of column " checked="false" truevalue="--tuple" falsevalue="" /> | |
| 36 </section> | |
| 37 </inputs> | |
| 38 <outputs> | |
| 39 <data name="combined_table" format="tsv" label="Combined table" /> | |
| 40 </outputs> | |
| 41 | |
| 42 <tests> | |
| 43 <test> | |
| 44 <conditional name="input_type"> | |
| 45 <param name="source_select" value="collection" /> | |
| 46 | |
| 47 <param name="tables"> | |
| 48 <collection type="list"> | |
| 49 <element name="table_1" value="dingbat.tsv" /> | |
| 50 <element name="table_2" value="loki.tsv" /> | |
| 51 </collection> | |
| 52 </param> | |
| 53 </conditional> | |
| 54 <section name="adv"> | |
| 55 <param name="union" value="true" /> | |
| 56 </section> | |
| 57 <output name="combined_table" value="combined.tsv" /> | |
| 58 </test> | |
| 59 <test> | |
| 60 <conditional name="input_type"> | |
| 61 <param name="source_select" value="two" /> | |
| 62 | |
| 63 <param name="table_1" value="dingbat.tsv" /> | |
| 64 <param name="table_2" value="loki.tsv" /> | |
| 65 </conditional> | |
| 66 <section name="adv"> | |
| 67 <param name="union" value="false" /> | |
| 68 </section> | |
| 69 <output name="combined_table" value="no_union.tsv" /> | |
| 70 </test> | |
| 71 <test> | |
| 72 <conditional name="input_type"> | |
| 73 <param name="source_select" value="two" /> | |
| 74 | |
| 75 <param name="table_1" value="dingbat.tsv" /> | |
| 76 <param name="table_2" value="loki.tsv" /> | |
| 77 </conditional> | |
| 78 <section name="adv"> | |
| 79 <param name="tuple_mode" value="true" /> | |
| 80 </section> | |
| 81 <output name="combined_table" value="tuple.tsv" /> | |
| 82 </test> | |
| 83 </tests> | |
| 84 <help><![CDATA[ | |
| 85 Concatenate a collection of TSV files wile preserving and unionizing headers. | |
| 86 ]]></help> | |
| 87 | |
| 88 <citations> | |
| 89 <citation type="bibtex"> | |
| 90 @misc{githubsometool, | |
| 91 author = {Payne, Justin}, | |
| 92 year = {2022}, | |
| 93 title = {tableops}, | |
| 94 publisher = {GitHub}, | |
| 95 journal = {GitHub repository}, | |
| 96 url = {https://github.com/CFSAN-Biostatistics/table-ops}, | |
| 97 }</citation> | |
| 98 </citations> | |
| 99 </tool> |
