upstream-extended/iuc/tools/bedtools/macros.xml
1<macros>
2 <xml name="requirements">
3 <requirements>
4 <requirement type="package" version="@TOOL_VERSION@">bedtools</requirement>
5 <yield/>
6 </requirements>
7 </xml>
8 <xml name="bio_tools">
9 <xrefs>
10 <xref type="bio.tools">bedtools</xref>
11 </xrefs>
12 </xml>
13 <token name="@TOOL_VERSION@">2.31.1</token>
14 <token name="@SAMTOOLS_VERSION@">1.9</token>
15 <token name="@STD_BEDTOOLS_INPUTS@">bed,bedgraph,gff,vcf,encodepeak</token>
16 <token name="@STD_BEDTOOLS_INPUT_LABEL@">BED/bedGraph/GFF/VCF/EncodePeak</token>
17 <token name="@PROFILE@">20.05</token>
18 <xml name="stdio">
19 <stdio>
20 <!-- Anything other than zero is an error -->
21 <exit_code range="1:" />
22 <exit_code range=":-1" />
23 <!-- In case the return code has not been set propery check stderr too -->
24 <regex match="Error:" />
25 <regex match="Exception:" />
26 </stdio>
27 <version_command>bedtools --version</version_command>
28 </xml>
29 <xml name="reciprocal">
30 <param name="reciprocal" argument="-r" type="select" label="Require that the fraction of overlap be reciprocal for A and B" help="In other words, if -f is 0.90 and -r is used, this requires that B overlap at least 90% of A and that A also overlaps at least 90% of B.">
31 <option value="" selected="true">No</option>
32 <option value="-r">Yes</option>
33 </param>
34 </xml>
35 <xml name="fraction" token_name="" token_argument="" token_label="" token_help="" >
36 <param name="@NAME@" argument="@ARGUMENT@" type="float" min="0" max="1" optional="true" label="@LABEL@" help="@HELP@" />
37 </xml>
38 <xml name="overlap" token_name="overlap" token_argument="-f" token_fracof="A">
39 <expand macro="fraction" name="@NAME@" argument="@ARGUMENT@" label="Minimum overlap required as a fraction of @FRACOF@" help="Default is 1E-9, i.e. 1bp."/>
40 </xml>
41 <token name="@OVERLAP@"><![CDATA[
42 #if str($overlap):
43 -f $overlap
44 #end if
45 ]]></token>
46 <xml name="strand2">
47 <param name="strand" type="select" label="Calculation based on strandedness?">
48 <option value="" selected="true">Overlaps on either strand</option>
49 <option value="-s">Only overlaps occurring on the **same** strand.</option>
50 <option value="-S">Only overlaps occurring on the **opposite** strand.</option>
51 </param>
52 </xml>
53 <xml name="seed">
54 <param argument="-seed" type="integer" value="" min="0" optional="true" label="Seed" help="For reproducible 'randomness'"/>
55 </xml>
56 <xml name="split">
57 <param argument="-split" type="boolean" truevalue="-split" falsevalue="" checked="false"
58 label="Treat split/spliced BAM or BED12 entries as distinct BED intervals when computing coverage."
59 help="If set, the coverage will be calculated based the spliced intervals only. For BAM files, this inspects the CIGAR N operation to infer the blocks for computing coverage. For BED12 files, this inspects the BlockCount, BlockStarts, and BlockEnds fields (i.e., columns 10,11,12). If this option is not set, coverage will be calculated based on the interval's START/END coordinates, and would include introns in the case of RNAseq data." />
60 </xml>
61 <xml name="input_conditional_genome_file" token_optional="false" token_help="">
62 <conditional name="genome_file_opts">
63 <param name="genome_file_opts_selector" type="select" label="Genome file" help="@HELP@">
64 <option value="loc" selected="true">Locally installed Genome file</option>
65 <option value="hist">Genome file from your history</option>
66 </param>
67 <when value="loc">
68 <param name="genome" type="select" optional="@OPTIONAL@" multiple="false" label="Genome file"
69 help="This genome file determines the chromosome list and their order." >
70 <options from_data_table="fasta_indexes" />
71 </param>
72 </when>
73 <when value="hist">
74 <param name="genome" type="data" optional="@OPTIONAL@" format="tabular" label="Genome file"
75 help="The expected format of the genome file is first column with chromosome names and second column with chromosome lengths. This genome file determines the chromosome list and their order." />
76 </when>
77 </conditional>
78 </xml>
79 <token name="@GENOME_FILE@">
80#if $genome_file_opts.genome
81 -g
82 #if $genome_file_opts.genome_file_opts_selector == "loc":
83 '$genome_file_opts.genome.fields.path'.fai
84 #elif $genome_file_opts.genome_file_opts_selector == "hist":
85 '$genome_file_opts.genome'
86 #end if
87#end if
88 </token>
89 <token name="@GENOME_FILE_MAKEWINDOWS@">
90#if $type.type_select == "genome":
91 #if $type.genome_file_opts.genome_file_opts_selector == "loc":
92 -g '$type.genome_file_opts.genome.fields.path'.fai
93 #elif $type.genome_file_opts.genome_file_opts_selector == "hist":
94 -g '$type.genome_file_opts.genome'
95 #end if
96#end if
97 </token>
98 <token name="@GENOME_FILE_UNION@">
99#if $empty.empty_selector == "-empty":
100 #if $empty.genome_file_opts.genome_file_opts_selector == "loc":
101 -g '$empty.genome_file_opts.genome.fields.path'.fai
102 #elif $empty.genome_file_opts.genome_file_opts_selector == "hist":
103 -g '$empty.genome_file_opts.genome'
104 #end if
105#end if
106 </token>
107 <token name="@GENOME_FILE_COVERAGE@">
108#if $input_type.input_type_select == "bam":
109 -ibam '$input_type.input'
110#else:
111 -i '$input_type.input'
112 #if $input_type.genome_file_opts.genome_file_opts_selector == "loc":
113 -g '$input_type.genome_file_opts.genome.fields.path'.fai
114 #elif $input_type.genome_file_opts.genome_file_opts_selector == "hist":
115 -g '$input_type.genome_file_opts.genome'
116 #end if
117#end if
118 </token>
119 <xml name="closest_D_option">
120 <param argument="-iu" type="boolean" truevalue="-iu" falsevalue="" checked="false"
121 label="Ignore features in B that are upstream of features in A"
122 help="This option requires -D and follows its orientation rules for determining what is 'upstream'" />
123
124 <param argument="-id" type="boolean" truevalue="-id" falsevalue="" checked="false"
125 label="Ignore features in B that are downstream of features in A"
126 help="This option requires -D and follows its orientation rules for determining what is 'downstream'" />
127
128 <param argument="-fu" type="boolean" truevalue="-fu" falsevalue="" checked="false"
129 label="Choose first from features in B that are upstream of features in A"
130 help="This option requires -D and follows its orientation rules for determining what is 'upstream'" />
131
132 <param argument="-fd" type="boolean" truevalue="-fd" falsevalue="" checked="false"
133 label="Choose first from features in B that are downstream of features in A"
134 help="This option requires -D and follows its orientation rules for determining what is 'downstream'" />
135 </xml>
136 <xml name="addition">
137 <conditional name="addition">
138 <param name="addition_select" type="select" label="Choose what you want to do">
139 <option value="b" selected="true">Increase the @STD_BEDTOOLS_INPUT_LABEL@ entry by the same number base pairs in each direction.</option>
140 <option value="lr">Increase by Start Coordinate and End Coordinate</option>
141 </param>
142 <when value="b">
143 <param name="b" value="1" label="Number of base pairs" type="integer" />
144 </when>
145 <when value="lr">
146 <param name="l" type="integer" value="0" label="The number of base pairs to subtract from the start coordinate" />
147 <param name="r" type="integer" value="0" label="The number of base pairs to add to the end coordinate" />
148 </when>
149 </conditional>
150 </xml>
151 <xml name="print_header">
152 <param argument="-header" type="boolean" truevalue="-header" falsevalue="" checked="false"
153 label="Print the header from the A file prior to results" />
154 </xml>
155 <!-- TODO this is currently not used, but we should make use of it -->
156 <xml name="genome_validator">
157 <validator type="unspecified_build" />
158 <validator type="dataset_metadata_in_data_table" table_name="fasta_indexes" metadata_name="dbkey" metadata_column="1" message="Sequences are not currently available for the specified build." />
159 </xml>
160
161 <!-- ToDo column_picker -->
162 <xml name="choose_columns">
163 <param name="cols" argument="-c" type="text" value=""
164 label="Specify the column(s) that should be summarized"
165 help="Comma separated">
166 <sanitizer invalid_char="">
167 <valid initial="string.digits"><add value=","/></valid>
168 </sanitizer>
169 </param>
170 </xml>
171
172 <token name="@C_AND_O_ARGUMENT@">
173 #set $col = list()
174 #set $op = list()
175 #for $item in $c_and_o_argument_repeat:
176 #silent $col.append( str($item.col) )
177 #silent $op.append( str($item.operation) )
178 #end for
179 #if $col:
180 -c #echo ','.join($col)#
181 -o #echo ','.join($op)#
182 #end if
183 </token>
184
185 <xml name="c_and_o_argument">
186 <repeat name="c_and_o_argument_repeat" title="Applying operations to columns from merged intervals" min="0">
187 <yield />
188 <expand macro="choose_operations">
189 <expand macro="math_options" />
190 <expand macro="additional_math_options" />
191 </expand>
192 </repeat>
193 </xml>
194
195 <xml name="choose_operations">
196 <param name="operation" type="select" label="Specify the operation">
197 <yield />
198 </param>
199 </xml>
200
201 <xml name="math_options">
202 <option value="sum" selected="true">Sum - numeric only</option>
203 <option value="min">Min - numeric only</option>
204 <option value="max">Max - numeric only</option>
205 <option value="absmin">AbsMin - numeric only</option>
206 <option value="absmax">AbsMax - numeric only</option>
207 <option value="mean">Mean - numeric only</option>
208 <option value="median">Median - numeric only</option>
209 <option value="mode">Mode - numeric only</option>
210 <option value="antimode">Antimode - numeric only</option>
211 <option value="stdev">Standard deviation - numeric only</option>
212 <option value="sstdev">Sample standard deviation - numeric only</option>
213 <option value="collapse">collapse (i.e., print a comma separated list) - numeric or text</option>
214 </xml>
215 <xml name="additional_math_options">
216 <option value="count">Count - numeric or text</option>
217 <option value="count_disctinct">Count Distinct - numeric or text</option>
218 <option value="distinct">distinct (i.e., print a comma separated list) - numeric or text</option>
219 <option value="distinct_sort_num">distinct sorted numerially (i.e., print a comma separated list) - numeric</option>
220 <option value="distinct_sort_num_desc">distinct sorted numerially descending (i.e., print a comma separated list) - numeric</option>
221 <option value="distinct_only">delimited list of only unique values - numeric or text</option>
222 <option value="first">just the first value in the column - numeric or text</option>
223 <option value="last">just the last value in the column - numeric or text</option>
224 </xml>
225 <xml name="sorted">
226 <!-- -sorted -g -->
227 <param argument="-sorted" type="boolean" truevalue="-sorted" falsevalue="" checked="false"
228 label="For coordinate sorted input file the more efficient sweeping algorithm is enabled."/>
229 </xml>
230 <token name="@SORTED@">
231<![CDATA[
232$sorted
233#if str($sorted) != '':
234 #if str($reduce_or_iterate.reduce_or_iterate_selector) == 'iterate' and $reduce_or_iterate.inputB.is_of_type('bam'):
235 -g <(samtools view -H $reduce_or_iterate.inputB | tr ':' '\t' | grep SN | cut -f 3,5)
236 #else if str($reduce_or_iterate.reduce_or_iterate_selector) == 'reduce' and str($reduce_or_iterate.inputB) != 'None' and $reduce_or_iterate.inputB[0].is_of_type('bam'):
237 -g <(samtools view -H $reduce_or_iterate.inputB[0] | tr ':' '\t' | grep SN | cut -f 3,5)
238 #end if
239#end if
240]]>
241 </token>
242 <token name="@REFERENCES@">
243<![CDATA[
244------
245
246This tool is part of the `bedtools package`_ from the `Quinlan laboratory`_.
247
248.. _bedtools package: https://github.com/arq5x/bedtools2
249.. _Quinlan laboratory: http://quinlanlab.org
250
251
252**Citation**
253
254If you use this tool in Galaxy, please cite:
255
256Bjoern A. Gruening (2014), `Galaxy wrapper <https://github.com/bgruening/galaxytools>`_
257]]>
258 </token>
259 <xml name="citations">
260 <citations>
261 <citation type="doi">10.1093/bioinformatics/btq033</citation>
262 <yield />
263 </citations>
264 </xml>
265</macros>