comparison catWrapper.xml @ 4:7afc0515a307 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/concat_multi_datasets commit 4b572d4605dfc1d5cfe2b46c9f0061d041e63df9
author artbio
date Tue, 18 Jun 2019 11:59:06 -0400
parents 62aebaf6cfa0
children 99a5ed06b86c
comparison
equal deleted inserted replaced
3:62aebaf6cfa0 4:7afc0515a307
1 <tool id="cat_multi_datasets" name="Concatenate multiple datasets" version="1.2.0"> 1 <tool id="cat_multi_datasets" name="Concatenate multiple datasets" version="1.3.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
12 #for $file in $global_condition.inputs 11 #for $file in $global_condition.inputs
13 '$file' 12 #if $file.ext[-2:] == "gz":
13 gzip -dc '$file' | $concat_command | gzip -c >> '$out_file1' &&
14 #else:
15 $concat_command '$file' >> '$out_file1' &&
16 #end if
14 #end for 17 #end for
15 > '$out_file1' 18 sleep 1
16 #else: 19 #else:
17 #for $file in $global_condition.inputs 20 #for $file in $global_condition.inputs
18 #if $file.ext[-2:] == "gz": 21 #if $file.ext[-2:] == "gz":
19 printf "# ${file.element_identifier}\n" | gzip -c >> '$out_file1' && 22 printf "# ${file.element_identifier}\n" | gzip -c >> '$out_file1' &&
20 gzip -dc "$file" | $concat_command |gzip -c >> '$out_file1' && 23 gzip -dc "$file" | $concat_command |gzip -c >> '$out_file1' &&
24 #end if 27 #end if
25 #end for 28 #end for
26 sleep 1 29 sleep 1
27 #end if 30 #end if
28 #else if $global_condition.input_type == "simple_collections": 31 #else if $global_condition.input_type == "simple_collections":
29 #if $global_condition.collections_condition.collection_cat_type == "two_collections":
30 mkdir concatenated && 32 mkdir concatenated &&
31 #if $dataset_names == "No": 33 #if $dataset_names == "No":
32 #for $x, $y in zip($global_condition.collections_condition.input_1, $global_condition.collections_condition.input_2) 34 #for $x, $y in zip($global_condition.input_1, $global_condition.input_2):
33 $concat_command '$x' '$y' > concatenated/'${x.element_identifier}.listed.${x.ext}.listed' && 35 #if $x.ext[-2:] == "gz":
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
34 #end for 41 #end for
35 sleep 1 42 sleep 1
36 #else: 43 #else:
37 #for $x, $y in zip($global_condition.collections_condition.input_1, $global_condition.collections_condition.input_2) 44 #for $x, $y in zip($global_condition.input_1, $global_condition.input_2)
38 #if $x.ext[-2:] == "gz": 45 #if $x.ext[-2:] == "gz":
39 printf "# ${x.element_identifier}\n" | gzip -c > concatenated/'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed' && 46 printf "# ${x.element_identifier}\n" | 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' && 47 gzip -dc '$x' | $concat_command | 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' && 48 printf "# ${y.element_identifier}\n" | 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' && 49 gzip -dc '$y' | $concat_command | gzip -c >> 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' && 54 $concat_command '$y' >> concatenated/'${x.element_identifier}_${y.element_identifier}.listed.${x.ext}.listed' &&
48 #end if 55 #end if
49 #end for 56 #end for
50 sleep 1 57 sleep 1
51 #end if 58 #end if
52 #end if
53 #else if $global_condition.input_type == "paired_collection": 59 #else if $global_condition.input_type == "paired_collection":
54 #if $global_condition.paired_cat_type == "by_strand": 60 #if $global_condition.paired_cat_type == "by_strand":
61 mkdir concatenated &&
55 #if $dataset_names == "No": 62 #if $dataset_names == "No":
56 #for $file in $global_condition.inputs 63 #for $file in $global_condition.inputs
57 $concat_command 64 #if $file['forward'].ext[-2:] == "gz":
58 $file['forward'] 65 gzip -dc $file['forward'] | $concat_command | gzip -c >> concatenated/forward.listed.${file['forward'].ext}.listed &&
59 >> '$forward' && 66 gzip -dc $file['reverse'] | $concat_command | gzip -c >> concatenated/reverse.listed.${file['reverse'].ext}.listed &&
60 $concat_command 67 #else:
61 $file['reverse'] 68 $concat_command $file['forward'] >> concatenated/forward.listed.${file['forward'].ext}.listed &&
62 >> '$reverse' && 69 $concat_command $file['reverse'] >> concatenated/reverse.listed.${file['reverse'].ext}.listed &&
70 #end if
63 #end for 71 #end for
64 sleep 1 72 sleep 1
65 #else: 73 #else:
66 #for $file in $global_condition.inputs.keys() 74 #for $file in $global_condition.inputs.keys():
67 printf "# ${file}_forward\n" >> '$forward' && 75 #if $global_condition.inputs[$file]['forward'].ext[-2:] == "gz":
68 $concat_command 76 printf "# ${file}_forward\n" | gzip -c >> concatenated/forward.listed.${global_condition.inputs[$file]['forward'].ext}.listed &&
69 $global_condition.inputs[$file]['forward'] 77 gzip -dc $global_condition.inputs[$file]['forward'] | $concat_command | gzip -c >> concatenated/forward.listed.${global_condition.inputs[$file]['forward'].ext}.listed &&
70 >> '$forward' && 78 printf "# ${file}_reverse\n" | gzip -c >> concatenated/reverse.listed.${global_condition.inputs[$file]['reverse'].ext}.listed &&
71 printf "# ${file}_reverse\n" >> '$reverse' && 79 gzip -dc $global_condition.inputs[$file]['reverse'] | $concat_command | gzip -c >> concatenated/reverse.listed.${global_condition.inputs[$file]['reverse'].ext}.listed &&
72 $concat_command 80 #else:
73 $global_condition.inputs[$file]['reverse'] 81 printf "# ${file}_forward\n" >> concatenated/forward.listed.${global_condition.inputs[$file]['forward'].ext}.listed &&
74 >> '$reverse' && 82 $concat_command $global_condition.inputs[$file]['forward'] >> concatenated/forward.listed.${global_condition.inputs[$file]['forward'].ext}.listed &&
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
75 #end for 86 #end for
76 sleep 1 87 sleep 1
77 #end if 88 #end if
78 #else if $global_condition.paired_cat_type == "by_pair": 89 #else if $global_condition.paired_cat_type == "by_pair":
79 mkdir concatenated && 90 mkdir concatenated &&
80 #if $dataset_names == "No": 91 #if $dataset_names == "No":
81 #for $file in $global_condition.inputs.keys() 92 #for $file in $global_condition.inputs.keys():
82 $concat_command 93 #if $global_condition.inputs[$file]['forward'].ext[-2:] == "gz":
83 $global_condition.inputs[$file]['forward'] 94 gzip -dc $global_condition.inputs[$file]['forward'] | $concat_command | gzip -c
84 > concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' && 95 > concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
85 $concat_command 96 gzip -dc $global_condition.inputs[$file]['reverse'] | $concat_command | gzip -c
86 $global_condition.inputs[$file]['reverse'] 97 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
87 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' && 98 #else:
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
88 #end for 104 #end for
89 sleep 1 105 sleep 1
90 #else: 106 #else:
91 #for $file in $global_condition.inputs.keys() 107 #for $file in $global_condition.inputs.keys():
92 printf "# ${file}_forward\n" > concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' && 108 #if $global_condition.inputs[$file]['reverse'].ext[-2:] == "gz":
93 $concat_command 109 printf "# ${file}_forward\n" | gzip -c > concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
94 $global_condition.inputs[$file]['forward'] 110 gzip -dc $global_condition.inputs[$file]['forward'] | $concat_command | gzip -c
95 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' && 111 >> 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' && 112 printf "# ${file}_reverse\n" | gzip -c >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
97 $concat_command 113 gzip -dc $global_condition.inputs[$file]['reverse'] | $concat_command | gzip -c
98 $global_condition.inputs[$file]['reverse'] 114 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' &&
99 >> concatenated/'${file}.listed.${global_condition.inputs[$file]['reverse'].ext}.listed' && 115 #else:
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
100 #end for 123 #end for
101 sleep 1 124 sleep 1
102 #end if 125 #end if
103 #else if $global_condition.paired_cat_type == "all": 126 #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
104 #if $dataset_names == "No": 130 #if $dataset_names == "No":
105 #for $file in $global_condition.inputs.keys() 131 #for $file in $global_condition.inputs.keys():
106 $concat_command 132 #if $global_condition.inputs[$file]['forward'].ext[-2:] == "gz":
107 $global_condition.inputs[$file]['forward'] 133 gzip -dc $global_condition.inputs[$file]['forward'] | $concat_command | gzip -c >> c'$paired_out_file' &&
108 >> $out_file1 && 134 gzip -dc $global_condition.inputs[$file]['reverse'] | $concat_command | gzip -c >> '$paired_out_file' &&
109 $concat_command 135 #else:
110 $global_condition.inputs[$file]['reverse'] 136 $concat_command
111 >> $out_file1 && 137 $global_condition.inputs[$file]['forward']
138 >> '$paired_out_file' &&
139 $concat_command
140 $global_condition.inputs[$file]['reverse']
141 >> '$paired_out_file' &&
142 #end if
112 #end for 143 #end for
113 sleep 1 144 sleep 1
114 #else: 145 #else:
115 #for $file in $global_condition.inputs.keys() 146 #for $file in $global_condition.inputs.keys():
116 printf "# ${file}_forward\n" > $out_file1 && 147 #if $global_condition.inputs[$file]['forward'].ext[-2:] == "gz":
117 $concat_command 148 printf "# ${file}_forward\n" | gzip -c > '$paired_out_file' &&
118 $global_condition.inputs[$file]['forward'] 149 gzip -dc $global_condition.inputs[$file]['forward'] | $concat_command | gzip -c >> '$paired_out_file' &&
119 >> $out_file1 && 150 printf "# ${file}_reverse\n" | gzip -c >> '$paired_out_file' &&
120 printf "# ${file}_reverse\n" >> $out_file1 && 151 gzip -dc $global_condition.inputs[$file]['reverse'] | $concat_command | gzip -c >> '$paired_out_file' &&
121 $concat_command 152 #else:
122 $global_condition.inputs[$file]['reverse'] 153 printf "# ${file}_forward\n" > '$paired_out_file' &&
123 >> $out_file1 && 154 $concat_command
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
124 #end for 162 #end for
125 sleep 1 163 sleep 1
126 #end if 164 #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
127 #end if 194 #end if
128 #end if 195 #end if
129 ]]> 196 ]]>
130 </command> 197 </command>
131 <inputs> 198 <inputs>
132 <conditional name="global_condition"> 199 <conditional name="global_condition">
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"> 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">
134 <option value="singles">Single datasets</option> 201 <option value="singles">Single datasets</option>
135 <option value="simple_collections">Collections</option> 202 <option value="simple_collections">2 Collections</option>
136 <option value="paired_collection">Paired collection</option> 203 <option value="paired_collection">Paired collection</option>
204 <option value="nested_collection">Nested collection</option>
137 </param> 205 </param>
138 <when value="singles"> 206 <when value="singles">
139 <param name="inputs" type="data" label="Concatenate Datasets" multiple="True" help="All inputed datasets will be concatenated tail-to-head."/> 207 <param name="inputs" type="data" label="Concatenate Datasets" multiple="True" help="All inputed datasets will be concatenated tail-to-head."/>
140 </when> 208 </when>
141 <when value="paired_collection"> 209 <when value="paired_collection">
145 <option value="by_pair">Concatenate pairs of datasets (outputs an unpaired collection of datasets)</option> 213 <option value="by_pair">Concatenate pairs of datasets (outputs an unpaired collection of datasets)</option>
146 <option value="all">Concatenate all datasets into a single file regardless of strand (outputs a single file)</option> 214 <option value="all">Concatenate all datasets into a single file regardless of strand (outputs a single file)</option>
147 </param> 215 </param>
148 </when> 216 </when>
149 <when value="simple_collections"> 217 <when value="simple_collections">
150 <conditional name="collections_condition"> 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" />
151 <param name="collection_cat_type" type="select" label="What type of concatenation do you wish to perform?"> 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" />
152 <option value="two_collections">Concatenate datasets of 2 collections (outputs a simple collection)</option> 220 </when>
153 </param> 221 <when value="nested_collection">
154 <when value="two_collections"> 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." />
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>
159 </when> 223 </when>
160 </conditional> 224 </conditional>
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."/> 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."/>
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."/> 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."/>
163 </inputs> 227 </inputs>
164 <outputs> 228 <outputs>
165 <data name="out_file1" format_source="inputs" metadata_source="inputs" label="Concatenated datasets"> 229 <data name="out_file1" format_source="inputs" metadata_source="inputs" label="Concatenated datasets">
166 <filter>global_condition['input_type'] == 'singles' or (global_condition['input_type'] == 'paired_collection' and global_condition['paired_cat_type'] == 'all')</filter> 230 <filter>global_condition['input_type'] == 'singles'</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>
167 </data> 234 </data>
168 <collection name="paired_output" type="paired" label="Concatenation by strtand"> 235 <collection name="paired_output" type="paired" label="Concatenation by strtand">
169 <data name="forward" /> 236 <discover_datasets pattern="(?P&lt;name&gt;.*)\.listed\.(?P&lt;ext&gt;.*)\.listed" visible="false" directory="concatenated"/>
170 <data name="reverse" />
171 <filter>global_condition['input_type'] == 'paired_collection' and global_condition['paired_cat_type'] == 'by_strand'</filter> 237 <filter>global_condition['input_type'] == 'paired_collection' and global_condition['paired_cat_type'] == 'by_strand'</filter>
172 </collection> 238 </collection>
173 <collection name="list_output" type="list" label="Concatenation by pairs"> 239 <collection name="list_output" type="list" label="Concatenation by pairs">
174 <discover_datasets pattern="(?P&lt;name&gt;.*)\.listed\.(?P&lt;ext&gt;.*)\.listed" visible="false" directory="concatenated"/> 240 <discover_datasets pattern="(?P&lt;identifier_0&gt;.*)\.listed\.(?P&lt;ext&gt;.*)\.listed" visible="false" directory="concatenated"/>
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> 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>
176 </collection> 242 </collection>
177 </outputs> 243 </outputs>
178 <tests> 244 <tests>
179 <!-- Single files concatenation --> 245 <!-- Single files concatenation -->
180 <test> <!-- Test 2 single files concatenation with no other option --> 246 <test> <!-- Test 2 single files concatenation with no other option -->
320 <param name="headers" value="4" /> 386 <param name="headers" value="4" />
321 <output_collection name="list_output" type="list" count="1" > 387 <output_collection name="list_output" type="list" count="1" >
322 <element name="1_f.fastq_1_r.fastq" file="1_options.fastq.gz" decompress="True"/> 388 <element name="1_f.fastq_1_r.fastq" file="1_options.fastq.gz" decompress="True"/>
323 </output_collection> 389 </output_collection>
324 </test> 390 </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>
325 </tests> 433 </tests>
326 <help> 434 <help>
327 435
328 .. class:: warningmark 436 .. class:: warningmark
329 437
330 **WARNING:** This tool does not check if the datasets being concatenated are in the same format. 438 **WARNING:** This tool does not check if the datasets being concatenated are in the same format.
331 439
332 **WARNING:** The paired collection operations do not handle gziped files.
333
334 **WARNING:** When concatenating 2 collections make sure the first collection is the one with the most items. 440 **WARNING:** When concatenating 2 collections make sure the first collection is the one with the most items.
335 441
442 **WARNING:** This tool can't handle nested collection deeper than list:list.
443
336 ----- 444 -----
337 445
338 **What it does** 446 **What it does**
339 447
340 Concatenates datasets and paired collections with multiple options: 448 Concatenates datasets and paired collections with multiple options:
346 - concatenation by pair : forward - reverse dataset pairs are concatenated and a simple dataset collection is returned 454 - concatenation by pair : forward - reverse dataset pairs are concatenated and a simple dataset collection is returned
347 455
348 - whole collection concatenation : all datasets in the collection are concatenated and a single dataset is returned 456 - whole collection concatenation : all datasets in the collection are concatenated and a single dataset is returned
349 457
350 - When the inputs are 2 collections: datasets are concatenated in a pairwise combination and a single dataset collection is returned 458 - 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
351 461
352 - Skipping lines before concatenation to avoid headers 462 - Skipping lines before concatenation to avoid headers
353 463
354 - Add the name of the concatenated files as separator 464 - Add the name of the concatenated files as separator
355 465
454 564
455 1 dataset 565 1 dataset
456 566
457 ----- 567 -----
458 568
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
459 **When selecting "Include dataset names" when concatenating files**: 595 **When selecting "Include dataset names" when concatenating files**:
460 596
461 1rst file name="first_tabular":: 597 1rst file name="first_tabular"::
462 598
463 chrX 151087187 151087355 A 0 - 599 chrX 151087187 151087355 A 0 -