comparison catWrapper.xml @ 5:99a5ed06b86c draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/concat_multi_datasets commit 494d583f425daec963ccd02907718e02d5d66b58
author artbio
date Mon, 24 Jun 2019 03:58:52 -0400
parents 7afc0515a307
children 4554fa330d3d
comparison
equal deleted inserted replaced
4:7afc0515a307 5:99a5ed06b86c
1 <tool id="cat_multi_datasets" name="Concatenate multiple datasets" version="1.3.0"> 1 <tool id="cat_multi_datasets" name="Concatenate multiple datasets" version="1.2.0">
2 <description>tail-to-head by specifying how</description> 2 <description>tail-to-head by specifying how</description>
3 <command><![CDATA[ 3 <command><![CDATA[
4 #if $headers == 0: 4 #if $headers == 0:
5 #set $concat_command = "cat" 5 #set $concat_command = "cat"
6 #else: 6 #else:
7 #set $concat_command = 'tail -q -n +'+ str(int($headers)+1) 7 #set $concat_command = 'tail -q -n +'+ str(int($headers)+1)
8 #end if 8 #end if
9 #if $global_condition.input_type == "singles": 9 #if $global_condition.input_type == "singles":
10 #if $dataset_names == "No": 10 #if $dataset_names == "No":
11 $concat_command
11 #for $file in $global_condition.inputs 12 #for $file in $global_condition.inputs
12 #if $file.ext[-2:] == "gz": 13 '$file'
13 gzip -dc '$file' | $concat_command | gzip -c >> '$out_file1' &&
14 #else:
15 $concat_command '$file' >> '$out_file1' &&
16 #end if
17 #end for 14 #end for
18 sleep 1 15 > '$out_file1'
19 #else: 16 #else:
20 #for $file in $global_condition.inputs 17 #for $file in $global_condition.inputs
21 #if $file.ext[-2:] == "gz": 18 #if $file.ext[-2:] == "gz":
22 printf "# ${file.element_identifier}\n" | gzip -c >> '$out_file1' && 19 printf "# ${file.element_identifier}\n" | gzip -c >> '$out_file1' &&
23 gzip -dc "$file" | $concat_command |gzip -c >> '$out_file1' && 20 gzip -dc "$file" | $concat_command |gzip -c >> '$out_file1' &&
27 #end if 24 #end if
28 #end for 25 #end for
29 sleep 1 26 sleep 1
30 #end if 27 #end if
31 #else if $global_condition.input_type == "simple_collections": 28 #else if $global_condition.input_type == "simple_collections":
29 #if $global_condition.collections_condition.collection_cat_type == "two_collections":
32 mkdir concatenated && 30 mkdir concatenated &&
33 #if $dataset_names == "No": 31 #if $dataset_names == "No":
34 #for $x, $y in zip($global_condition.input_1, $global_condition.input_2): 32 #for $x, $y in zip($global_condition.collections_condition.input_1, $global_condition.collections_condition.input_2)
35 #if $x.ext[-2:] == "gz": 33 $concat_command '$x' '$y' > concatenated/'${x.element_identifier}.listed.${x.ext}.listed' &&
36 gzip -dc '$x' | $concat_command | gzip -c > concatenated/'${x.element_identifier}.listed.${x.ext}.listed' &&
37 gzip -dc '$y' | $concat_command | gzip -c >> concatenated/'${x.element_identifier}.listed.${x.ext}.listed' &&
38 #else:
39 $concat_command '$x' '$y' > concatenated/'${x.element_identifier}.listed.${x.ext}.listed' &&
40 #end if
41 #end for 34 #end for
42 sleep 1 35 sleep 1
43 #else: 36 #else:
44 #for $x, $y in zip($global_condition.input_1, $global_condition.input_2) 37 #for $x, $y in zip($global_condition.collections_condition.input_1, $global_condition.collections_condition.input_2)
45 #if $x.ext[-2:] == "gz": 38 #if $x.ext[-2:] == "gz":
46 printf "# ${x.element_identifier}\n" | gzip -c > concatenated/'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed' && 39 printf "# ${x.element_identifier}\n" | gzip -c > concatenated/'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed' &&
47 gzip -dc '$x' | $concat_command | gzip -c >> concatenated/'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed' && 40 gzip -dc '$x' | $concat_command | gzip -c >> concatenated/'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed' &&
48 printf "# ${y.element_identifier}\n" | gzip -c >> concatenated/'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed' && 41 printf "# ${y.element_identifier}\n" | gzip -c >> concatenated/'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed' &&
49 gzip -dc '$y' | $concat_command | gzip -c >> concatenated/'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed' && 42 gzip -dc '$y' | $concat_command | gzip -c >> concatenated/'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed' &&
54 $concat_command '$y' >> concatenated/'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed' && 47 $concat_command '$y' >> concatenated/'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed' &&
55 #end if 48 #end if
56 #end for 49 #end for
57 sleep 1 50 sleep 1
58 #end if 51 #end if
52 #end if
59 #else if $global_condition.input_type == "paired_collection": 53 #else if $global_condition.input_type == "paired_collection":
60 #if $global_condition.paired_cat_type == "by_strand": 54 #if $global_condition.paired_cat_type == "by_strand":
61 mkdir concatenated &&
62 #if $dataset_names == "No": 55 #if $dataset_names == "No":
63 #for $file in $global_condition.inputs 56 #for $file in $global_condition.inputs
64 #if $file['forward'].ext[-2:] == "gz": 57 $concat_command
65 gzip -dc $file['forward'] | $concat_command | gzip -c >> concatenated/forward.listed.${file['forward'].ext}.listed && 58 $file['forward']
66 gzip -dc $file['reverse'] | $concat_command | gzip -c >> concatenated/reverse.listed.${file['reverse'].ext}.listed && 59 >> '$forward' &&
67 #else: 60 $concat_command
68 $concat_command $file['forward'] >> concatenated/forward.listed.${file['forward'].ext}.listed && 61 $file['reverse']
69 $concat_command $file['reverse'] >> concatenated/reverse.listed.${file['reverse'].ext}.listed && 62 >> '$reverse' &&
70 #end if
71 #end for 63 #end for
72 sleep 1 64 sleep 1
73 #else: 65 #else:
74 #for $file in $global_condition.inputs.keys(): 66 #for $file in $global_condition.inputs.keys()
75 #if $global_condition.inputs[$file]['forward'].ext[-2:] == "gz": 67 printf "# ${file}_forward\n" >> '$forward' &&
76 printf "# ${file}_forward\n" | gzip -c >> concatenated/forward.listed.${global_condition.inputs[$file]['forward'].ext}.listed && 68 $concat_command
77 gzip -dc $global_condition.inputs[$file]['forward'] | $concat_command | gzip -c >> concatenated/forward.listed.${global_condition.inputs[$file]['forward'].ext}.listed && 69 $global_condition.inputs[$file]['forward']
78 printf "# ${file}_reverse\n" | gzip -c >> concatenated/reverse.listed.${global_condition.inputs[$file]['reverse'].ext}.listed && 70 >> '$forward' &&
79 gzip -dc $global_condition.inputs[$file]['reverse'] | $concat_command | gzip -c >> concatenated/reverse.listed.${global_condition.inputs[$file]['reverse'].ext}.listed && 71 printf "# ${file}_reverse\n" >> '$reverse' &&
80 #else: 72 $concat_command
81 printf "# ${file}_forward\n" >> concatenated/forward.listed.${global_condition.inputs[$file]['forward'].ext}.listed && 73 $global_condition.inputs[$file]['reverse']
82 $concat_command $global_condition.inputs[$file]['forward'] >> concatenated/forward.listed.${global_condition.inputs[$file]['forward'].ext}.listed && 74 >> '$reverse' &&
83 printf "# ${file}_reverse\n" >> concatenated/reverse.listed.${global_condition.inputs[$file]['reverse'].ext}.listed &&
84 $concat_command $global_condition.inputs[$file]['reverse'] >> concatenated/reverse.listed.${global_condition.inputs[$file]['reverse'].ext}.listed &&
85 #end if
86 #end for 75 #end for
87 sleep 1 76 sleep 1
88 #end if 77 #end if
89 #else if $global_condition.paired_cat_type == "by_pair": 78 #else if $global_condition.paired_cat_type == "by_pair":
90 mkdir concatenated && 79 mkdir concatenated &&
91 #if $dataset_names == "No": 80 #if $dataset_names == "No":
92 #for $file in $global_condition.inputs.keys(): 81 #for $file in $global_condition.inputs.keys()
93 #if $global_condition.inputs[$file]['forward'].ext[-2:] == "gz": 82 $concat_command
94 gzip -dc $global_condition.inputs[$file]['forward'] | $concat_command | gzip -c 83 $global_condition.inputs[$file]['forward']
95 > concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' && 84 > concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
96 gzip -dc $global_condition.inputs[$file]['reverse'] | $concat_command | gzip -c 85 $concat_command
97 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' && 86 $global_condition.inputs[$file]['reverse']
98 #else: 87 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
99 $concat_command $global_condition.inputs[$file]['forward']
100 > concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
101 $concat_command $global_condition.inputs[$file]['reverse']
102 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
103 #end if
104 #end for 88 #end for
105 sleep 1 89 sleep 1
106 #else: 90 #else:
107 #for $file in $global_condition.inputs.keys(): 91 #for $file in $global_condition.inputs.keys()
108 #if $global_condition.inputs[$file]['reverse'].ext[-2:] == "gz": 92 printf "# ${file}_forward\n" > concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
109 printf "# ${file}_forward\n" | gzip -c > concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' && 93 $concat_command
110 gzip -dc $global_condition.inputs[$file]['forward'] | $concat_command | gzip -c 94 $global_condition.inputs[$file]['forward']
111 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' && 95 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
112 printf "# ${file}_reverse\n" | gzip -c >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' && 96 printf "# ${file}_reverse\n" >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
113 gzip -dc $global_condition.inputs[$file]['reverse'] | $concat_command | gzip -c 97 $concat_command
114 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' && 98 $global_condition.inputs[$file]['reverse']
115 #else: 99 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
116 printf "# ${file}_forward\n" > concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
117 $concat_command $global_condition.inputs[$file]['forward']
118 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
119 printf "# ${file}_reverse\n" >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
120 $concat_command $global_condition.inputs[$file]['reverse']
121 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
122 #end if
123 #end for 100 #end for
124 sleep 1 101 sleep 1
125 #end if 102 #end if
126 #else if $global_condition.paired_cat_type == "all": 103 #else if $global_condition.paired_cat_type == "all":
127 mkdir concatenated &&
128 #set $base_name=$global_condition.inputs.element_identifier
129 #set $extention=$global_condition.inputs[$global_condition.inputs.keys()[0]]['forward'].ext
130 #if $dataset_names == "No": 104 #if $dataset_names == "No":
131 #for $file in $global_condition.inputs.keys(): 105 #for $file in $global_condition.inputs.keys()
132 #if $global_condition.inputs[$file]['forward'].ext[-2:] == "gz": 106 $concat_command
133 gzip -dc $global_condition.inputs[$file]['forward'] | $concat_command | gzip -c >> c'$paired_out_file' && 107 $global_condition.inputs[$file]['forward']
134 gzip -dc $global_condition.inputs[$file]['reverse'] | $concat_command | gzip -c >> '$paired_out_file' && 108 >> $out_file1 &&
135 #else: 109 $concat_command
136 $concat_command 110 $global_condition.inputs[$file]['reverse']
137 $global_condition.inputs[$file]['forward'] 111 >> $out_file1 &&
138 >> '$paired_out_file' &&
139 $concat_command
140 $global_condition.inputs[$file]['reverse']
141 >> '$paired_out_file' &&
142 #end if
143 #end for 112 #end for
144 sleep 1 113 sleep 1
145 #else: 114 #else:
146 #for $file in $global_condition.inputs.keys(): 115 #for $file in $global_condition.inputs.keys()
147 #if $global_condition.inputs[$file]['forward'].ext[-2:] == "gz": 116 printf "# ${file}_forward\n" > $out_file1 &&
148 printf "# ${file}_forward\n" | gzip -c > '$paired_out_file' && 117 $concat_command
149 gzip -dc $global_condition.inputs[$file]['forward'] | $concat_command | gzip -c >> '$paired_out_file' && 118 $global_condition.inputs[$file]['forward']
150 printf "# ${file}_reverse\n" | gzip -c >> '$paired_out_file' && 119 >> $out_file1 &&
151 gzip -dc $global_condition.inputs[$file]['reverse'] | $concat_command | gzip -c >> '$paired_out_file' && 120 printf "# ${file}_reverse\n" >> $out_file1 &&
152 #else: 121 $concat_command
153 printf "# ${file}_forward\n" > '$paired_out_file' && 122 $global_condition.inputs[$file]['reverse']
154 $concat_command 123 >> $out_file1 &&
155 $global_condition.inputs[$file]['forward']
156 >> '$paired_out_file' &&
157 printf "# ${file}_reverse\n" >> '$paired_out_file' &&
158 $concat_command
159 $global_condition.inputs[$file]['reverse']
160 >> '$paired_out_file' &&
161 #end if
162 #end for 124 #end for
163 sleep 1 125 sleep 1
164 #end if 126 #end if
165 #end if
166 #else if $global_condition.input_type == "nested_collection":
167 mkdir concatenated &&
168 #if $dataset_names == "No":
169 #for $sub_list in $global_condition.inputs:
170 #set $file_base_name=$sub_list.element_identifier
171 #for $sub_list_element in $sub_list:
172 #if $sub_list_element.ext[-2:] == "gz":
173 gzip -dc ${sub_list_element} | $concat_command | gzip -c >> concatenated/'${file_base_name}.listed.${sub_list_element.ext}.listed' &&
174 #else:
175 $concat_command ${sub_list_element} >> concatenated/'${file_base_name}.listed.${sub_list_element.ext}.listed' &&
176 #end if
177 #end for
178 #end for
179 sleep 1
180 #else:
181 #for $sub_list in $global_condition.inputs:
182 #set $file_base_name=$sub_list.element_identifier
183 #for $sub_list_element in $sub_list:
184 #if $sub_list_element.ext[-2:] == "gz":
185 printf "# ${sub_list_element.element_identifier}\n" | gzip -c >> concatenated/'${file_base_name}.listed.${sub_list_element.ext}.listed' &&
186 gzip -dc ${sub_list_element} | $concat_command | gzip -c >> concatenated/'${file_base_name}.listed.${sub_list_element.ext}.listed' &&
187 #else:
188 printf "# ${sub_list_element.element_identifier}\n" >> concatenated/'${file_base_name}.listed.${sub_list_element.ext}.listed' &&
189 $concat_command ${sub_list_element} >> concatenated/'${file_base_name}.listed.${sub_list_element.ext}.listed' &&
190 #end if
191 #end for
192 #end for
193 sleep 1
194 #end if 127 #end if
195 #end if 128 #end if
196 ]]> 129 ]]>
197 </command> 130 </command>
198 <inputs> 131 <inputs>
199 <conditional name="global_condition"> 132 <conditional name="global_condition">
200 <param name="input_type" type="select" label="What type of data do you wish to concatenate?" help="Depending on the type of input selected the concatenation options will differ"> 133 <param name="input_type" type="select" label="What type of data do you wish to concatenate?" help="Depending on the type of input selected the concatenation options will differ">
201 <option value="singles">Single datasets</option> 134 <option value="singles">Single datasets</option>
202 <option value="simple_collections">2 Collections</option> 135 <option value="simple_collections">Collections</option>
203 <option value="paired_collection">Paired collection</option> 136 <option value="paired_collection">Paired collection</option>
204 <option value="nested_collection">Nested collection</option>
205 </param> 137 </param>
206 <when value="singles"> 138 <when value="singles">
207 <param name="inputs" type="data" label="Concatenate Datasets" multiple="True" help="All inputed datasets will be concatenated tail-to-head."/> 139 <param name="inputs" type="data" label="Concatenate Datasets" multiple="True" help="All inputed datasets will be concatenated tail-to-head."/>
208 </when> 140 </when>
209 <when value="paired_collection"> 141 <when value="paired_collection">
213 <option value="by_pair">Concatenate pairs of datasets (outputs an unpaired collection of datasets)</option> 145 <option value="by_pair">Concatenate pairs of datasets (outputs an unpaired collection of datasets)</option>
214 <option value="all">Concatenate all datasets into a single file regardless of strand (outputs a single file)</option> 146 <option value="all">Concatenate all datasets into a single file regardless of strand (outputs a single file)</option>
215 </param> 147 </param>
216 </when> 148 </when>
217 <when value="simple_collections"> 149 <when value="simple_collections">
218 <param name="input_1" type="data_collection" collection_type="list" label="Input first collection" help="The first collection contains the datasets that will be written first in the concatenated file" /> 150 <conditional name="collections_condition">
219 <param name="input_2" type="data_collection" collection_type="list" label="Input second collection" help="The second collection contains the datasets that will be written last in the concatenated file" /> 151 <param name="collection_cat_type" type="select" label="What type of concatenation do you wish to perform?">
220 </when> 152 <option value="two_collections">Concatenate datasets of 2 collections (outputs a simple collection)</option>
221 <when value="nested_collection"> 153 </param>
222 <param name="inputs" type="data_collection" collection_type="list:list" label="Input nested collection" help="The Nested collection which items you want to concatenate." /> 154 <when value="two_collections">
155 <param name="input_1" type="data_collection" collection_type="list" label="Input first collection" help="The first collection contains the datasets that will be written first in the concatenated file" />
156 <param name="input_2" type="data_collection" collection_type="list" label="Input second collection" help="The second collection contains the datasets that will be written last in the concatenated file" />
157 </when>
158 </conditional>
223 </when> 159 </when>
224 </conditional> 160 </conditional>
225 <param name="dataset_names" type="boolean" label="Include dataset names?" truevalue="Yes" falsevalue="No" checked="false" help="If 'Yes' is selected '#name of dataset' will be added when concatenating."/> 161 <param name="dataset_names" type="boolean" label="Include dataset names?" truevalue="Yes" falsevalue="No" checked="false" help="If 'Yes' is selected '#name of dataset' will be added when concatenating."/>
226 <param name="headers" type="integer" label="Number of lines to skip at the beginning of each concatenation:" value="0" help="This paremeter exists so as to not concatenate comments or headers contained at the start of the files."/> 162 <param name="headers" type="integer" label="Number of lines to skip at the beginning of each concatenation:" value="0" help="This paremeter exists so as to not concatenate comments or headers contained at the start of the files."/>
227 </inputs> 163 </inputs>
228 <outputs> 164 <outputs>
229 <data name="out_file1" format_source="inputs" metadata_source="inputs" label="Concatenated datasets"> 165 <data name="out_file1" format_source="inputs" metadata_source="inputs" label="Concatenated datasets">
230 <filter>global_condition['input_type'] == 'singles'</filter> 166 <filter>global_condition['input_type'] == 'singles' or (global_condition['input_type'] == 'paired_collection' and global_condition['paired_cat_type'] == 'all')</filter>
231 </data>
232 <data name="paired_out_file" label="${global_condition.inputs.element_identifier}" auto_format="true">
233 <filter>global_condition['input_type'] == 'paired_collection' and global_condition['paired_cat_type'] == 'all'</filter>
234 </data> 167 </data>
235 <collection name="paired_output" type="paired" label="Concatenation by strtand"> 168 <collection name="paired_output" type="paired" label="Concatenation by strtand">
236 <discover_datasets pattern="(?P&lt;name&gt;.*)\.listed\.(?P&lt;ext&gt;.*)\.listed" visible="false" directory="concatenated"/> 169 <data name="forward" />
170 <data name="reverse" />
237 <filter>global_condition['input_type'] == 'paired_collection' and global_condition['paired_cat_type'] == 'by_strand'</filter> 171 <filter>global_condition['input_type'] == 'paired_collection' and global_condition['paired_cat_type'] == 'by_strand'</filter>
238 </collection> 172 </collection>
239 <collection name="list_output" type="list" label="Concatenation by pairs"> 173 <collection name="list_output" type="list" label="Concatenation by pairs">
240 <discover_datasets pattern="(?P&lt;identifier_0&gt;.*)\.listed\.(?P&lt;ext&gt;.*)\.listed" visible="false" directory="concatenated"/> 174 <discover_datasets pattern="(?P&lt;name&gt;.*)\.listed\.(?P&lt;ext&gt;.*)\.listed" visible="false" directory="concatenated"/>
241 <filter>(global_condition['input_type'] == 'paired_collection' and global_condition['paired_cat_type'] == 'by_pair') or (global_condition['input_type'] == 'simple_collections') or (global_condition['input_type'] == 'nested_collection')</filter> 175 <filter>(global_condition['input_type'] == 'paired_collection' and global_condition['paired_cat_type'] == 'by_pair') or (global_condition['input_type'] == 'simple_collections' and global_condition['collections_condition']['collection_cat_type'] == 'two_collections')</filter>
242 </collection> 176 </collection>
243 </outputs> 177 </outputs>
244 <tests> 178 <tests>
245 <!-- Single files concatenation --> 179 <!-- Single files concatenation -->
246 <test> <!-- Test 2 single files concatenation with no other option --> 180 <test> <!-- Test 2 single files concatenation with no other option -->
386 <param name="headers" value="4" /> 320 <param name="headers" value="4" />
387 <output_collection name="list_output" type="list" count="1" > 321 <output_collection name="list_output" type="list" count="1" >
388 <element name="1_f.fastq_1_r.fastq" file="1_options.fastq.gz" decompress="True"/> 322 <element name="1_f.fastq_1_r.fastq" file="1_options.fastq.gz" decompress="True"/>
389 </output_collection> 323 </output_collection>
390 </test> 324 </test>
391 <test> <!-- Test nested collections concatenation -->
392 <param name="input_type" value="nested_collection" />
393 <param name="inputs">
394 <collection type="list:list">
395 <element name="2">
396 <collection type="list">
397 <element name="2_f" value="2_f.fastq" ftype="fastq"/>
398 <element name="2_r" value="2_r.fastq" ftype="fastq"/>
399 </collection>
400 </element>
401 <element name="3">
402 <collection type="list">
403 <element name="3" value="3.fastq" ftype="fastq"/>
404 </collection>
405 </element>
406 </collection>
407 </param>
408 <param name="dataset_names" value="No" />
409 <param name="headers" value="0" />
410 <output_collection name="list_output" type="list" count="2" >
411 <element name="2" file="2.fastq"/>
412 <element name="3" file="3.fastq"/>
413 </output_collection>
414 </test>
415 <test> <!-- Test nested collections concatenation with options and gzip-->
416 <param name="input_type" value="nested_collection" />
417 <param name="inputs">
418 <collection type="list:list">
419 <element name="1">
420 <collection type="list">
421 <element name="1_f.fastq" value="1_f.fastq.gz" ftype="fastq.gz"/>
422 <element name="1_r.fastq" value="1_r.fastq.gz" ftype="fastq.gz"/>
423 </collection>
424 </element>
425 </collection>
426 </param>
427 <param name="dataset_names" value="Yes" />
428 <param name="headers" value="4" />
429 <output_collection name="list_output" type="list" count="1" >
430 <element name="1" file="1_options.fastq.gz" decompress="True"/>
431 </output_collection>
432 </test>
433 </tests> 325 </tests>
434 <help> 326 <help>
435 327
436 .. class:: warningmark 328 .. class:: warningmark
437 329
438 **WARNING:** This tool does not check if the datasets being concatenated are in the same format. 330 **WARNING:** This tool does not check if the datasets being concatenated are in the same format.
439 331
332 **WARNING:** The paired collection operations do not handle gziped files.
333
440 **WARNING:** When concatenating 2 collections make sure the first collection is the one with the most items. 334 **WARNING:** When concatenating 2 collections make sure the first collection is the one with the most items.
441 335
442 **WARNING:** This tool can't handle nested collection deeper than list:list.
443
444 ----- 336 -----
445 337
446 **What it does** 338 **What it does**
447 339
448 Concatenates datasets and paired collections with multiple options: 340 Concatenates datasets and paired collections with multiple options:
454 - concatenation by pair : forward - reverse dataset pairs are concatenated and a simple dataset collection is returned 346 - concatenation by pair : forward - reverse dataset pairs are concatenated and a simple dataset collection is returned
455 347
456 - whole collection concatenation : all datasets in the collection are concatenated and a single dataset is returned 348 - whole collection concatenation : all datasets in the collection are concatenated and a single dataset is returned
457 349
458 - When the inputs are 2 collections: datasets are concatenated in a pairwise combination and a single dataset collection is returned 350 - When the inputs are 2 collections: datasets are concatenated in a pairwise combination and a single dataset collection is returned
459
460 - When nested collection concatenation: datasets in each sub-collection are concatenated and a simple dataset collection is returned
461 351
462 - Skipping lines before concatenation to avoid headers 352 - Skipping lines before concatenation to avoid headers
463 353
464 - Add the name of the concatenated files as separator 354 - Add the name of the concatenated files as separator
465 355
564 454
565 1 dataset 455 1 dataset
566 456
567 ----- 457 -----
568 458
569 **Nested collection concatenation example**
570
571 Nested collection:
572
573 - Experiment
574
575 - Sample_1
576
577 - Sample_1_file_1
578 - Sample_1_file_2
579
580 - Sample_2
581
582 - Sample_2_file_1
583 - Sample_2_file_2
584 - Sample_2_file_3
585
586 Concatenation result::
587
588 A single collection containing:
589
590 - Sample_1: (Sample_1_file_1 + Sample_1_file_2)
591 - Sample_2: (Sample_2_file_1 + Sample_2_file_2 + Sample_2_file_3)
592
593 -----
594
595 **When selecting "Include dataset names" when concatenating files**: 459 **When selecting "Include dataset names" when concatenating files**:
596 460
597 1rst file name="first_tabular":: 461 1rst file name="first_tabular"::
598 462
599 chrX 151087187 151087355 A 0 - 463 chrX 151087187 151087355 A 0 -