comparison macros_conffiles.xml @ 0:ef5f8bbf7730 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit a41493893bdcbe330434db9c5851719012b62fa8
author iuc
date Wed, 09 Aug 2017 09:52:52 -0400
parents
children 014a21767ac4
comparison
equal deleted inserted replaced
-1:000000000000 0:ef5f8bbf7730
1 <?xml version="1.0"?>
2 <macros>
3 <xml name="configfile_circos_conf">
4 <configfile name="circos_conf"><![CDATA[
5 <<include colors_fonts_patterns.conf>>
6 <<include housekeeping.conf>>
7 karyotype = karyotype.txt
8
9 <image>
10 <<include etc/image.conf>>
11 </image>
12
13 <<include ticks.conf>>
14 <<include ideogram.conf>>
15 <plots>
16 <<include 2d.conf>>
17 </plots>
18 <links>
19 <<include links.conf>>
20 </links>
21
22 ]]></configfile>
23 </xml>
24 <xml name="configfile_ticks_conf">
25 <configfile name="ticks_conf"><![CDATA[
26 show_ticks = ${ticks.show_ticks}
27 show_tick_labels = yes
28
29 #def circosColor($value)
30 #set $value = str($value)
31 #set $r = int($value[1:3], 16)
32 #set $g = int($value[3:5], 16)
33 #set $b = int($value[5:], 16)
34 $r, $g, $b
35 #end def
36
37
38 <ticks>
39 radius = ${ticks.radius}r
40 color = $circosColor($ticks.color)
41 thickness = 2p
42 multiplier = ${ticks.multiplier}
43
44 #for $tick_group in $ticks.tick_group:
45 <tick>
46 spacing = ${tick_group.spacing}
47 size = ${tick_group.size}p
48 show_label = ${tick_group.show_tick_labels}
49 label_size = ${tick_group.label_size}p
50 label_offset = ${tick_group.label_offset}p
51 format = ${tick_group.format} kb
52 ## TODO: figure out automated tick labels
53 ##if ${ticks.multiplier} * ${tick_group.spacing}
54 </tick>
55 #end for
56 </ticks>
57 ]]>
58 </configfile>
59 </xml>
60 <xml name="configfile_ideogram_conf">
61 <configfile name="ideogram_conf"><![CDATA[
62
63 <ideogram>
64
65 <spacing>
66 ## spacing between ideograms
67 default = ${ideogram.spacing}r
68 </spacing>
69
70 # ideogram position, thickness and fill
71 radius = ${ideogram.radius}r
72 thickness = ${ideogram.thickness}p
73 fill = yes
74
75 show_label = ${ideogram.ideogram_labels.show_label}
76 label_radius = dims(ideogram,radius) + 0.075r
77 label_size = 24
78 label_parallel = ${ideogram.ideogram_labels.parallel}
79
80 show_bands = yes
81 fill_bands = yes
82 band_transparency = 4
83
84 </ideogram>
85 ]]></configfile>
86 </xml>
87 <xml name="configfile_data_conf">
88 <configfile name="data_conf"><![CDATA[
89 #for $hi, $data in enumerate($sec_tdd.data):
90 <plot>
91 #set plot_type = str($data.plot_format.plot_format_select)
92 #def circosColor($value)
93 #set $value = str($value)
94 #set $r = int($value[1:3], 16)
95 #set $g = int($value[3:5], 16)
96 #set $b = int($value[5:], 16)
97 $r, $g, $b
98 #end def
99
100 type = ${plot_type}
101 file = data/data-${hi}.txt
102
103 r1 = ${data.r1}r
104 r0 = ${data.r0}r
105 orientation = ${data.orientation}
106
107 #if str($plot_type) == 'histogram':
108 extend_bin = ${data.plot_format.format_specific.extend_bins}
109 fill_color = ${data.plot_format.format_specific.fill_color}
110 #else if str($plot_type) == 'heatmap':
111 color = $circosColor($data.plot_format.format_specific.fill_color)
112 scale_log_base = ${data.plot_format.format_specific.scale_log_base}
113 #else if str($plot_type) == 'line':
114 color = $circosColor($data.plot_format.format_specific.color)
115 thickness = ${data.plot_format.format_specific.thickness}
116 #else if str($plot_type) == 'scatter':
117 glyph = ${data.plot_format.format_specific.glyph}
118 glyph_size = ${data.plot_format.format_specific.glyph_size}
119 color = $circosColor($data.plot_format.format_specific.color)
120 stroke_color = $circosColor($data.plot_format.format_specific.stroke_color)
121 stroke_thickness = ${data.plot_format.format_specific.stroke_thickness}
122 #else if str($plot_type) == 'tile':
123 color = ${data.plot_format.format_specific.color}
124 stroke_color = $circosColor($data.plot_format.format_specific.color)
125 stroke_thickness = ${data.plot_format.format_specific.stroke_thickness}
126 layers = ${data.plot_format.format_specific.layers}
127 thickness = ${data.plot_format.format_specific.thickness}
128 padding = ${data.plot_format.format_specific.padding}
129
130 layers_overflow = ${data.plot_format.format_specific.overflow.overflow_behavior}
131 #if str($data.plot_format.format_specific.overflow.overflow_behavior) != "hide":
132 layers_overflow_color = $circosColor($data.plot_format.format_specific.overflow.layer_overflow_color)
133 #end if
134 #end if
135
136 <rules>
137 #for $rule in $data.sec_rule.rules:
138 <rule>
139 #for $condition in $rule.conditions
140 #if str($condition.application.application_select) == "1":
141 condition = 1
142 #elif str($condition.application.application_select) == "on":
143 #set on_str = ' '.join([ "on(%s)" % $chr.strip() for $chr in $condition.application.on_genomes.split(',') ])
144 condition = $on_str
145 #elif str($condition.application.application_select) == "pos":
146 #if float($condition.application.pos_gt) != 0:
147 condition = var(start) > $condition.application.pos_gt
148 #end if
149
150 #if float($condition.application.pos_lt) != 0:
151 condition = var(start) < $condition.application.pos_lt
152 #end if
153 #elif str($condition.application.application_select) == "value":
154 #if float($condition.application.pos_gt) != 0:
155 condition = var(value) > $condition.application.pos_gt
156 #end if
157
158 #if float($condition.application.pos_lt) != 0:
159 condition = var(value) < $condition.application.pos_lt
160 #end if
161 #elif str($condition.application.application_select) == "var":
162 condition = var(${condition.application.varname}) ${condition.application.cond_select} "${condition.application.varvalue}"
163 #end if
164 #end for
165
166 #for $action in $rule.actions:
167 #if str($action.action.action_select) == "fill_color_value" or str($action.action.action_select) == "color_value" :
168 #set x_fill_color = $action.action.action_value
169 #set x_fill_color_count = int(str($x_fill_color).split('-')[1])
170 #set x_min = $x_fill_color_count if $action.action.invert else 1
171 #set x_max = 1 if $action.action.invert else $x_fill_color_count
172 #set color_action = "fill_color" if str($plot_type) == 'histogram' else "color"
173
174 $color_action = eval(sprintf("${action.action.action_value}-%d", remap_int(var(value), ${action.action.min_value}, ${action.action.max_value}, ${x_min}, ${x_max})))
175 #else
176 $action.action.action_select = ${action.action.action_value}
177 #end if
178 #end for
179 $rule.continue_flow
180 </rule>
181 #end for
182 </rules>
183
184 <axes>
185 #for $axis in $data.sec_axes.axes:
186 <axis>
187 color = $circosColor($axis.color)
188 thickness = ${axis.thickness}
189 spacing = ${axis.spacing}r
190 y0 = ${axis.y0}r
191 y1 = ${axis.y1}r
192 </axis>
193 #end for
194 </axes>
195 <backgrounds>
196 #for $bkg in $data.sec_bkgs.backgrounds:
197 <background>
198 color = $circosColor($bkg.color)
199 y0 = ${bkg.y0}r
200 y1 = ${bkg.y1}r
201 </background>
202 #end for
203 </backgrounds>
204 </plot>
205 #end for
206 ]]></configfile>
207 </xml>
208
209 <xml name="configfile_links_conf">
210 <configfile name="links_conf"><![CDATA[
211 #for $hi, $data in enumerate($sec_links.data):
212 <link>
213 #def circosColor($value)
214 #set $value = str($value)
215 #set $r = int($value[1:3], 16)
216 #set $g = int($value[3:5], 16)
217 #set $b = int($value[5:], 16)
218 $r, $g, $b
219 #end def
220
221 file = data/links-${hi}.txt
222
223 radius = ${data.radius}r
224 ribbon = ${data.linktype.ribbon}
225 #if $data.linktype.ribbon == 'yes'
226 ${data.linktype.twist}
227 #end if
228 color = $circosColor($data.color)
229 bezier_radius = ${data.bezier_radius}r
230 thickness = ${data.thickness}
231 crest = ${data.advanced.crest}
232 bezier_radius_purity = ${data.advanced.bezier_radius_purity}
233
234 #if $data.advanced.perturbation.perturb == 'yes'
235 perturb = yes
236 perturb_crest = ${data.advanced.perturbation.perturb_crest_min},${data.advanced.perturbation.perturb_crest_max}
237 perturb_bezier_radius = ${data.advanced.perturbation.perturb_bezier_radius_min},${data.advanced.perturbation.perturb_bezier_radius_max}
238 perturb_bezier_radius_purity = ${data.advanced.perturbation.perturb_bezier_radius_purity_min},${data.advanced.perturbation.perturb_bezier_radius_purity_max}
239 #end if
240
241 #if $data.advanced.zdepth
242 z = ${data.advanced.zdepth}
243 #end if
244
245 <rules>
246 #for $rule in $data.sec_link_rule.rules:
247 <rule>
248 #for $condition in $rule.conditions
249 #set cond = $condition.application.application_select
250 #if $cond == 'interchr' or $cond == 'intrachr' or $cond == 'inv' or $cond == 'rev'
251 condition = var($cond)
252 #elif $cond == 'always'
253 condition = 1
254 #else
255 #set op = $condition.application.comparison.compare
256 #set val = $condition.application.comparison.compval
257 #if $cond == 'chr'
258 #if $op == 'between' or $op == 'fromto'
259 #set val2 = $condition.application.comparison.compval2
260 #set c=''.join([str($op),"(",str($val),",",str($val2),")"])
261 #else
262 #set c=''.join([str($op),"(",str($val),")"])
263 #end if
264 condition = $c
265 #else
266 #if $cond == 'dist' and $op == 'lt'
267 condition = abs(var(pos1) - var(pos2)) < $val
268 #elif $cond == 'dist' and $op == 'gt'
269 condition = abs(var(pos1) - var(pos2)) > $val
270 #elif $op == 'lt'
271 condition = var($cond) < $val
272 #elif $op == 'gt'
273 condition = var($cond) > $val
274 #end if
275 #end if
276 #end if
277 #end for
278
279 #for $action in $rule.actions:
280 #set actiontype = $action.action.action_select
281 #if $actiontype == 'color':
282 #if $action.action.dynamic.dynamic_select == "static":
283 #set actionval = $circosColor($action.action.dynamic.action_value)
284 $actiontype = $actionval
285 #else
286 #set x_fill_color = $action.action.dynamic.action_value
287 #set x_fill_color_count = int(str($x_fill_color).split('-')[1])
288 #set x_min = $x_fill_color_count if $action.action.dynamic.invert else 1
289 #set x_max = 1 if $action.action.dynamic.invert else $x_fill_color_count
290
291 $actiontype = eval(sprintf("${action.action.dynamic.action_value}-%d", remap_int(var(value), ${action.action.dynamic.min_value}, ${action.action.dynamic.max_value}, ${x_min}, ${x_max})))
292 #end if
293 #elif $actiontype == 'z':
294 #if $action.action.dynamic.dynamic_select == "static":
295 #set actionval = $action.action.dynamic.action_value
296 $actiontype = $actionval
297 #else
298 #set x_min = 1000 if $action.action.dynamic.invert else 1
299 #set x_max = 1 if $action.action.dynamic.invert else 1000
300 $actiontype = eval(remap_int(var(value), ${action.action.dynamic.min_value}, ${action.action.dynamic.max_value}, ${x_min}, ${x_max}))
301 #end if
302 #else
303 #set actionval = $action.action.action_value
304 $actiontype = $actionval
305 #end if
306 #end for
307
308 $rule.continue_flow
309
310 </rule>
311 #end for
312 </rules>
313 </link>
314 #end for
315 ]]></configfile>
316 </xml>
317
318 <xml name="test_case">
319 <configfile name="test_case_conf"><![CDATA[
320 <!--
321 mkdir -p test-data/my-test-case/ &&
322 #if $reference_genome.reference_genome_source == 'history':
323 cp '${genome_fasta}' test-data/my-test-case/input.fa &&
324 #end if
325
326 #if $reference_genome.reference_genome_source != 'karyotype':
327 #if $reference_genome.bands:
328 cp '${reference_genome.bands}' test-data/my-test-case/bands.${reference_genome.bands.ext} &&
329 #end if
330 #end if
331
332 #for $idx, $data in enumerate($sec_tdd.data):
333 #if str($data.plot_format.plot_format_select) in ('histogram', 'heatmap'):
334 #for $jdx, $file in enumerate($data.plot_format.data_source):
335 cp '${file}' test-data/my-test-case/${idx}-${jdx}.${file.ext} &&
336 #end for
337 #else
338 cp '${data.plot_format.data_source}' test-data/my-test-case/${idx}.${data.plot_format.data_source.ext} &&
339 #end if
340 #end for
341 cp "$output_png" test-data/my-test-case/output.png &&
342 cp "$output_svg" test-data/my-test-case/output.svg &&
343 -->
344 <test>
345 <param name="reference_genome|reference_genome_source" value="${reference_genome.reference_genome_source}"/>
346 <param name="reference_genome|genome_fasta" value="my-test-case/input.fa" />
347 <!-- ideograms -->
348 <param name="ideogram|spacing" value="${ideogram.spacing}" />
349 <param name="ideogram|radius" value="${ideogram.radius}" />
350 <param name="ideogram|thickness" value="${ideogram.thickness}" />
351 <param name="ideogram|ideogram_labels|show_label" value="${ideogram.ideogram_labels.show_label}" />
352 <param name="ideogram|ideogram_labels|parallel" value="${ideogram.ideogram_labels.parallel}" />
353 #if $reference_genome.reference_genome_source != 'karyotype':
354 #if $reference_genome.bands:
355 <param name="reference_genome.bands" value="my-test-case/bands.${reference_genome.bands.ext}" />
356 #end if
357 #end if
358 <!-- Ticks -->
359 <param name="ticks|show_ticks" value="${ticks.show_ticks}" />
360 <param name="ticks|radius" value="${ticks.radius}" />
361 <param name="ticks|color" value="${ticks.color}" />
362 <param name="ticks|multiplier" value="${ticks.multiplier}" />
363 #for $idx, $tick_group in enumerate($ticks.tick_group):
364 <param name="ticks|tick_group_${idx}|tickspacing" value="${tick_group.spacing}" />
365 <param name="ticks|tick_group_${idx}|size" value="${tick_group.size}" />
366 <param name="ticks|tick_group_${idx}|show_tick_labels" value="${tick_group.show_tick_labels}" />
367 <param name="ticks|tick_group_${idx}|label_size" value="${tick_group.label_size}" />
368 <param name="ticks|tick_group_${idx}|label_offset" value="${tick_group.label_offset}" />
369 <param name="ticks|tick_group_${idx}|label_format" value="${tick_group.format}" />
370 #end for
371 <!-- Data -->
372 #for $idx, $data_group in enumerate($sec_tdd.data):
373 <param name="sec_tdd|data_${idx}|r0" value="${data_group.r0}" />
374 <param name="sec_tdd|data_${idx}|r1" value="${data_group.r1}" />
375 <param name="sec_tdd|data_${idx}|orientation" value="${data_group.orientation}" />
376 <param name="sec_tdd|data_${idx}|plot_format|plot_format_select" value="${data_group.plot_format.plot_format_select}" />
377 <!-- Note, please double check your files -->
378 #if str($data_group.plot_format.plot_format_select) == 'histogram':
379 #set my_files = ','.join([ "my-test-case/%s-%s.%s" % ($idx, $j, $file.ext) for ($j, $file) in enumerate($data_group.plot_format.data_source)])
380 <param name="sec_tdd|data_${idx}|plot_format|data_source" value="${my_files}" />
381 <param name="sec_tdd|data_${idx}|plot_format|format_specific|fill_color" value="${data_group.plot_format.format_specific.fill_color}" />
382 <param name="sec_tdd|data_${idx}|plot_format|format_specific|extend_bins" value="${data_group.plot_format.format_specific.extend_bins}" />
383 #else if str($data_group.plot_format.plot_format_select) == 'heatmap':
384 #set my_files = ','.join([ "my-test-case/%s-%s.%s" % ($idx, $j, $file.ext) for ($j, $file) in enumerate($data_group.plot_format.data_source)])
385 <param name="sec_tdd|data_${idx}|plot_format|data_source" value="${my_files}" />
386 <param name="sec_tdd|data_${idx}|plot_format|format_specific|fill_color" value="${data_group.plot_format.format_specific.fill_color}" />
387 <param name="sec_tdd|data_${idx}|plot_format|format_specific|scale_log_base" value="${data_group.plot_format.format_specific.scale_log_base}" />
388 #else if str($data_group.plot_format.plot_format_select) == 'line':
389 <param name="sec_tdd|data_${idx}|plot_format|data_source" value="my-test-case/${idx}.${data.plot_format.data_source.ext}" />
390 <param name="sec_tdd|data_${idx}|plot_format|format_specific|color" value="${data_group.plot_format.format_specific.color}" />
391 <param name="sec_tdd|data_${idx}|plot_format|format_specific|stroke" value="${data_group.plot_format.format_specific.stroke}" />
392 #else if str($data_group.plot_format.plot_format_select) == 'scatter':
393 <param name="sec_tdd|data_${idx}|plot_format|data_source" value="my-test-case/${idx}.${data.plot_format.data_source.ext}" />
394 <param name="sec_tdd|data_${idx}|plot_format|format_specific|glyph" value="${data_group.plot_format.format_specific.glyph}" />
395 <param name="sec_tdd|data_${idx}|plot_format|format_specific|glyph_size" value="${data_group.plot_format.format_specific.glyph_size}" />
396 <param name="sec_tdd|data_${idx}|plot_format|format_specific|data_min" value="${data_group.plot_format.format_specific.data_min}" />
397 <param name="sec_tdd|data_${idx}|plot_format|format_specific|data_max" value="${data_group.plot_format.format_specific.data_max}" />
398 <param name="sec_tdd|data_${idx}|plot_format|format_specific|color" value="${data_group.plot_format.format_specific.color}" />
399 <param name="sec_tdd|data_${idx}|plot_format|format_specific|stroke_color" value="${data_group.plot_format.format_specific.stroke_color}" />
400 <param name="sec_tdd|data_${idx}|plot_format|format_specific|stroke_thickness" value="${data_group.plot_format.format_specific.stroke_thickness}" />
401 #else if str($data_group.plot_format.plot_format_select) == 'tile':
402 <param name="sec_tdd|data_${idx}|plot_format|data_source" value="my-test-case/${idx}.${data.plot_format.data_source.ext}" />
403 <param name="sec_tdd|data_${idx}|plot_format|format_specific|fill_color" value="${data_group.plot_format.format_specific.fill_color}" />
404 <param name="sec_tdd|data_${idx}|plot_format|format_specific|color" value="${data_group.plot_format.format_specific.color}" />
405 <param name="sec_tdd|data_${idx}|plot_format|format_specific|stroke_thickness" value="${data_group.plot_format.format_specific.stroke_thickness}" />
406 <param name="sec_tdd|data_${idx}|plot_format|format_specific|layers" value="${data_group.plot_format.format_specific.layers}" />
407 <param name="sec_tdd|data_${idx}|plot_format|format_specific|thickness" value="${data_group.plot_format.format_specific.thickness}" />
408 <param name="sec_tdd|data_${idx}|plot_format|format_specific|padding" value="${data_group.plot_format.format_specific.padding}" />
409 <param name="sec_tdd|data_${idx}|plot_format|format_specific|overflow|overflow_behavior" value="${data_group.plot_format.format_specific.overflow.overflow_behavior}" />
410 #if str($data_group.plot_format.format_specific.overflow.overflow_behavior) != 'hide':
411 <param name="sec_tdd|data_${idx}|plot_format|format_specific|overflow|layer_overflow_color" value="${data_group.plot_format.format_specific.overflow.layer_overflow_color}" />
412 #end if
413 #end if
414 ## Next line intentionally blank
415
416 #end for
417
418 <!-- Outputs -->
419 <output name="output_png" file="my-test-case/output.png" />
420 <output name="output_svg" file="my-test-case/output.svg" />
421 </test>
422 ]]></configfile>
423 </xml>
424 </macros>