comparison vcfanno.xml @ 0:fb20fa735dfe draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/vcfanno/ commit d962b44c5d3fecd1a315d6fbda8831d6de1b2801"
author iuc
date Thu, 21 Jan 2021 10:33:49 +0000
parents
children 4f3c5e634679
comparison
equal deleted inserted replaced
-1:000000000000 0:fb20fa735dfe
1 <?xml version="1.0"?>
2 <tool id="vcfanno" name="vcfanno" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
3 <description>VCF annotation</description>
4 <macros>
5 <import>macros.xml</import>
6 </macros>
7
8 <expand macro="xrefs"/>
9
10 <expand macro="requirements"/>
11
12 <expand macro="version_command"/>
13
14 <!--
15 In future versions - figure out how to safely add in lua support without posing security risk
16 (Should be doable but requires writing some lua unfortunately to make custom sandboxes)
17 -->
18 <command detect_errors="exit_code"><![CDATA[
19 ln -s '$config_toml' config.toml &&
20 ln -s '$input_vcf' input.vcf &&
21
22 #for $i, $annotation in enumerate($annotations):
23 #set $ext = str($annotation.type.type_select)
24 ln -s '$annotation.type.annotation' 'input_${i}.${ext}' &&
25 ### These sets of conversions etc shouldn't be necessary but the vcfanno in Galaxy looks for an index file regardless of compression for some reason and if not present fails.
26 #if $ext == 'vcf' or $ext == 'bed':
27 bgzip 'input_${i}.${ext}' &&
28 #set $ext = $ext + ".gz"
29 #end if
30 #if '.gz' in $ext[-3:]:
31 tabix -p vcf 'input_${i}.${ext}' &&
32 #elif $ext == 'bam':
33 ln -s '${annotation.type.annotation.metadata.bam_index}' input_${i}.bam.bai &&
34 #end if
35 #end for
36 vcfanno -p \${GALAXY_SLOTS:-4}
37 #if $ends:
38 '$ends'
39 #end if
40 #if $permissive_overlap:
41 '$permissive_overlap'
42 #end if
43 config.toml
44 input.vcf
45 >
46 '$out_vcf'
47 ]]></command>
48 <configfiles>
49 <configfile name="config_toml">#
50 #for $i, $annotation in enumerate($annotations):
51 #set $ext = $annotation.type.type_select
52 #if $ext == 'vcf' or $ext == 'bed':
53 #set $ext = $ext + ".gz"
54 #end if
55 #if $ext == 'vcf.gz' or $ext == 'bam':
56 #set $annotation_names = list()
57 #set $annotation_fields = list()
58 #set $annotation_ops = list()
59 #for $field in $annotation.type.fields:
60 #silent $annotation_names.append('"%s"' %(str($field.name)))
61 #silent $annotation_fields.append('"%s"' %(str($field.field)))
62 #silent $annotation_ops.append('"%s"' %(str($field.op)))
63 #end for
64 #set $names = "names= [%s]" % (", ".join($annotation_names))
65 #set $fields = "fields= [%s]" % (", ".join($annotation_fields))
66 #set $ops = "ops= [%s]" % (", ".join($annotation_ops))
67 #elif $ext == 'bed.gz':
68 #set $annotation_names = list()
69 #set $annotation_columns = list()
70 #set $annotation_ops = list()
71 #for $field in $annotation.type.fields:
72 #silent $annotation_names.append('"%s"' %(str($field.name)))
73 #silent $annotation_columns.append( str($field.columns))
74 #silent $annotation_ops.append('"%s"' %(str($field.op)))
75 #end for
76 #set $names = "names= [%s]" % (", ".join($annotation_names))
77 #set $fields = "columns= [%s]" % (", ".join($annotation_columns))
78 #set $ops = "ops= [%s]" % (", ".join($annotation_ops))
79 #end if
80 [[annotation]]
81 file="input_${i}.${ext}"
82 ${names}
83 ${fields}
84 ${ops}
85
86 #end for
87 </configfile>
88 </configfiles>
89 <inputs>
90 <param name="input_vcf" type="data" format="vcf,vcf_bgzip" label="VCF to be annotated"/>
91 <param argument="-ends" type="boolean" checked="false" truevalue="-ends" falsevalue="" label="annotate the start and end as well as the interval itself?"/>
92 <param argument="-permissive-overlap" type="boolean" checked="false" truevalue="-permissive-overlap" falsevalue="" label="annotate with an overlapping variant even it doesn't share the same ref and alt alleles." help="Default is to require exact match between variants."/>
93 <repeat name="annotations" title="Input annotations" min="1">
94 <conditional name="type">
95 <param name="type_select" type="select">
96 <option value="vcf" selected="true">VCF</option>
97 <option value="vcf.gz">VCF.bgzip</option>
98 <option value="bed">BED</option>
99 <option value="bam">BAM</option>
100 </param>
101 <when value="vcf">
102 <param name="annotation" type="data" format="vcf" label="Annotation file"/>
103 <repeat name="fields" title="Fields" min="1">
104 <param name="name" type="text"/>
105 <param name="field" type="text" help="ID and FILTER are special fields that pull the ID and FILTER columns from the VCF"/>
106 <param name="op" type="select" label="Op" help="In most cases, we will have a single annotation entry for each entry (variant) in the query VCF, in which case the self op is the best choice. However, it is possible that there will be multiple annotations from a single annotation file--in this case, the op determines how the many values are reduced. In nearly all cases, if you are annotating with a VCF, use self">
107 <expand macro="ops"/>
108 </param>
109 </repeat>
110 </when>
111 <when value="vcf.gz">
112 <param name="annotation" type="data" format="vcf_bgzip" label="Annotation file"/>
113 <repeat name="fields" title="Fields" min="1">
114 <param name="name" type="text"/>
115 <param name="field" type="text" help="ID and FILTER are special fields that pull the ID and FILTER columns from the VCF"/>
116 <param name="op" type="select" label="Op" help="In most cases, we will have a single annotation entry for each entry (variant) in the query VCF, in which case the self op is the best choice. However, it is possible that there will be multiple annotations from a single annotation file--in this case, the op determines how the many values are reduced. In nearly all cases, if you are annotating with a VCF, use self">
117 <expand macro="ops"/>
118 </param>
119 </repeat>
120 </when>
121 <when value="bed">
122 <param name="annotation" type="data" format="bed" label="Annotation file"/>
123 <repeat name="fields" title="Fields" min="1">
124 <param name="name" type="text"/>
125 <param name="columns" type="text" help="(1-based) column number from which to pull the value for the op"/>
126 <param name="op" type="select" label="Op">
127 <expand macro="ops"/>
128 </param>
129 </repeat>
130 </when>
131 <when value="bam">
132 <param name="annotation" type="data" format="bam" label="Annotation file"/>
133 <repeat name="fields" title="Fields" min="1">
134 <param name="name" type="text"/>
135 <param name="field" type="select" help="Field in the BAM to pull value from">
136 <option value="depth">Depth (count)</option>
137 <option value="coverage">Coverage</option>
138 <option value="mapq">mapq (mapping quality)</option>
139 <option value="seq">seq</option>
140 <option value="DP2">DP2</option>
141 </param>
142 <param name="op" type="select" label="Op" help="Op to perform on the field. Note: DP2 field always will result in DP2 op">
143 <expand macro="ops"/>
144 </param>
145 </repeat>
146 </when>
147 </conditional>
148 </repeat>
149 <!-- <repeat name="postannotations" title="Input postannotations">
150 </repeat> -->
151 <!-- Until we figure out lua sanitization there's really no point to adding this either-->
152 </inputs>
153 <outputs>
154 <!-- standard -->
155 <data name="out_vcf" format="vcf" label="${tool.name} on ${on_string}: Result"/>
156 </outputs>
157 <tests>
158 <!-- #1 default -->
159 <test expect_num_outputs="1">
160 <param name="input_vcf" value="query.vcf.gz" ftype="vcf_bgzip"/>
161 <repeat name="annotations">
162 <conditional name="type">
163 <param name="type_select" value="vcf.gz" />
164 <param name="annotation" value="exac.vcf.gz" ftype="vcf_bgzip"/>
165 <repeat name="fields">
166 <param name="name" value="AC_AFR" />
167 <param name="field" value="AC_AFR" />
168 <param name="op" value="first" />
169 </repeat>
170 <repeat name="fields">
171 <param name="name" value="AC_AMR" />
172 <param name="field" value="AC_AMR" />
173 <param name="op" value="first" />
174 </repeat>
175 <repeat name="fields">
176 <param name="name" value="AC_EAS" />
177 <param name="field" value="AC_EAS" />
178 <param name="op" value="first" />
179 </repeat>
180 <repeat name="fields">
181 <param name="name" value="ID" />
182 <param name="field" value="ID" />
183 <param name="op" value="first" />
184 </repeat>
185 </conditional>
186 </repeat>
187 <repeat name="annotations">
188 <conditional name="type">
189 <param name="type_select" value="bam" />
190 <param name="annotation" value="ex.bam" />
191 <repeat name="fields">
192 <param name="name" value="mapq" />
193 <param name="field" value="mapq" />
194 <param name="op" value="mean" />
195 </repeat>
196 <repeat name="fields">
197 <param name="name" value="coverage" />
198 <param name="field" value="coverage" />
199 <param name="op" value="sum" />
200 </repeat>
201 <repeat name="fields">
202 <param name="name" value="xdp2" />
203 <param name="field" value="DP2" />
204 <param name="op" value="self" />
205 </repeat>
206 </conditional>
207 </repeat>
208 <repeat name="annotations">
209 <conditional name="type">
210 <param name="type_select" value="bed" />
211 <param name="annotation" value="fitcons.bed" />
212 <repeat name="fields">
213 <param name="name" value="lua_start" />
214 <param name="columns" value="4" />
215 <param name="op" value="first" />
216 </repeat>
217 <repeat name="fields">
218 <param name="name" value="lua_end" />
219 <param name="columns" value="4" />
220 <param name="op" value="first" />
221 </repeat>
222 <repeat name="fields">
223 <param name="name" value="lua_len" />
224 <param name="columns" value="4" />
225 <param name="op" value="first" />
226 </repeat>
227 <repeat name="fields">
228 <param name="name" value="lua_mean" />
229 <param name="columns" value="4" />
230 <param name="op" value="first" />
231 </repeat>
232 <repeat name="fields">
233 <param name="name" value="lua_loc" />
234 <param name="columns" value="4" />
235 <param name="op" value="first" />
236 </repeat>
237 </conditional>
238 </repeat>
239 <output name="out_vcf" file="vcfanno_result.vcf"/>
240 </test>
241 </tests>
242 <help><![CDATA[
243 .. class:: infomark
244
245 **What it does**
246
247 @WID@
248
249 Note this version of vcfanno does not support lua code functionality
250
251 **Input**
252
253 - VCF file to be annotated
254
255 - BAM / BED / VCF files to annotate with
256
257 **Output**
258
259 - Annotated VCF
260
261 **References**
262
263 @REFERENCES@
264 ]]></help>
265 <expand macro="citations"/>
266 </tool>