comparison hicConvertFormat.xml @ 6:3e598b8e72e7 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hicexplorer commit 2a0943e78bdc8ebb13f181399206a9eea37ed78f"
author iuc
date Tue, 16 Mar 2021 15:38:11 +0000
parents 2f62a87d4017
children 2a24ce221cd7
comparison
equal deleted inserted replaced
5:835d4d727688 6:3e598b8e72e7
1 <tool id="hicexplorer_hicconvertformat" name="@BINARY@" version="@WRAPPER_VERSION@.0"> 1 <tool id="hicexplorer_hicconvertformat" name="@BINARY@" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
2 <description>Convert between different file formats</description> 2 <description>Convert between different file formats</description>
3 <macros> 3 <macros>
4 <token name="@BINARY@">hicConvertFormat</token> 4 <token name="@BINARY@">hicConvertFormat</token>
5 <token name="@SINGLE_INPUT@"> 5 <token name="@SINGLE_INPUT@">
6 #if $xml_path.inputFormat_selector == 'optionCool': 6 #if $xml_path.inputFormat_selector == 'optionCool':
53 </macros> 53 </macros>
54 54
55 <expand macro="requirements" /> 55 <expand macro="requirements" />
56 <command detect_errors="exit_code"><![CDATA[ 56 <command detect_errors="exit_code"><![CDATA[
57 57
58
59 ## single to single case 58 ## single to single case
60
61 59
62 #if $outputSingleMultiple_conditional.outputSingleMultiple_selector == 'singleMatrix': 60 #if $outputSingleMultiple_conditional.outputSingleMultiple_selector == 'singleMatrix':
63 #set xml_path = $outputSingleMultiple_conditional.inputFormat_conditional 61 #set xml_path = $outputSingleMultiple_conditional.inputFormat_conditional
64 62
65 #if $xml_path.inputFormat_selector == 'optionCool': 63 #if $xml_path.inputFormat_selector == 'optionCool':
66 ln -s "$xml_path.matrix_h5_cooler" "matrix.cool" && 64 ln -s '$xml_path.matrix_h5_cooler' "matrix.cool" &&
67 65
68 #end if 66 #end if
69 #if $xml_path.inputFormat_selector == 'optionH5': 67 #if $xml_path.inputFormat_selector == 'optionH5':
70 ln -s "$xml_path.matrix_h5_cooler" "matrix.h5" && 68 ln -s '$xml_path.matrix_h5_cooler' "matrix.h5" &&
71 69
72 #end if 70 #end if
73 #if $xml_path.inputFormat_selector == 'optionHomer': 71 #if $xml_path.inputFormat_selector == 'optionHomer':
74 ln -s "$xml_path.matrixHomer" "matrix.homer" && 72 ln -s '$xml_path.matrixHomer' "matrix.homer" &&
75 73
76 #end if 74 #end if
77 75
78 #if $xml_path.inputFormat_selector == 'optionHicpro': 76 #if $xml_path.inputFormat_selector == 'optionHicpro':
79 ln -s "$xml_path.matrixHicpro" "matrix.hicpro" && 77 ln -s '$xml_path.matrixHicpro' "matrix.hicpro" &&
80 ln -s "$xml_path.bedHicpro" "matrix.bed" && 78 ln -s '$xml_path.bedHicpro' "matrix.bed" &&
81 #end if 79 #end if
82 80
83 #if $xml_path.inputFormat_selector == 'optionHic': 81 #if $xml_path.inputFormat_selector == 'optionHic':
84 ln -s "$xml_path.matrixHic" "matrix.hic" && 82 ln -s '$xml_path.matrixHic' "matrix.hic" &&
85 #end if 83 #end if
86
87
88 84
89 @BINARY@ 85 @BINARY@
90 @SINGLE_INPUT@ 86 @SINGLE_INPUT@
91 87
92
93 --outputFormat $outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector 88 --outputFormat $outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector
94 --outFileName 'matrix.$outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector' 89 --outFileName 'matrix.$outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector'
95 90
96 #if $outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector == 'ginteractions': 91 #if $outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector == 'ginteractions':
97 && mv 'matrix.${outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector}.tsv' matrix_out 92 && mv 'matrix.${outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector}.tsv' matrix_out
98
99 #else: 93 #else:
100 && mv "matrix.$outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector" matrix_out 94 && mv 'matrix.$outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector' matrix_out
101 #end if 95 #end if
102 #end if 96 #end if
103 97
104 98
105 ### Set up links to matrices to have correct ending 99 ### Set up links to matrices to have correct ending
106 #if $outputSingleMultiple_conditional.outputSingleMultiple_selector == 'multipleMatrix': 100 #if $outputSingleMultiple_conditional.outputSingleMultiple_selector == 'multipleMatrix':
107 #if $outputSingleMultiple_conditional.resolutionOrManyToOne_conditional.resolutionOrManyToOne_selector == 'resolution_option': 101 #if $outputSingleMultiple_conditional.resolutionOrManyToOne_conditional.resolutionOrManyToOne_selector == 'resolution_option':
108 #set xml_path = $outputSingleMultiple_conditional.resolutionOrManyToOne_conditional.inputFormat_conditional 102 #set xml_path = $outputSingleMultiple_conditional.resolutionOrManyToOne_conditional.inputFormat_conditional
109 #if $xml_path.inputFormat_selector == 'optionCool': 103 #if $xml_path.inputFormat_selector == 'optionCool':
110 ln -s "$xml_path.matrix_h5_cooler" "matrix.cool" && 104 ln -s '$xml_path.matrix_h5_cooler' "matrix.cool" &&
111 #end if 105 #end if
112 106
113 #if $xml_path.inputFormat_selector == 'optionH5': 107 #if $xml_path.inputFormat_selector == 'optionH5':
114 ln -s "$xml_path.matrix_h5_cooler" "matrix.h5" && 108 ln -s '$xml_path.matrix_h5_cooler' "matrix.h5" &&
115
116 #end if 109 #end if
117 110
118 #if $xml_path.inputFormat_selector == 'optionHomer': 111 #if $xml_path.inputFormat_selector == 'optionHomer':
119 ln -s "$xml_path.matrix_h5_cooler" "matrix.homer" && 112 ln -s '$xml_path.matrix_h5_cooler' "matrix.homer" &&
120
121 #end if 113 #end if
122 114
123 #if $xml_path.inputFormat_selector == 'optionHicpro': 115 #if $xml_path.inputFormat_selector == 'optionHicpro':
124 ln -s "$xml_path.matrix_h5_cooler" "matrix.hicpro" && 116 ln -s '$xml_path.matrix_h5_cooler' "matrix.hicpro" &&
125 ln -s "$xml_path.bedHicpro" "matrix.bed" && 117 ln -s '$xml_path.bedHicpro' "matrix.bed" &&
126
127 #end if 118 #end if
128 #if $xml_path.inputFormat_selector == 'optionHic': 119 #if $xml_path.inputFormat_selector == 'optionHic':
129 ln -s "$xml_path.matrix_h5_cooler" "matrix.hic" && 120 ln -s '$xml_path.matrix_h5_cooler' "matrix.hic" &&
130
131 #end if 121 #end if
132 #else: 122 #else:
133 #set xml_manyToOne = $outputSingleMultiple_conditional.resolutionOrManyToOne_conditional 123 #set xml_manyToOne = $outputSingleMultiple_conditional.resolutionOrManyToOne_conditional
134 #if $xml_manyToOne.inputFormat_conditional.inputFormat_selector == 'optionCool': 124 #if $xml_manyToOne.inputFormat_conditional.inputFormat_selector == 'optionCool':
135 #for $counter, $m in enumerate($xml_manyToOne.matrix_h5_cooler_multiple): 125 #for $counter, $m in enumerate($xml_manyToOne.matrix_h5_cooler_multiple):
177 --inputFormat cool 167 --inputFormat cool
178 #end if 168 #end if
179 #if $xml_path.inputFormat_selector == 'optionH5': 169 #if $xml_path.inputFormat_selector == 'optionH5':
180 --matrices "matrix.h5" 170 --matrices "matrix.h5"
181 --inputFormat h5 171 --inputFormat h5
182
183 #end if 172 #end if
184 #if $xml_path.inputFormat_selector == 'optionHomer': 173 #if $xml_path.inputFormat_selector == 'optionHomer':
185 --matrices "matrix.homer" 174 --matrices "matrix.homer"
186 --inputFormat homer 175 --inputFormat homer
187
188 #end if 176 #end if
189 #if $xml_path.inputFormat_selector == 'optionHicpro': 177 #if $xml_path.inputFormat_selector == 'optionHicpro':
190 --matrices "matrix.hicpro" 178 --matrices "matrix.hicpro"
191 --bedFileHicpro "matrix.bed" 179 --bedFileHicpro "matrix.bed"
192 --inputFormat hicpro 180 --inputFormat hicpro
204 192
205 #if $xml_manyToOne.inputFormat_conditional.inputFormat_selector == 'optionH5': 193 #if $xml_manyToOne.inputFormat_conditional.inputFormat_selector == 'optionH5':
206 --inputFormat h5 194 --inputFormat h5
207 #end if 195 #end if
208 196
209
210 #if $xml_manyToOne.inputFormat_conditional.inputFormat_selector == 'optionHomer': 197 #if $xml_manyToOne.inputFormat_conditional.inputFormat_selector == 'optionHomer':
211 --inputFormat homer 198 --inputFormat homer
212 #end if 199 #end if
213 200
214 #if $xml_manyToOne.inputFormat_conditional.inputFormat_selector == 'optionHicpro': 201 #if $xml_manyToOne.inputFormat_conditional.inputFormat_selector == 'optionHicpro':
218 205
219 --matrices $m 206 --matrices $m
220 #end if 207 #end if
221 --outFileName matrix.mcool 208 --outFileName matrix.mcool
222 && mv matrix.mcool matrix_out 209 && mv matrix.mcool matrix_out
223
224 #end if 210 #end if
225
226
227 ]]> 211 ]]>
228 </command> 212 </command>
229 <inputs> 213 <inputs>
230 214
231 <conditional name="outputSingleMultiple_conditional"> 215 <conditional name="outputSingleMultiple_conditional">
239 </when> 223 </when>
240 <when value='multipleMatrix'> 224 <when value='multipleMatrix'>
241 <conditional name="resolutionOrManyToOne_conditional"> 225 <conditional name="resolutionOrManyToOne_conditional">
242 <param name="resolutionOrManyToOne_selector" type="select" label="Choose input file type"> 226 <param name="resolutionOrManyToOne_selector" type="select" label="Choose input file type">
243 <option value='resolution_option' >Create out of one matrix a multi matrix with diffrerent resolutions</option> 227 <option value='resolution_option' >Create out of one matrix a multi matrix with diffrerent resolutions</option>
244 <option value='manyToOne_option'>Create out of n matrices one multi matrix </option> 228 <option value='manyToOne_option'>Create out of n matrices one multi matrix</option>
245 </param> 229 </param>
246 <when value='resolution_option'> 230 <when value='resolution_option'>
247 <param name='resolutions' type='text' label='To be stored resolutions'/> 231 <param name='resolutions' type='text' label='To be stored resolutions' help="Resolutions can be specified seperated with a space, e.g. '10000 20000 50000'">
232 <validator type="expression" message="Only numeric characters and the a space as seperator are allowed.">value.replace(' ', '').isnumeric()</validator>
233 </param>
248 <expand macro='convertFormat_single_macro' /> 234 <expand macro='convertFormat_single_macro' />
249 </when> 235 </when>
250 <when value='manyToOne_option'> 236 <when value='manyToOne_option'>
251 <expand macro='convertFormat_multiple_macro' /> 237 <expand macro='convertFormat_multiple_macro' />
252 </when> 238 </when>
253 </conditional> 239 </conditional>
254 <param name='storeAppliedCorrection' type="boolean" truevalue="yes" falsevalue="" label='Store applied correction factors in column count'/> 240 <param name='storeAppliedCorrection' type="boolean" truevalue="yes" falsevalue="" label='Store applied correction factors in column count' />
255 <param name='enforceInteger' type="boolean" truevalue="yes" falsevalue="" label='Enforce integer for count column'/> 241 <param name='enforceInteger' type="boolean" truevalue="yes" falsevalue="" label='Enforce integer for count column' />
256 </when> 242 </when>
257 </conditional> 243 </conditional>
258 </inputs> 244 </inputs>
259 <outputs> 245 <outputs>
260
261 <data name='output_converted_matrix' from_work_dir='matrix_out' format='cool' label='Converted matrix'> 246 <data name='output_converted_matrix' from_work_dir='matrix_out' format='cool' label='Converted matrix'>
262 <filter>outputSingleMultiple_conditional.outputSingleMultiple_selector == 'singleMatrix'</filter> 247 <filter>outputSingleMultiple_conditional.outputSingleMultiple_selector == 'singleMatrix'</filter>
263 <change_format> 248 <change_format>
264 <when input="outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector" value="h5" format="h5" /> 249 <when input="outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector" value="h5" format="h5" />
265 <when input="outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector" value="homer" format="zip" /> 250 <when input="outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector" value="homer" format="zip" />
266 <when input="outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector" value="ginteractions" format="tsv" /> 251 <when input="outputSingleMultiple_conditional.outputFormat_conditional.outputFormat_selector" value="ginteractions" format="tabular" />
267 </change_format> 252 </change_format>
268 </data> 253 </data>
269 <data name='output_converted_matrix_multi' from_work_dir='matrix_out' format='mcool' label='Converted matrix mcool'> 254 <data name='output_converted_matrix_multi' from_work_dir='matrix_out' format='mcool' label='Converted matrix mcool'>
270 <filter>outputSingleMultiple_conditional.outputSingleMultiple_selector == 'multipleMatrix'</filter> 255 <filter>outputSingleMultiple_conditional.outputSingleMultiple_selector == 'multipleMatrix'</filter>
271 </data> 256 </data>
272 </outputs> 257 </outputs>
273 <tests> 258 <tests>
274 <test> 259 <test>
275 <conditional name='outputSingleMultiple_conditional'> 260 <conditional name='outputSingleMultiple_conditional'>
276 <param name='outputSingleMultiple_selector' value='singleMatrix'/> 261 <param name='outputSingleMultiple_selector' value='singleMatrix' />
277 <conditional name='inputFormat_conditional'> 262 <conditional name='inputFormat_conditional'>
278 <param name='inputFormat_selector' value='optionCool'/> 263 <param name='inputFormat_selector' value='optionCool' />
279 <param name='matrix_h5_cooler' value='small_test_matrix.cool'/> 264 <param name='matrix_h5_cooler' value='small_test_matrix.cool' />
280 </conditional> 265 </conditional>
281 266
282 <conditional name='outputFormat_conditional'> 267 <conditional name='outputFormat_conditional'>
283 <param name='outputFormat_selector' value='h5'/> 268 <param name='outputFormat_selector' value='h5' />
284 </conditional> 269 </conditional>
285 </conditional> 270 </conditional>
286 <output name="output_converted_matrix" ftype="h5"> 271 <output name="output_converted_matrix" ftype="h5">
287 <assert_contents> 272 <assert_contents>
288 <has_h5_keys keys='intervals,matrix,nan_bins'/> 273 <has_h5_keys keys='intervals,matrix,nan_bins' />
289 </assert_contents> 274 </assert_contents>
290 </output> 275 </output>
291 </test> 276 </test>
292 <test> 277 <test>
293 <conditional name='outputSingleMultiple_conditional'> 278 <conditional name='outputSingleMultiple_conditional'>
294 <param name='outputSingleMultiple_selector' value='singleMatrix'/> 279 <param name='outputSingleMultiple_selector' value='singleMatrix' />
295 <conditional name='inputFormat_conditional'> 280 <conditional name='inputFormat_conditional'>
296 <param name='inputFormat_selector' value='optionH5'/> 281 <param name='inputFormat_selector' value='optionH5' />
297 <param name='matrix_h5_cooler' value='small_test_matrix.h5'/> 282 <param name='matrix_h5_cooler' value='small_test_matrix.h5' />
298 </conditional> 283 </conditional>
299 284
300 <conditional name='outputFormat_conditional'> 285 <conditional name='outputFormat_conditional'>
301 <param name='outputFormat_selector' value='cool'/> 286 <param name='outputFormat_selector' value='cool' />
302 </conditional> 287 </conditional>
303 </conditional> 288 </conditional>
304 <output name="output_converted_matrix" ftype="cool"> 289 <output name="output_converted_matrix" ftype="cool">
305 <assert_contents> 290 <assert_contents>
306 <has_h5_keys keys='bins,chroms,indexes,pixels'/> 291 <has_h5_keys keys='bins,chroms,indexes,pixels' />
307 </assert_contents> 292 </assert_contents>
308 </output> 293 </output>
309 </test> 294 </test>
310 <test> 295 <test>
311 <conditional name='outputSingleMultiple_conditional'> 296 <conditional name='outputSingleMultiple_conditional'>
312 <param name='outputSingleMultiple_selector' value='singleMatrix'/> 297 <param name='outputSingleMultiple_selector' value='singleMatrix' />
313 <conditional name='inputFormat_conditional'> 298 <conditional name='inputFormat_conditional'>
314 <param name='inputFormat_selector' value='optionCool'/> 299 <param name='inputFormat_selector' value='optionCool' />
315 <param name='matrix_h5_cooler' value='hicConvertFormat/small_test_matrix_chr4.cool'/> 300 <param name='matrix_h5_cooler' value='hicConvertFormat/small_test_matrix_chr4.cool' />
316 </conditional> 301 </conditional>
317 302
318 <conditional name='outputFormat_conditional'> 303 <conditional name='outputFormat_conditional'>
319 <param name='outputFormat_selector' value='homer'/> 304 <param name='outputFormat_selector' value='homer' />
320 </conditional> 305 </conditional>
321 </conditional> 306 </conditional>
322 <output name="output_converted_matrix" file="hicConvertFormat/small_test_matrix_chr4.homer" ftype="zip" compare="sim_size" delta="40000"/> 307 <output name="output_converted_matrix" file="hicConvertFormat/small_test_matrix_chr4.homer" ftype="zip" compare="sim_size" delta="40000" />
323 </test> 308 </test>
324 <test> 309 <test>
325 <conditional name='outputSingleMultiple_conditional'> 310 <conditional name='outputSingleMultiple_conditional'>
326 <param name='outputSingleMultiple_selector' value='singleMatrix'/> 311 <param name='outputSingleMultiple_selector' value='singleMatrix' />
327 <conditional name='inputFormat_conditional'> 312 <conditional name='inputFormat_conditional'>
328 <param name='inputFormat_selector' value='optionCool'/> 313 <param name='inputFormat_selector' value='optionCool' />
329 <param name='matrix_h5_cooler' value='hicConvertFormat/small_test_matrix_chr4.cool'/> 314 <param name='matrix_h5_cooler' value='hicConvertFormat/small_test_matrix_chr4.cool' />
330 </conditional> 315 </conditional>
331 316
332 <conditional name='outputFormat_conditional'> 317 <conditional name='outputFormat_conditional'>
333 <param name='outputFormat_selector' value='ginteractions'/> 318 <param name='outputFormat_selector' value='ginteractions' />
334 </conditional> 319 </conditional>
335 </conditional> 320 </conditional>
336 <output name="output_converted_matrix" file="hicConvertFormat/small_test_matrix_chr4.ginteractions.tsv" ftype="tsv" compare="sim_size" delta="40000"/> 321 <output name="output_converted_matrix" file="hicConvertFormat/small_test_matrix_chr4.ginteractions.tsv" ftype="tabular" />
337 322 </test>
338 </test> 323 <test>
339 <test> 324 <conditional name='outputSingleMultiple_conditional'>
340 <conditional name='outputSingleMultiple_conditional'> 325 <param name='outputSingleMultiple_selector' value='multipleMatrix' />
341 <param name='outputSingleMultiple_selector' value='multipleMatrix'/>
342 <conditional name='resolutionOrManyToOne_conditional'> 326 <conditional name='resolutionOrManyToOne_conditional'>
343 <param name='resolutionOrManyToOne_selector' value='resolution_option'/> 327 <param name='resolutionOrManyToOne_selector' value='resolution_option' />
344 <param name='resolutions' value='5000 10000 20000'/> 328 <param name='resolutions' value='5000 10000 20000' />
345 <conditional name='inputFormat_conditional'> 329 <conditional name='inputFormat_conditional'>
346 <param name='inputFormat_selector' value='optionH5'/> 330 <param name='inputFormat_selector' value='optionH5' />
347 <param name='matrix_h5_cooler' value='small_test_matrix.h5'/> 331 <param name='matrix_h5_cooler' value='small_test_matrix.h5' />
348 </conditional> 332 </conditional>
349 </conditional> 333 </conditional>
350 </conditional> 334 </conditional>
351 <output name="output_converted_matrix" ftype="cool"> 335 <output name="output_converted_matrix" ftype="cool">
352 <assert_contents> 336 <assert_contents>
353 <has_h5_keys keys='resolutions'/> 337 <has_h5_keys keys='resolutions' />
354 </assert_contents> 338 </assert_contents>
355 </output> 339 </output>
356 </test> 340 </test>
357 </tests> 341 </tests>
358 <help><![CDATA[ 342 <help><![CDATA[
368 HiCPro file format needs an additional bed file as input. 352 HiCPro file format needs an additional bed file as input.
369 353
370 | For more information about HiCExplorer please consider our documentation on readthedocs.io_ 354 | For more information about HiCExplorer please consider our documentation on readthedocs.io_
371 355
372 .. _readthedocs.io: http://hicexplorer.readthedocs.io/en/latest/index.html 356 .. _readthedocs.io: http://hicexplorer.readthedocs.io/en/latest/index.html
373 ]]></help> 357 ]]> </help>
374 <expand macro="citations" /> 358 <expand macro="citations" />
375 </tool> 359 </tool>