comparison kmc_tools_simple.xml @ 0:ca2743037241 draft

"planemo upload for repository https://github.com/usegalaxy-au/tools-au/tree/master/tools/kmc commit 29b98036c21809c923a92feb38b736c007d2e303"
author galaxy-australia
date Tue, 27 Sep 2022 05:20:06 +0000
parents
children c7fda6e88567
comparison
equal deleted inserted replaced
-1:000000000000 0:ca2743037241
1 <tool id="kmc_simple" name="KMC simple" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" >
2 <description>simple operations for two input kmer sets</description>
3 <xrefs>
4 <xref type='bio.tools'>kmc</xref>
5 </xrefs>
6 <macros>
7 <import>macros.xml</import>
8 </macros>
9 <expand macro="requirements" />
10 <expand macro="stdio" />
11 <expand macro="version_command" />
12 <command><![CDATA[
13 mkdir outdir &&
14 #for $f in $input_collection_one:
15 #if '.kmc_suf' in str($f.element_identifier)
16 ln -s '${f}' kmers_db_one.kmc_suf &&
17 #else
18 ln -s '${f}' kmers_db_one.kmc_pre &&
19 #end if
20 #end for
21 #for $f in $input_collection_two:
22 #if '.kmc_suf' in str($f.element_identifier)
23 ln -s '${f}' kmers_db_two.kmc_suf &&
24 #else
25 ln -s '${f}' kmers_db_two.kmc_pre &&
26 #end if
27 #end for
28 kmc_tools
29 -t\${GALAXY_SLOTS:-4}
30 simple
31 #if $input_options_cond.input_param == "None":
32 kmers_db_one
33 kmers_db_two
34 #elif $input_options_cond.input_param == "kmc_one_params":
35 kmers_db_one
36 -ci'$input_options_cond.kmc_db_one_param.min_kmer_occurrence'
37 -cx'$input_options_cond.kmc_db_one_param.max_kmer_occurrence'
38 kmers_db_two
39 #elif $input_options_cond.input_param == "kmc_two_params":
40 kmers_db_one
41 kmers_db_two
42 -ci'$input_options_cond.kmc_db_two_param.min_kmer_occurrence'
43 -cx'$input_options_cond.kmc_db_two_param.max_kmer_occurrence'
44 #elif $input_options_cond.input_param == "both_kmc_params":
45 kmers_db_one
46 -ci'$input_options_cond.both_db_one_param.min_kmer_occurrence'
47 -cx'$input_options_cond.both_db_one_param.max_kmer_occurrence'
48 kmers_db_two
49 -ci'$input_options_cond.both_db_two_param.min_kmer_occurrence'
50 -cx'$input_options_cond.both_db_two_param.max_kmer_occurrence'
51 #end if
52 #set $operation_arr=[]
53 #for $i,$opt in enumerate($operations)
54 #silent $operation_arr.append(str($opt.ops.select_operation))
55 #if str($opt.ops.select_operation) == "intersect":
56 $opt.ops.select_operation
57 #if str($opt.ops.add_output_params.oc) != 'None':
58 '${opt.ops.select_operation}_${opt.ops.add_output_params.oc}_db'
59 -oc'$opt.ops.add_output_params.oc'
60 #else
61 '${opt.ops.select_operation}_min_db'
62 -oc'min'
63 #end if
64 #if str($opt.ops.add_output_params.min_kmer_occurrence) != '':
65 -ci'$opt.ops.add_output_params.min_kmer_occurrence'
66 #end if
67 #if str($opt.ops.add_output_params.max_kmer_occurrence) != '':
68 -cx'$opt.ops.add_output_params.max_kmer_occurrence'
69 #end if
70 #elif str($opt.ops.select_operation) == "union":
71 $opt.ops.select_operation
72 #if str($opt.ops.add_output_params.oc) != 'None':
73 '${opt.ops.select_operation}_${opt.ops.add_output_params.oc}_db'
74 -oc'$opt.ops.add_output_params.oc'
75 #else
76 '${opt.ops.select_operation}_sum_db'
77 -oc'sum'
78 #end if
79 #if str($opt.ops.add_output_params.min_kmer_occurrence) != '':
80 -ci'$opt.ops.add_output_params.min_kmer_occurrence'
81 #end if
82 #if str($opt.ops.add_output_params.max_kmer_occurrence) != '':
83 -cx'$opt.ops.add_output_params.max_kmer_occurrence'
84 #end if
85 #elif str($opt.ops.select_operation) == "kmers_subtract":
86 $opt.ops.select_operation
87 ${opt.ops.select_operation}_db
88 #if str($opt.ops.add_output_params.min_kmer_occurrence) != '':
89 -ci'$opt.ops.add_output_params.min_kmer_occurrence'
90 #end if
91 #if str($opt.ops.add_output_params.max_kmer_occurrence) != '':
92 -cx'$opt.ops.add_output_params.max_kmer_occurrence'
93 #end if
94 #elif str($opt.ops.select_operation) == "reverse_kmers_subtract":
95 $opt.ops.select_operation
96 ${opt.ops.select_operation}_db
97 #if str($opt.ops.add_output_params.min_kmer_occurrence) != '':
98 -ci'$opt.ops.add_output_params.min_kmer_occurrence'
99 #end if
100 #if str($opt.ops.add_output_params.max_kmer_occurrence) != '':
101 -cx'$opt.ops.add_output_params.max_kmer_occurrence'
102 #end if
103 #elif str($opt.ops.select_operation) == "counters_subtract":
104 $opt.ops.select_operation
105 #if str($opt.ops.add_output_params.oc) != 'None':
106 '${opt.ops.select_operation}_${opt.ops.add_output_params.oc}_db'
107 -oc'$opt.ops.add_output_params.oc'
108 #else
109 '${opt.ops.select_operation}_min_db'
110 -oc'diff'
111 #end if
112 #if str($opt.ops.add_output_params.min_kmer_occurrence) != '':
113 -ci'$opt.ops.add_output_params.min_kmer_occurrence'
114 #end if
115 #if str($opt.ops.add_output_params.max_kmer_occurrence) != '':
116 -cx'$opt.ops.add_output_params.max_kmer_occurrence'
117 #end if
118 #elif str($opt.ops.select_operation) == "reverse_counters_subtract":
119 $opt.ops.select_operation
120 #if str($opt.ops.add_output_params.oc) != 'None':
121 '${opt.ops.select_operation}_${opt.ops.add_output_params.oc}_db'
122 -oc'$opt.ops.add_output_params.oc'
123 #else
124 '${opt.ops.select_operation}_min_db'
125 -oc'diff'
126 #end if
127 #if str($opt.ops.add_output_params.min_kmer_occurrence) != '':
128 -ci'$opt.ops.add_output_params.min_kmer_occurrence'
129 #end if
130 #if str($opt.ops.add_output_params.max_kmer_occurrence) != '':
131 -cx'$opt.ops.add_output_params.max_kmer_occurrence'
132 #end if
133 #end if
134 #end for
135
136 #for $i,$op in enumerate($operation_arr):
137 #if str($op) == "kmers_subtract" or str($op) == "reverse_kmers_subtract":
138 && cp '${op}'_db.kmc_suf outdir/
139 && cp '${op}'_db.kmc_pre outdir/
140 2>&1 | tee -a '$out_log'
141 #else
142 && cp '${op}'_*_db.kmc_suf outdir/
143 && cp '${op}'_*_db.kmc_pre outdir/
144 2>&1 | tee -a '$out_log'
145 #end if
146 #end for
147 ]]></command>
148 <inputs>
149 <param name="input_collection_one" type="data_collection" collection_type="list" label="KMC db one"/>
150 <param name="input_collection_two" type="data_collection" collection_type="list" label="KMC db two"/>
151 <conditional name="input_options_cond">
152 <param name="input_param" type="select" label="Input parameters">
153 <option value="None" selected="true">Both KMC DB with default parameters</option>
154 <option value="kmc_one_params">KMC db one only</option>
155 <option value="kmc_two_params">KMC db two only</option>
156 <option value="both_kmc_params">Both KMC DB with user parameters</option>
157 </param>
158 <when value="None"/>
159 <when value="kmc_one_params">
160 <section name="kmc_db_one_param" title="KMC DB one parameters">
161 <expand macro="input_option"/>
162 </section>
163 </when>
164 <when value="kmc_two_params">
165 <section name="kmc_db_two_param" title="KMC DB two parameters">
166 <expand macro="input_option"/>
167 </section>
168 </when>
169 <when value="both_kmc_params">
170 <section name="both_db_one_param" title="KMC DB one parameters">
171 <expand macro="input_option"/>
172 </section>
173 <section name="both_db_two_param" title="KMC DB two parameters">
174 <expand macro="input_option"/>
175 </section>
176 </when>
177 </conditional>
178 <repeat name="operations" title="Operations" min="1" max="3">
179 <conditional name="ops">
180 <expand macro="simple_operation"/>
181 <when value="intersect">
182 <section name="add_output_params" expanded="false" title="Additional output parameters">
183 <expand macro="counter_calculation_option"/>
184 </section>
185 </when>
186 <when value="union">
187 <section name="add_output_params" expanded="false" title="Additional output parameters">
188 <expand macro="counter_calculation_option"/>
189 </section>
190 </when>
191 <when value="kmers_subtract">
192 <section name="add_output_params" expanded="false" title="Additional output parameters">
193 <expand macro="none_counter_calculation_option"/>
194 </section>
195 </when>
196 <when value="reverse_kmers_subtract">
197 <section name="add_output_params" expanded="false" title="Additional output parameters">
198 <expand macro="none_counter_calculation_option"/>
199 </section>
200 </when>
201 <when value="counters_subtract">
202 <section name="add_output_params" expanded="false" title="Additional output parameters">
203 <expand macro="counter_calculation_option"/>
204 </section>
205 </when>
206 <when value="reverse_counters_subtract">
207 <section name="add_output_params" expanded="false" title="Additional output parameters">
208 <expand macro="counter_calculation_option"/>
209 </section>
210 </when>
211 </conditional>
212 </repeat>
213 </inputs>
214 <outputs>
215 <collection name="kmc_db" type="list" label="${tool.name} on ${on_string}: kmc db">
216 <discover_datasets pattern="(?P&lt;designation&gt;.+)" format="binary" directory="outdir/" />
217 </collection>
218 <data name="out_log" format="txt" label="${tool.name} on ${on_string}: log"/>
219 </outputs>
220 <tests>
221 <test>
222 <!-- #1 test with default parameters -->
223 <param name="input_collection_one">
224 <collection type="list">
225 <element name="kmers_one.kmc_suf" value="kmers_one.kmc_suf"/>
226 <element name="kmers_one.kmc_pre" value="kmers_one.kmc_pre"/>
227 </collection>
228 </param>
229 <param name="input_collection_two">
230 <collection type="list">
231 <element name="kmers_two.kmc_suf" value="kmers_two.kmc_suf"/>
232 <element name="kmers_two.kmc_pre" value="kmers_two.kmc_pre"/>
233 </collection>
234 </param>
235 <conditional name="input_options_cond">
236 <param name="input_param" value="None"/>
237 </conditional>
238 <param name="select_operation" value="intersect" />
239 <section name="add_output_params">
240 <param name="oc" value="max"/>
241 </section>
242 <output_collection name="kmc_db" type="list">
243 <element name="intersect_max_db.kmc_suf" file="intersect_max_db.kmc_suf"/>
244 <element name="intersect_max_db.kmc_pre" file="intersect_max_db.kmc_pre"/>
245 </output_collection>
246 </test>
247 <test>
248 <!-- #2 test with input parameters for KMC DB one only -->
249 <param name="input_collection_one">
250 <collection type="list">
251 <element name="kmers_one.kmc_suf" value="kmers_one.kmc_suf"/>
252 <element name="kmers_one.kmc_pre" value="kmers_one.kmc_pre"/>
253 </collection>
254 </param>
255 <param name="input_collection_two">
256 <collection type="list">
257 <element name="kmers_two.kmc_suf" value="kmers_two.kmc_suf"/>
258 <element name="kmers_two.kmc_pre" value="kmers_two.kmc_pre"/>
259 </collection>
260 </param>
261 <conditional name="input_options_cond">
262 <param name="input_param" value="kmc_one_params"/>
263 </conditional>
264 <param name="select_operation" value="intersect" />
265 <section name="kmc_db_one_param">
266 <param name="min_kmer_occurrence" value="3"/>
267 <param name="max_kmer_occurrence" value="30"/>
268 </section>
269 <section name="add_output_params">
270 <param name="oc" value="min"/>
271 </section>
272 <output_collection name="kmc_db" type="list">
273 <element name="intersect_min_db.kmc_suf" file="intersect_min_db.kmc_suf"/>
274 <element name="intersect_min_db.kmc_pre" file="intersect_min_db.kmc_pre"/>
275 </output_collection>
276 </test>
277 <test>
278 <!-- #3 test with input parameters for KMC DB two only -->
279 <param name="input_collection_one">
280 <collection type="list">
281 <element name="kmers_one.kmc_suf" value="kmers_one.kmc_suf"/>
282 <element name="kmers_one.kmc_pre" value="kmers_one.kmc_pre"/>
283 </collection>
284 </param>
285 <param name="input_collection_two">
286 <collection type="list">
287 <element name="kmers_two.kmc_suf" value="kmers_two.kmc_suf"/>
288 <element name="kmers_two.kmc_pre" value="kmers_two.kmc_pre"/>
289 </collection>
290 </param>
291 <conditional name="input_options_cond">
292 <param name="input_param" value="kmc_two_params"/>
293 </conditional>
294 <param name="select_operation" value="union" />
295 <section name="kmc_db_two_param">
296 <param name="min_kmer_occurrence" value="3"/>
297 <param name="max_kmer_occurrence" value="30"/>
298 </section>
299 <output_collection name="kmc_db" type="list">
300 <element name="union_db.kmc_suf" file="union_db.kmc_suf"/>
301 <element name="union_db.kmc_pre" file="union_db.kmc_pre"/>
302 </output_collection>
303 </test>
304 <test>
305 <!-- #4 test with input parameters for both KMC DB -->
306 <param name="input_collection_one">
307 <collection type="list">
308 <element name="kmers_one.kmc_suf" value="kmers_one.kmc_suf"/>
309 <element name="kmers_one.kmc_pre" value="kmers_one.kmc_pre"/>
310 </collection>
311 </param>
312 <param name="input_collection_two">
313 <collection type="list">
314 <element name="kmers_two.kmc_suf" value="kmers_two.kmc_suf"/>
315 <element name="kmers_two.kmc_pre" value="kmers_two.kmc_pre"/>
316 </collection>
317 </param>
318 <conditional name="input_options_cond">
319 <param name="input_param" value="both_kmc_params"/>
320 </conditional>
321 <param name="select_operation" value="counters_subtract" />
322 <section name="both_db_one_param">
323 <param name="min_kmer_occurrence" value="2"/>
324 <param name="max_kmer_occurrence" value="20"/>
325 </section>
326 <section name="both_db_two_param">
327 <param name="min_kmer_occurrence" value="3"/>
328 <param name="max_kmer_occurrence" value="30"/>
329 </section>
330 <section name="add_output_params">
331 <param name="oc" value="sum"/>
332 </section>
333 <output_collection name="kmc_db" type="list">
334 <element name="counters_subtract_sum_db.kmc_suf" file="counters_subtract_sum_db.kmc_suf"/>
335 <element name="counters_subtract_sum_db.kmc_pre" file="counters_subtract_sum_db.kmc_pre"/>
336 </output_collection>
337 </test>
338 </tests>
339 <help><![CDATA[
340
341 .. class:: infomark
342
343
344 **What it does**
345
346 *KMC simple operation performs set operation on two input KMC's databases*
347
348 **General Syntax**
349
350 kmc_tools simple <input1 [input1_params]> <input2 [input2_params]> <oper1 output1 [output_params1]> [<oper2 output2 [output_params2]> ...]
351
352 **Input:**
353
354 - input file - input1 and input2 are the databases generated by KMC ( kmc file suffix - kmc_pre and kmc_suf )
355
356 **Available Operations:**
357
358 - intersect - output database will contains only k-mers that are present in both input sets
359 - union - output database will contains each k-mer present in any of input sets
360 - kmers_subtract - difference of input sets based on k-mers. Output database will contains only k-mers that are present in first input set but absent in the second one
361 - counters_subtract - difference of input sets based on k-mers and their counters (weaker version of kmers_subtract). Output database will contains all k-mers that are present in first input, beyond those for which counter operation will lead to remove (i.e. counter equal to 0 or negative number)
362 - reverse_kmers_subtract - same as kmers_subtract but treat input2 as first and input1 as second
363 - reverse_counters_subtract - same as counters_subtract but treat input2 as first and input1 as second
364
365 **Additional Parameters for inputs:**
366
367 - ci<value> - exclude k-mers occurring less than <value> times
368 - cx<value> - exclude k-mers occurring more of than <value> times
369
370 **Additional Parameters for outputs:**
371
372 - ci<value> - exclude k-mers occurring less than <value> times
373 - cx<value> - exclude k-mers occurring more of than <value> times
374 - cs<value> - maximal value of a counter
375 - o<kmc|kff> - output in KMC or KFF format (default: kmc)
376 - oc<value> - redefine counter calculation mode for equal k-mers
377
378 **Available oc<value>**
379
380 - min - get lower value of a k-mer counter (default value for intersect operation)
381 - max - get upper value of a k-mer counter
382 - sum - get sum of counters from both databases
383 - diff - get difference between counters (default for counters_subtract operation)
384 - left - get counter from first database (input1)
385 - right - get counter from second database (input2)
386
387
388 **Example(1):**
389
390 - kmc -k27 file1.fastq kmers1 kmc_tmp_dir
391 - kmc -k27 file2.fastq kmers2 kmc_tmp_dir
392 - kmc_tools simple kmers1 -ci10 -cx200 kmers2 -ci4 -cx100 intersect kmers1_kmers2_intersect -ci20 -cx150
393
394 **Output(1)**
395
396 - kmers1_kmers2_intersect.kmc_suf (i.e intersect_kmc_suf in galaxy)
397 - kmers1_kmers2_intersect.kmc_pre (i.e intersect_kmc_pre in galaxy)
398
399 **Example(2):**
400
401 - kmc -k27 file1.fastq kmers1 kmc_tmp_dir
402 - kmc -k27 file2.fastq kmers2 kmc_tmp_dir
403 - kmc_tools simple kmers1 kmers2 intersect inter_k1_k2_max -ocmax intersect inter_k1_k2_min union union_k1_k2 -ci10
404
405 **Output(2)**
406
407 - inter_k1_k2_max.kmc_suf (i.e intersect.kmc_suf in galaxy)
408 - inter_k1_k2_max.kmc_pre (i.e intersect.kmc_pre in galaxy)
409 - inter_k1_k2_min.kmc_suf (i.e intersect.kmc_suf in galaxy)
410 - inter_k1_k2_min.kmc_pre (i.e intersect.kmc_pre in galaxy)
411 - union_k1_k2.kmc_suf (i.e union.kmc_suf in galaxy)
412 - union_k1_k2.kmc_pre (i.e union.kmc_pre in galaxy
413
414 .. class:: infomark
415
416 **References**
417
418 More information are available on `website <https://github.com/refresh-bio/KMC/blob/master/kmc_tools.pdf>`_.
419 ]]></help>
420 <citations>
421 <citation type="doi">DOI: 10.1093/bioinformatics/btx304</citation>
422 <citation type="doi">DOI: 10.1093/bioinformatics/btv022</citation>
423 <citation type="doi">DOI: 10.1186/1471-2105-14-160</citation>
424 </citations>
425 </tool>