Mercurial > repos > erasmus-medical-center > extract_element_from_collection
comparison extract_element_from_collection.xml @ 0:c46360dcbf3f draft default tip
planemo upload for repository https://github.com/ErasmusMC-Bioinformatics/galaxytools-emc/tree/master/tools/extract_element_from_collection commit 1c4c58018b64ff3531a719e789ce71cb0a1244c5
author | erasmus-medical-center |
---|---|
date | Wed, 13 Dec 2017 10:09:11 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c46360dcbf3f |
---|---|
1 <tool id="extract_element_from_collection" name="Extract Element" version="0.1" profile="16.07"> | |
2 <description>from a collection based on name</description> | |
3 <command detect_errors="aggressive"><![CDATA[ | |
4 echo 'no element with name $elementname found in your collection' > '$output' | |
5 | |
6 && mkdir elementoutputs | |
7 #for $dataset in $input_collection: | |
8 && echo $dataset.element_identifier | |
9 #if $elementname == '' | |
10 && cp $dataset 'elementoutputs/$dataset.element_identifier' | |
11 #elif $dataset.element_identifier == $elementname: | |
12 && cp $dataset '$output' | |
13 #end if | |
14 #end for | |
15 ]]></command> | |
16 <inputs> | |
17 <param name="input_collection" type="data_collection" collection_type="list" label="Input Collection"/> | |
18 <!-- find a way to make a select from all elements? --> | |
19 <param name="elementname" type="text" value="" label="name of collection element to extract" help="if left blank, all files will be extracted"/> | |
20 </inputs> | |
21 <outputs> | |
22 <data name="output" format="auto" label="${elementname}"> | |
23 <filter>elementname != ''</filter> | |
24 </data> | |
25 <data format="auto" name="extracted"> | |
26 <discover_datasets pattern="(?P<designation>.+)" directory="elementoutputs" visible="true" assign_primary_output="true"/> | |
27 <filter>elementname == ''</filter> | |
28 </data> | |
29 </outputs> | |
30 <tests> | |
31 <test><!-- test with valid element --> | |
32 <param name="input_collection"> | |
33 <collection type="list"> | |
34 <element name="element1" value="example.mothur.shared" /> | |
35 <element name="element2" value="multisample.taxonomy" /> | |
36 </collection> | |
37 </param> | |
38 <param name="elementname" value="element2"/> | |
39 <output name="output" file="multisample.taxonomy"/> | |
40 </test> | |
41 <test><!-- test with invalid element --> | |
42 <param name="input_collection"> | |
43 <collection type="list"> | |
44 <element name="element1" value="example.mothur.shared" /> | |
45 <element name="element2" value="multisample.taxonomy" /> | |
46 </collection> | |
47 </param> | |
48 <param name="elementname" value="element3"/> | |
49 <output name="output"> | |
50 <assert_contents> | |
51 <has_text text="no element with name"/> | |
52 </assert_contents> | |
53 </output> | |
54 </test> | |
55 </tests> | |
56 <help><![CDATA[ | |
57 **What it does** | |
58 extract a dataset from a collection based on name | |
59 ]]></help> | |
60 <citations> | |
61 </citations> | |
62 </tool> |