comparison bedtools_genomecov/macros.xml @ 0:b63479816ebe draft

Uploaded
author jackcurragh
date Fri, 27 May 2022 10:18:31 +0000
parents
children 48e1c3a73761
comparison
equal deleted inserted replaced
-1:000000000000 0:b63479816ebe
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.30.0</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 <conditional name="seed">
55 <param name="seed_choose" type="select" label="Choose Seed?">
56 <option value="False" selected="true">Random Shuffling</option>
57 <option value="True">Choose fixed seed</option>
58 </param>
59 <when value="True">
60 <param argument="-seed" type="integer" value="12345" label="Enter Seed" />
61 </when>
62 <when value="False" />
63 </conditional>
64 </xml>
65 <xml name="split">
66 <param argument="-split" type="boolean" truevalue="-split" falsevalue="" checked="false"
67 label="Treat split/spliced BAM or BED12 entries as distinct BED intervals when computing coverage."
68 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." />
69 </xml>
70 <xml name="input_conditional_genome_file" token_optional="false" token_help="">
71 <conditional name="genome_file_opts">
72 <param name="genome_file_opts_selector" type="select" label="Genome file" help="@HELP@">
73 <option value="loc" selected="true">Locally installed Genome file</option>
74 <option value="hist">Genome file from your history</option>
75 </param>
76 <when value="loc">
77 <param name="genome" type="select" optional="@OPTIONAL@" multiple="false" label="Genome file">
78 <options from_data_table="__dbkeys__" />
79 </param>
80 </when>
81 <when value="hist">
82 <param name="genome" type="data" optional="@OPTIONAL@" format="tabular" label="Genome file" />
83 </when>
84 </conditional>
85 </xml>
86 <token name="@GENOME_FILE@">
87 #if $genome_file_opts.genome
88 -g
89 #if $genome_file_opts.genome_file_opts_selector == "loc":
90 '$genome_file_opts.genome.fields.len_path'
91 #elif $genome_file_opts.genome_file_opts_selector == "hist":
92 '$genome_file_opts.genome'
93 #end if
94 #end if
95 </token>
96 <token name="@GENOME_FILE_MAKEWINDOWS@">
97 #if $type.type_select == "genome":
98 #if $type.genome_file_opts.genome_file_opts_selector == "loc":
99 -g '$type.genome_file_opts.genome.fields.len_path'
100 #elif $type.genome_file_opts.genome_file_opts_selector == "hist":
101 -g '$type.genome_file_opts.genome'
102 #end if
103 #end if
104 </token>
105 <token name="@GENOME_FILE_UNION@">
106 #if $empty.empty_selector == "-empty":
107 #if $empty.genome_file_opts.genome_file_opts_selector == "loc":
108 -g '$empty.genome_file_opts.genome.fields.len_path'
109 #elif $empty.genome_file_opts.genome_file_opts_selector == "hist":
110 -g '$empty.genome_file_opts.genome'
111 #end if
112 #end if
113 </token>
114 <token name="@GENOME_FILE_COVERAGE@">
115 #if $input_type.input_type_select == "bam":
116 -ibam '$input_type.input'
117 #else:
118 -i '$input_type.input'
119 #if $input_type.genome_file_opts.genome_file_opts_selector == "loc":
120 -g '$input_type.genome_file_opts.genome.fields.len_path'
121 #elif $input_type.genome_file_opts.genome_file_opts_selector == "hist":
122 -g '$input_type.genome_file_opts.genome'
123 #end if
124 #end if
125 </token>
126 <xml name="closest_D_option">
127 <param argument="-iu" type="boolean" truevalue="-iu" falsevalue="" checked="false"
128 label="Ignore features in B that are upstream of features in A"
129 help="This option requires -D and follows its orientation rules for determining what is 'upstream'" />
130
131 <param argument="-id" type="boolean" truevalue="-id" falsevalue="" checked="false"
132 label="Ignore features in B that are downstream of features in A"
133 help="This option requires -D and follows its orientation rules for determining what is 'downstream'" />
134
135 <param argument="-fu" type="boolean" truevalue="-fu" falsevalue="" checked="false"
136 label="Choose first from features in B that are upstream of features in A"
137 help="This option requires -D and follows its orientation rules for determining what is 'upstream'" />
138
139 <param argument="-fd" type="boolean" truevalue="-fd" falsevalue="" checked="false"
140 label="Choose first from features in B that are downstream of features in A"
141 help="This option requires -D and follows its orientation rules for determining what is 'downstream'" />
142 </xml>
143 <xml name="addition">
144 <conditional name="addition">
145 <param name="addition_select" type="select" label="Choose what you want to do">
146 <option value="b" selected="true">Increase the @STD_BEDTOOLS_INPUT_LABEL@ entry by the same number base pairs in each direction.</option>
147 <option value="lr">Increase by Start Coordinate and End Coordinate</option>
148 </param>
149 <when value="b">
150 <param name="b" value="1" label="Number of base pairs" type="integer" />
151 </when>
152 <when value="lr">
153 <param name="l" type="integer" value="0" label="The number of base pairs to subtract from the start coordinate" />
154 <param name="r" type="integer" value="0" label="The number of base pairs to add to the end coordinate" />
155 </when>
156 </conditional>
157 </xml>
158 <xml name="print_header">
159 <param argument="-header" type="boolean" truevalue="-header" falsevalue="" checked="false"
160 label="Print the header from the A file prior to results" />
161 </xml>
162 <!-- TODO this is currently not used, but we should make use of it -->
163 <xml name="genome_validator">
164 <validator type="unspecified_build" />
165 <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." />
166 </xml>
167
168 <!-- ToDo column_picker -->
169 <xml name="choose_columns">
170 <param name="cols" argument="-c" type="text" value=""
171 label="Specify the column(s) that should be summarized"
172 help="Comma separated">
173 <sanitizer invalid_char="">
174 <valid initial="string.digits"><add value=","/></valid>
175 </sanitizer>
176 </param>
177 </xml>
178
179 <token name="@C_AND_O_ARGUMENT@">
180 #set $col = list()
181 #set $op = list()
182 #for $item in $c_and_o_argument_repeat:
183 #silent $col.append( str($item.col) )
184 #silent $op.append( str($item.operation) )
185 #end for
186 #if $col:
187 -c #echo ','.join($col)#
188 -o #echo ','.join($op)#
189 #end if
190 </token>
191
192 <xml name="c_and_o_argument">
193 <repeat name="c_and_o_argument_repeat" title="Applying operations to columns from merged intervals" min="0">
194 <yield />
195 <expand macro="choose_operations">
196 <expand macro="math_options" />
197 <expand macro="additional_math_options" />
198 </expand>
199 </repeat>
200 </xml>
201
202 <xml name="choose_operations">
203 <param name="operation" type="select" label="Specify the operation">
204 <yield />
205 </param>
206 </xml>
207
208 <xml name="math_options">
209 <option value="sum" selected="true">Sum - numeric only</option>
210 <option value="min">Min - numeric only</option>
211 <option value="max">Max - numeric only</option>
212 <option value="absmin">AbsMin - numeric only</option>
213 <option value="absmax">AbsMax - numeric only</option>
214 <option value="mean">Mean - numeric only</option>
215 <option value="median">Median - numeric only</option>
216 <option value="mode">Mode - numeric only</option>
217 <option value="antimode">Antimode - numeric only</option>
218 <option value="collapse">collapse (i.e., print a comma separated list) - numeric or text</option>
219 </xml>
220 <xml name="additional_math_options">
221 <option value="count">Count - numeric or text</option>
222 <option value="count_disctinct">Count Distinct - numeric or text</option>
223 <option value="distinct">distinct (i.e., print a comma separated list) - numeric or text</option>
224 <option value="concat">concat (i.e., print a comma separated list) - numeric or text</option>
225 </xml>
226 <xml name="sorted">
227 <!-- -sorted -g -->
228 <param argument="-sorted" type="boolean" truevalue="-sorted" falsevalue="" checked="false"
229 label="For coordinate sorted input file the more efficient sweeping algorithm is enabled."/>
230 </xml>
231 <token name="@SORTED@">
232 <![CDATA[
233 $sorted
234 #if str($sorted) != '':
235 #if str($reduce_or_iterate.reduce_or_iterate_selector) == 'iterate' and $reduce_or_iterate.inputB.is_of_type('bam'):
236 -g <(samtools view -H $reduce_or_iterate.inputB | tr ':' '\t' | grep SN | cut -f 3,5)
237 #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'):
238 -g <(samtools view -H $reduce_or_iterate.inputB[0] | tr ':' '\t' | grep SN | cut -f 3,5)
239 #end if
240 #end if
241 ]]>
242 </token>
243 <token name="@REFERENCES@">
244 <![CDATA[
245 ------
246
247 This tool is part of the `bedtools package`_ from the `Quinlan laboratory`_.
248
249 .. _bedtools package: https://github.com/arq5x/bedtools2
250 .. _Quinlan laboratory: http://quinlanlab.org
251
252
253 **Citation**
254
255 If you use this tool in Galaxy, please cite:
256
257 Bjoern A. Gruening (2014), `Galaxy wrapper <https://github.com/bgruening/galaxytools>`_
258 ]]>
259 </token>
260 <xml name="citations">
261 <citations>
262 <citation type="doi">10.1093/bioinformatics/btq033</citation>
263 <yield />
264 </citations>
265 </xml>
266 </macros>