|
| 1 | +<tool id="__NEST__" |
| 2 | + name="Nest collection" |
| 3 | + version="1.0.0" |
| 4 | + tool_type="nest_collection"> |
| 5 | + <description></description> |
| 6 | + <type class="NestTool" module="galaxy.tools" /> |
| 7 | + <action module="galaxy.tools.actions.model_operations" |
| 8 | + class="ModelOperationToolAction"/> |
| 9 | + <edam_operations> |
| 10 | + <edam_operation>operation_2409</edam_operation> |
| 11 | + </edam_operations> |
| 12 | + <macros> |
| 13 | + <import>model_operation_macros.xml</import> |
| 14 | + </macros> |
| 15 | + <inputs> |
| 16 | + <param type="data_collection" collection_type="list,paired" name="input" label="Input Collection" /> |
| 17 | + </inputs> |
| 18 | + <outputs> |
| 19 | + <collection name="output" format_source="input" type="list:list" label="${on_string} (flattened)" > |
| 20 | + </collection> |
| 21 | + </outputs> |
| 22 | + <tests> |
| 23 | + <test> |
| 24 | + <param name="input"> |
| 25 | + <collection type="list"> |
| 26 | + <element name="sample1" value="simple_line.txt"/> |
| 27 | + <element name="sample2" value="simple_line_alternative.txt"/> |
| 28 | + </collection> |
| 29 | + </param> |
| 30 | + <output_collection name="output" type="list:list"> |
| 31 | + <element name="sample1"> |
| 32 | + <element name="sample1"> |
| 33 | + <expand macro="assert_is_simple_line" /> |
| 34 | + </element> |
| 35 | + </element> |
| 36 | + <element name="sample2"> |
| 37 | + <element name="sample2"> |
| 38 | + <expand macro="assert_is_simple_line_alt" /> |
| 39 | + </element> |
| 40 | + </element> |
| 41 | + </output_collection> |
| 42 | + </test> |
| 43 | + <test> |
| 44 | + <param name="input"> |
| 45 | + <collection type="list:paired"> |
| 46 | + <element name="sample1"> |
| 47 | + <collection type="paired"> |
| 48 | + <element name="forward" value="simple_line.txt" /> |
| 49 | + <element name="reverse" value="simple_line.txt" /> |
| 50 | + </collection> |
| 51 | + </element> |
| 52 | + <element name="sample2"> |
| 53 | + <collection type="paired"> |
| 54 | + <element name="forward" value="simple_line_alternative.txt" /> |
| 55 | + <element name="reverse" value="simple_line_alternative.txt" /> |
| 56 | + </collection> |
| 57 | + </element> |
| 58 | + </collection> |
| 59 | + </param> |
| 60 | + <output_collection name="output" type="list:list" count="2"> |
| 61 | + <element name="sample1" count="1"> |
| 62 | + <element name="sample1"> |
| 63 | + <element name="forward"> |
| 64 | + <expand macro="assert_is_simple_line" /> |
| 65 | + </element> |
| 66 | + <element name="reverse"> |
| 67 | + <expand macro="assert_is_simple_line" /> |
| 68 | + </element> |
| 69 | + </element> |
| 70 | + </element> |
| 71 | + <element name="sample2" count="1"> |
| 72 | + <element name="sample2"> |
| 73 | + <element name="forward"> |
| 74 | + <expand macro="assert_is_simple_line_alt" /> |
| 75 | + </element> |
| 76 | + <element name="reverse"> |
| 77 | + <expand macro="assert_is_simple_line_alt" /> |
| 78 | + </element> |
| 79 | + </element> |
| 80 | + </element> |
| 81 | + </output_collection> |
| 82 | + </test> |
| 83 | + </tests> |
| 84 | + <help><![CDATA[ |
| 85 | +
|
| 86 | +======== |
| 87 | +Synopsis |
| 88 | +======== |
| 89 | +
|
| 90 | +Nest a collection, i.e. add a nesting level to a collection. |
| 91 | +
|
| 92 | +=========== |
| 93 | +Description |
| 94 | +=========== |
| 95 | +
|
| 96 | +This tool takes a collection and creates a collection of collections where the top level elements are lists each containing one element of the input collection. |
| 97 | +For instance, for a simple list (of datasets) the tool will produce a list of lists where the inner lists each contain one of the datasets. |
| 98 | +
|
| 99 | +.. image:: ${static_path}/images/tools/collection_ops/nest.svg |
| 100 | + :width: 500 |
| 101 | + :alt: Nest operation |
| 102 | +
|
| 103 | +======= |
| 104 | +Purpose |
| 105 | +======= |
| 106 | +
|
| 107 | +Assume a tool processes an item of type X (where X can be a dataset, a dataset pair, a collection). Galaxy also allows to input a collection of items of type X. |
| 108 | +In this case Galaxy will map-over the elements of the collection, i.e. create separete jobs (each processing one item of type X). |
| 109 | +If X is a list (of datasets, pairs, or lists) then one needs to add an extra nesting level to the collection, such that Galaxy maps-over the elements of X instead |
| 110 | +of processing the elements of X jointly. |
| 111 | +
|
| 112 | +---- |
| 113 | +
|
| 114 | +.. class:: infomark |
| 115 | +
|
| 116 | +This tool will create new history datasets from your collection but your quota usage will not increase. |
| 117 | +
|
| 118 | + ]]></help> |
| 119 | +</tool> |
0 commit comments