comparison macros.xml @ 8:611f4cab1289 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bcftools commit e648d86d550ddf2eb67237752320c390b3a780e5
author iuc
date Wed, 05 Jun 2019 13:12:22 -0400
parents 709dd8291b83
children 0d7d3de5ef5d
comparison
equal deleted inserted replaced
7:709dd8291b83 8:611f4cab1289
1 <macros> 1 <macros>
2 <token name="@TOOL_VERSION@">1.9</token> 2 <token name="@TOOL_VERSION@">1.9</token>
3 <xml name="stdio">
4 <stdio>
5 <exit_code range="1:" />
6 <exit_code range=":-1" />
7 <regex match="Error:" />
8 <regex match="Exception:" />
9 </stdio>
10 </xml>
11 <xml name="requirements"> 3 <xml name="requirements">
12 <requirements> 4 <requirements>
13 <requirement type="package" version="@TOOL_VERSION@">bcftools</requirement> 5 <requirement type="package" version="@TOOL_VERSION@">bcftools</requirement>
14 <requirement type="package" version="1.9">htslib</requirement> 6 <requirement type="package" version="1.9">htslib</requirement>
15 <yield /> 7 <yield />
16 </requirements> 8 </requirements>
17 </xml> 9 </xml>
18 <xml name="samtools_requirement"> 10 <xml name="samtools_requirement">
19 <requirement type="package" version="1.9">samtools</requirement> 11 <requirement type="package" version="1.9">samtools</requirement>
12 </xml>
13 <xml name="matplotlib_requirement">
14 <requirement type="package" version="3.1.0">matplotlib</requirement>
20 </xml> 15 </xml>
21 <xml name="version_command"> 16 <xml name="version_command">
22 <version_command>bcftools 2&gt;&amp;1 | grep 'Version:'</version_command> 17 <version_command>bcftools 2&gt;&amp;1 | grep 'Version:'</version_command>
23 </xml> 18 </xml>
24 19
109 </token> 104 </token>
110 <token name="@INPUT_LIST_FILE@"> 105 <token name="@INPUT_LIST_FILE@">
111 $vcfs_list_file 106 $vcfs_list_file
112 </token> 107 </token>
113 108
109 <xml name="test_using_reference" token_select_from="history" token_ref="">
110 <conditional name="reference_source">
111 <param name="reference_source_selector" value="@SELECT_FROM@" />
112 <param name="fasta_ref" ftype="fasta" value="@REF@" />
113 </conditional>
114 </xml>
115
114 <xml name="macro_fasta_ref"> 116 <xml name="macro_fasta_ref">
115 <param name="fasta_ref" argument="--fasta-ref" type="data" format="data" optional="true" label="Reference sequence in FASTA format" /> 117 <conditional name="reference_source">
118 <param name="reference_source_selector" type="select" label="Choose the source for the reference genome">
119 <option value="cached">Use a built-in genome</option>
120 <option value="history">Use a genome from the history</option>
121 </param>
122 <when value="cached">
123 <param name="fasta_ref" type="select" label="Reference genome">
124 <options from_data_table="fasta_indexes">
125 <filter type="data_meta" column="1" key="dbkey" ref="input_file" />
126 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file" />
127 </options>
128 </param>
129 </when>
130 <when value="history">
131 <param name="fasta_ref" type="data" format="fasta" label="Reference genome" />
132 </when>
133 </conditional>
116 </xml> 134 </xml>
117 <token name="@PREPARE_FASTA_REF@"> 135 <token name="@PREPARE_FASTA_REF@">
118 <![CDATA[ 136 <![CDATA[
119 #set $input_fa_ref = None 137 #set $input_fa_ref = None
120 #if 'fasta_ref' in $section and $section.fasta_ref: 138 #if 'fasta_ref' in $section and $section.fasta_ref:
121 #set $input_fa_ref = 'ref.fa' 139 #if 'reference_source_selector' in $section:
122 ln -s '$section.fasta_ref' $input_fa_ref && 140 #if str($section.reference_source_selector) == "history":
123 samtools faidx $input_fa_ref && 141 #set $input_fa_ref = 'ref.fa'
142 ln -s '$section.fasta_ref' $input_fa_ref &&
143 samtools faidx $input_fa_ref &&
144 #else:
145 #set $input_fa_ref = str($section.fasta_ref.fields.path)
146 #end if
147 #end if
124 #end if 148 #end if
125 ]]> 149 ]]>
126 </token> 150 </token>
127 <token name="@FASTA_REF@"> 151 <token name="@FASTA_REF@">
128 #if $input_fa_ref is not None: 152 #if $input_fa_ref is not None:
129 --fasta-ref $input_fa_ref 153 --fasta-ref $input_fa_ref
130 #elif 'fasta_ref' in $section and $section.fasta_ref: 154 #elif 'fasta_ref' in $section and $section.fasta_ref:
131 --fasta-ref '${section.fasta_ref}' 155 --fasta-ref '${section.fasta_ref}'
132 #end if 156 #end if
133 </token> 157 </token>
134
135 <xml name="macro_ref_fasta">
136 <conditional name="reference_source">
137 <param name="reference_source_selector" type="select" label="Choose the source for the reference genome">
138 <option value="cached">Locally cached</option>
139 <option value="history">History</option>
140 </param>
141 <when value="cached">
142 <param name="ref_file" type="select" label="Select reference genome">
143 <options from_data_table="fasta_indexes">
144 <!--<filter type="data_meta" key="dbkey" ref="input_bam" column="value"/>-->
145 </options>
146 <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
147 </param>
148 </when>
149 <when value="history"> <!-- FIX ME!!!! -->
150 <param name="ref_file" type="data" format="fasta" label="Using reference file" />
151 </when>
152 </conditional>
153 </xml>
154
155 158
156 <xml name="macro_AF_file"> 159 <xml name="macro_AF_file">
157 <param name="AF_file" argument="--AF-file" type="data" format="tabular" optional="true" label="Allele frequencies file" help="Tab-delimited file containing the columns CHR,POS,REF,ALT,AF" /> 160 <param name="AF_file" argument="--AF-file" type="data" format="tabular" optional="true" label="Allele frequencies file" help="Tab-delimited file containing the columns CHR,POS,REF,ALT,AF" />
158 </xml> 161 </xml>
159 <!-- This may need to bgzip and tabix the file --> 162 <!-- This may need to bgzip and tabix the file -->
266 <when input="output_type" value="v" format="vcf" /> 269 <when input="output_type" value="v" format="vcf" />
267 </change_format> 270 </change_format>
268 </data> 271 </data>
269 </xml> 272 </xml>
270 273
271 <xml name="macro_regions"> 274 <xml name="macro_invert_targets">
272 <conditional name="regions"> 275 <param name="invert_targets_file" type="boolean" truevalue="^" falsevalue=""
273 <param name="regions_src" type="select" label="Regions"> 276 label="Invert Targets"
274 <option value="__none__">None</option> 277 help="inverts the query/filtering applied by the targets" />
275 <option value="regions">regions</option> 278 </xml>
276 <option value="regions_file">regions-file</option> 279
280 <xml name="macro_restriction_spec" token_type="region" token_label_type="Region">
281 <repeat name="@TYPE@s" title="@LABEL_TYPE@ Filter" default="1" min="1">
282 <param name="chrom" type="text" label="@LABEL_TYPE@ chromosome">
283 <validator type="expression" message="A chromosome identifier is required when specifying a @LABEL_TYPE@ filter">value.strip()</validator>
284 </param>
285 <param name="start" type="text" label="@LABEL_TYPE@ start position">
286 <validator type="expression" message="an integer number is required">not value or value.isdigit()</validator>
287 </param>
288 <param name="stop" type="text" label="@LABEL_TYPE@ end position">
289 <validator type="expression" message="an integer number is required">not value or value.isdigit()</validator>
290 </param>
291 <yield />
292 </repeat>
293 </xml>
294
295 <xml name="macro_restrictions_file" token_type="region" token_label_type="Region">
296 <param name="@TYPE@s_file" type="data" format="tabular" label="@LABEL_TYPE@s File" help="restrict to @LABEL_TYPE@s listed in a file" />
297 </xml>
298
299 <xml name="macro_restrict" token_type="region" token_label_type="Region" >
300 <conditional name="@TYPE@s">
301 <param name="@TYPE@s_src" type="select" label="@LABEL_TYPE@s">
302 <option value="__none__">Do not restrict to @LABEL_TYPE@s</option>
303 <option value="@TYPE@s">Specify one or more @LABEL_TYPE@(s) directly</option>
304 <option value="@TYPE@s_file">Operate on @LABEL_TYPE@s specified in a history dataset</option>
277 </param> 305 </param>
278 <when value="__none__"/> 306 <when value="__none__"/>
279 <when value="regions"> 307 <when value="@TYPE@s">
280 <param name="regions" type="text" value="" optional="true" label="Restrict to comma-separated list of regions" 308 <expand macro="macro_restriction_spec" type="@TYPE@" label_type="@LABEL_TYPE@" />
281 help="Each region is specifed as: chr or chr:pos or chr:from-to"> 309 <yield />
282 <validator type="regex" message="">^(\w+(:\d+(-\d+)?)?(,\w+(:\d+(-\d+)?)?)*)?$</validator>
283 </param>
284 </when> 310 </when>
285 <when value="regions_file"> 311 <when value="@TYPE@s_file">
286 <param name="regions_file" type="data" format="vcf,bed,tabular" optional="true" label="Regions file" help="Restrict to regions listed in a file" /> 312 <expand macro="macro_restrictions_file" type="@TYPE@" label_type="@LABEL_TYPE@" />
287 </when> 313 <yield />
314 </when>
288 </conditional> 315 </conditional>
289 </xml> 316 </xml>
317
318 <token name="@PARSE_INTERVALS@">
319 <![CDATA[
320 #set $components = []
321 #for $i in $intervals:
322 #set $chrom = str($i.chrom).strip()
323 #set $start = str($i.start).strip()
324 #set $stop = str($i.stop).strip()
325 #if $start or $stop:
326 $components.append($chrom + ':' + ($start or '0') + '-' + $stop)
327 #else:
328 $components.append($chrom)
329 #end if
330 #end for
331 #set $intervals_spec = ','.join($components)
332 ]]>
333 </token>
334
335 <token name="@REGIONS@">
336 <![CDATA[
337 #if $section.regions.regions_src == 'regions':
338 #set $intervals = $section.regions.regions
339 @PARSE_INTERVALS@
340 --regions '$intervals_spec'
341 #elif $section.regions.regions_src == 'regions_file' and $section.regions.regions_file:
342 #if $regions_path is not None:
343 --regions-file '$regions_path'
344 #else:
345 --regions-file '$section.regions.regions_file'
346 #end if
347 #end if
348 ]]>
349 </token>
350
351 <token name="@TARGETS@">
352 <![CDATA[
353 #if $targets_path:
354 --targets-file "${section.targets.invert_targets_file}${targets_path}"
355 #elif $section.targets.targets_src == 'targets':
356 #set $intervals = $section.targets.targets
357 @PARSE_INTERVALS@
358 --targets '${section.targets.invert_targets_file}$intervals_spec'
359 #elif $section.targets.targets_src == 'targets_file' and $section.targets.targets_file:
360 --targets-file "${section.targets.invert_targets_file}${section.targets.targets_file}"
361 #end if
362 ]]>
363 </token>
364
290 <token name="@PREPARE_REGIONS_FILE@"> 365 <token name="@PREPARE_REGIONS_FILE@">
291 <![CDATA[ 366 <![CDATA[
292 #set $regions_path = None 367 #set $regions_path = None
293 #if 'regions' in $section 368 #if 'regions' in $section
294 #if $section.regions.regions_src == 'regions_file' and $section.regions.regions_file: 369 #if $section.regions.regions_src == 'regions_file' and $section.regions.regions_file:
298 #end if 373 #end if
299 #end if 374 #end if
300 #end if 375 #end if
301 ]]> 376 ]]>
302 </token> 377 </token>
303 <token name="@REGIONS@"> 378
304 #if $section.regions.regions_src == 'regions' and $section.regions.regions != '':
305 --regions '$section.regions.regions'
306 #elif $section.regions.regions_src == 'regions_file' and $section.regions.regions_file:
307 #if $regions_path is not None:
308 --regions-file '$regions_path'
309 #else:
310 --regions-file '$section.regions.regions_file'
311 #end if
312 #end if
313 </token>
314 <xml name="macro_targets_file">
315 <param name="targets_file" type="data" format="tabular" label="Targets File" help="restrict to targets listed in a file" >
316 <yield/>
317 </param>
318 <param name="invert_targets_file" type="boolean" truevalue="^" falsevalue="" label="Invert Targets" help="inverts the query/filtering applied by the target file selection" />
319 </xml>
320 <token name="@PREPARE_TARGETS_FILE@"> 379 <token name="@PREPARE_TARGETS_FILE@">
321 <![CDATA[ 380 <![CDATA[
322 #set $targets_path = None 381 #set $targets_path = None
323 #if 'targets' in $section 382 #if 'targets' in $section
324 #if $section.targets.targets_src == 'targets_file': 383 #if $section.targets.targets_src == 'targets_file':
331 bgzip -c "$section.targets_file" > $targets_path && 390 bgzip -c "$section.targets_file" > $targets_path &&
332 tabix -s 1 -b 2 -e 2 $targets_path && 391 tabix -s 1 -b 2 -e 2 $targets_path &&
333 #end if 392 #end if
334 ]]> 393 ]]>
335 </token> 394 </token>
395
336 <token name="@TARGETS_FILE@"> 396 <token name="@TARGETS_FILE@">
337 <![CDATA[ 397 <![CDATA[
338 #if $targets_path is not None: 398 #if $targets_path is not None:
339 --targets-file "${section.invert_targets_file}${targets_path}" 399 --targets-file "${section.invert_targets_file}${targets_path}"
340 #elif $section.targets_file: 400 #elif $section.targets_file:
341 --targets-file "${section.invert_targets_file}${section.targets_file}" 401 --targets-file "${section.invert_targets_file}${section.targets_file}"
342 #end if
343 ]]>
344 </token>
345
346 <xml name="macro_targets">
347 <conditional name="targets">
348 <param name="targets_src" type="select" label="Targets">
349 <option value="__none__">None</option>
350 <option value="targets">targets</option>
351 <option value="targets_file">targets-file</option>
352 </param>
353 <when value="__none__"/>
354 <when value="targets">
355 <param name="targets" type="text" value="" optional="true" label="Restrict to comma-separated list of targets"
356 help="Each target is specifed as: chr or chr:pos or chr:from-to">
357 <validator type="regex" message="">^(\w+(:\d+(-\d+)?)?(,\w+(:\d+(-\d+)?)?)*)?$</validator>
358 </param>
359 <param name="invert_targets_file" type="boolean" truevalue="^" falsevalue="" label="Invert Targets" help="inverts the query/filtering applied by the targets" />
360 </when>
361 <when value="targets_file">
362 <expand macro="macro_targets_file">
363 </expand>
364 </when>
365 </conditional>
366 </xml>
367 <token name="@TARGETS@">
368 <![CDATA[
369 #if $targets_path:
370 --targets-file "${section.targets.invert_targets_file}${targets_path}"
371 #else:
372 #if $section.targets.targets_src == 'targets' and $section.targets.targets != '':
373 --targets '${section.targets.invert_targets_file}${section.targets.targets}'
374 #elif $section.targets.targets_src == 'targets_file' and $section.targets.targets_file:
375 --targets-file "${section.targets.invert_targets_file}${section.targets.targets_file}"
376 #end if
377 #end if 402 #end if
378 ]]> 403 ]]>
379 </token> 404 </token>
380 405
381 <xml name="macro_samples"> 406 <xml name="macro_samples">