Mercurial > repos > sanbi-uwc > list_elements
changeset 0:6947d02e946b draft
planemo upload
author | sanbi-uwc |
---|---|
date | Mon, 11 Jul 2022 14:26:27 +0000 |
parents | |
children | 1c908001bfcd |
files | list_elements.xml test-data/one.txt test-data/output.txt test-data/two.txt |
diffstat | 4 files changed, 38 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/list_elements.xml Mon Jul 11 14:26:27 2022 +0000 @@ -0,0 +1,34 @@ +<tool id="list_elements" name="List elements of collection" version="0.1.0+galaxy0" profile="21.05"> + <requirements> + </requirements> + <command detect_errors="exit_code"><![CDATA[ + #set $last_element = len(list($coll)) - 1 + #for $i, $element in enumerate($coll) + echo '${element.name}' >> ${output1} + #if $i != $last_element + && + #end if + #end for + ]]></command> + <inputs> + <param name="coll" type="data_collection" collection_type="list" label="Dataset collection"/> + </inputs> + <outputs> + <data name="output1" format="txt" label="Collection names ${on_string}" /> + </outputs> + <tests> + <test> + <param name="coll"> + <collection type="list"> + <element name="one" value="one.txt" ftype="txt" /> + <element name="two" value="two.txt" ftype="txt" /> + </collection> + </param> + <output name="output1" file="output.txt" /> + </test> + </tests> + <help><![CDATA[ + Outputs the names of the elements of a collection (of list type). + ]]></help> + <citations></citations> +</tool> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/one.txt Mon Jul 11 14:26:27 2022 +0000 @@ -0,0 +1,1 @@ +one