comparison macros_conffiles.xml @ 6:b84d385679e2 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 1584882716a1d2c598e8485da9d73bcf80d9b29a"
author iuc
date Fri, 01 May 2020 11:28:11 +0000
parents 5d7a5119a8e7
children
comparison
equal deleted inserted replaced
5:5d7a5119a8e7 6:b84d385679e2
4 <configfile name="circos_conf"><![CDATA[ 4 <configfile name="circos_conf"><![CDATA[
5 @UTILS@ 5 @UTILS@
6 6
7 <<include colors_fonts_patterns.conf>> 7 <<include colors_fonts_patterns.conf>>
8 <<include housekeeping.conf>> 8 <<include housekeeping.conf>>
9
10 max_ticks* = ${limits.max_ticks}
11 max_ideograms* = ${limits.max_ideograms}
12 max_links* = ${limits.max_links}
13 max_points_per_track* = ${limits.max_points_per_track}
9 14
10 <colors> 15 <colors>
11 <<include karyotype-colors.conf>> 16 <<include karyotype-colors.conf>>
12 17
13 #for $hi, $data in enumerate($sec_tdd.data): 18 #for $hi, $data in enumerate($sec_tdd.data):
48 #end if 53 #end if
49 #if $outputs.svg: 54 #if $outputs.svg:
50 svg = yes 55 svg = yes
51 #end if 56 #end if
52 # by default angle = 0 is at 3 o'clock position 57 # by default angle = 0 is at 3 o'clock position
53 angle_offset = -90 58 angle_offset = ${ideogram.angle_offset}
59 angle_orientation = ${ideogram.angle_orientation}
54 auto_alpha_colors = yes 60 auto_alpha_colors = yes
55 auto_alpha_steps = 5 61 auto_alpha_steps = 5
56 #if str($plot_options.background.background_select) == 'transparent': 62 #if str($plot_options.background.background_select) == 'transparent':
57 background = transparent 63 background = transparent
58 #else 64 #else
59 background = $circosColor($plot_options.background.background_color) 65 background = $circosColor($plot_options.background.background_color)
60 #end if 66 #end if
61 radius* = ${plot_options.radius}p 67 radius* = ${plot_options.radius}p
62 </image> 68 </image>
63 69
70 <zooms>
71 #for zoom in $scaling.zooms:
72 <zoom>
73 chr = ${zoom.chr}
74 start = ${zoom.start}u
75 end = ${zoom.end}u
76 scale = ${zoom.scale}
77 </zoom>
78 #end for
79 </zooms>
80
64 <<include ticks.conf>> 81 <<include ticks.conf>>
65 <<include ideogram.conf>> 82 <<include ideogram.conf>>
66 <<include data.conf>> 83 <<include data.conf>>
67 <<include highlight.conf>>
68 <<include links.conf>> 84 <<include links.conf>>
69 85
70 ]]></configfile> 86 ]]></configfile>
71 </xml> 87 </xml>
72 <xml name="configfile_ticks_conf"> 88 <xml name="configfile_ticks_conf">
73 <configfile name="ticks_conf"><![CDATA[ 89 <configfile name="ticks_conf"><![CDATA[
74 @UTILS@ 90 @UTILS@
75 91
76 show_ticks = ${ticks.show_ticks} 92 show_ticks = yes
77 show_tick_labels = yes 93 show_tick_labels = yes
78 94
79 95
80 <ticks> 96 <ticks>
81 radius = ${ticks.radius}r 97 radius = ${ticks.radius}r
95 multiplier = 1e-9 111 multiplier = 1e-9
96 #end if 112 #end if
97 113
98 #for $tick_group in $ticks.tick_group: 114 #for $tick_group in $ticks.tick_group:
99 <tick> 115 <tick>
100 spacing = ${tick_group.spacing} 116 spacing = ${tick_group.spacing}u
101 size = ${tick_group.size}p 117 size = ${tick_group.size}p
102 show_label = ${tick_group.ticks.show_tick_labels} 118 show_label = ${tick_group.ticks.show_tick_labels}
103 color = $circosColor($tick_group.color) 119 color = $circosColor($tick_group.color)
104 120
105 #if str($tick_group.ticks.show_tick_labels) == 'yes': 121 #if str($tick_group.ticks.show_tick_labels) == 'yes':
129 <configfile name="ideogram_conf"><![CDATA[ 145 <configfile name="ideogram_conf"><![CDATA[
130 @UTILS@ 146 @UTILS@
131 <ideogram> 147 <ideogram>
132 <spacing> 148 <spacing>
133 ## spacing between ideograms 149 ## spacing between ideograms
134 default = ${ideogram.spacing}r 150 default = ${ideogram.spacing}u
151
152 #for pairwise in $ideogram.pairwise_spacing
153 <pairwise ${pairwise.chr1} ${pairwise.chr2}>
154 spacing = ${pairwise.spacing}u
155 </pairwise>
156 #end for
135 </spacing> 157 </spacing>
136 158
137 # ideogram position, thickness and fill 159 # ideogram position, thickness and fill
138 radius = ${ideogram.radius}r 160 radius = ${ideogram.radius}r
139 thickness = ${ideogram.thickness}p 161 thickness = ${ideogram.thickness}p
141 show_label = ${ideogram.ideogram_labels.show_label} 163 show_label = ${ideogram.ideogram_labels.show_label}
142 label_radius = dims(ideogram,radius) + ${ideogram.ideogram_labels.radius_offset}r 164 label_radius = dims(ideogram,radius) + ${ideogram.ideogram_labels.radius_offset}r
143 label_size = ${ideogram.ideogram_labels.size} 165 label_size = ${ideogram.ideogram_labels.size}
144 label_parallel = ${ideogram.ideogram_labels.parallel} 166 label_parallel = ${ideogram.ideogram_labels.parallel}
145 167
146 #if $ideogram.bands.bands: 168 #if $ideogram.bands.show_bands:
147 show_bands = yes 169 show_bands = yes
148 #else 170 #else
149 show_bands = no 171 show_bands = no
150 #end if 172 #end if
151 fill_bands = ${ideogram.bands.fill_bands} 173 fill_bands = ${ideogram.bands.fill_bands}
155 band_stroke_color = $circosColor($ideogram.bands.band_stroke_color) 177 band_stroke_color = $circosColor($ideogram.bands.band_stroke_color)
156 band_stroke_thickness = ${ideogram.bands.band_stroke_thickness} 178 band_stroke_thickness = ${ideogram.bands.band_stroke_thickness}
157 </ideogram> 179 </ideogram>
158 ]]></configfile> 180 ]]></configfile>
159 </xml> 181 </xml>
160 <xml name="configfile_highlight_conf">
161 <configfile name="highlight_conf"><![CDATA[
162 @UTILS@
163 <highlights>
164 #for $hi, $data in enumerate($sec_highlight.data):
165 <highlight>
166 file = data/highlight-${hi}.txt # ${data.data_source.element_identifier}
167 r1 = ${data.r1}r
168 r0 = ${data.r0}r
169 fill_color = $circosColorAlpha($data.fill_color, $data.fill_color_alpha)
170 stroke_color = $circosColorAlpha($data.stroke_color, $data.stroke_color_alpha)
171 stroke_thickness = ${data.stroke_thickness}
172
173 <rules>
174 #for $rule in $data.sec_rule.rules:
175 <rule>
176 #for $condition in $rule.conditions
177 #if str($condition.application.application_select) == "1":
178 condition = 1
179 #elif str($condition.application.application_select) == "on":
180 condition = on($condition.application.on_genomes)
181 #elif str($condition.application.application_select) == "pos":
182 #if $condition.application.pos_gt:
183 condition = var(start) > $condition.application.pos_gt
184 #end if
185
186 #if $condition.application.pos_lt:
187 #if $condition.application.pos_lt_sub == 'yes':
188 condition = var(end) < chrlen(var(chr)) - $condition.application.pos_lt
189 #else
190 condition = var(end) < $condition.application.pos_lt
191 #end if
192 #end if
193 #elif str($condition.application.application_select) == "value":
194 #if $condition.application.pos_gt:
195 condition = var(value) > $condition.application.pos_gt
196 #end if
197
198 #if $condition.application.pos_lt:
199 condition = var(value) < $condition.application.pos_lt
200 #end if
201 #elif str($condition.application.application_select) == "var":
202 condition = var(${condition.application.varname}) ${condition.application.cond_select} "${condition.application.varvalue}"
203 #elif str($condition.application.application_select) == "random":
204 condition = rand() < ${condition.application.value}
205 #end if
206 #end for
207
208 #for $action in $rule.actions:
209 #if str($action.action.action_select) == "fill_color_value" or str($action.action.action_select) == "color_value" :
210 #set x_fill_color = $action.action.action_value
211 #set x_fill_color_count = int(str($x_fill_color).split('-')[1])
212 #set x_min = $x_fill_color_count if $action.action.invert else 1
213 #set x_max = 1 if $action.action.invert else $x_fill_color_count
214 #set color_action = "fill_color" if str($plot_type) in ('histogram', 'histogram-stacked') else "color"
215
216 $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})))
217 #else
218 $action.action.action_select = $circosColor($action.action.action_value)
219 #end if
220 #end for
221 $rule.continue_flow
222 </rule>
223 #end for
224 </rules>
225 </highlight>
226 #end for
227 </highlights>
228 ]]></configfile>
229 </xml>
230
231 182
232 <xml name="configfile_data_conf"> 183 <xml name="configfile_data_conf">
233 <configfile name="data_conf"><![CDATA[ 184 <configfile name="data_conf"><![CDATA[
234 <plots> 185 <plots>
235 @UTILS@ 186 @UTILS@
238 <plot> 189 <plot>
239 #set plot_type = str($data.plot_format.plot_format_select) 190 #set plot_type = str($data.plot_format.plot_format_select)
240 file = data/data-${hi}.txt # ${data.plot_format.data_source.element_identifier} 191 file = data/data-${hi}.txt # ${data.plot_format.data_source.element_identifier}
241 r1 = ${data.r1}r 192 r1 = ${data.r1}r
242 r0 = ${data.r0}r 193 r0 = ${data.r0}r
194 #if str($data.zdepth) != '':
195 z = ${data.zdepth}
196 #end if
243 orientation = ${data.orientation} 197 orientation = ${data.orientation}
244 #if str($data.minmax.minmax_select) == 'yes': 198 #if str($data.minmax.minmax_select) == 'yes':
245 min = ${$data.minmax.min_value} 199 min = ${$data.minmax.min_value}
246 max = ${$data.minmax.max_value} 200 max = ${$data.minmax.max_value}
247 #end if 201 #end if
202 minsize = ${data.minsize}u
248 203
249 #if str($plot_type) in ('histogram', 'histogram-stacked'): 204 #if str($plot_type) in ('histogram', 'histogram-stacked'):
250 type = histogram 205 type = histogram
251 extend_bin = ${data.plot_format.format_specific.extend_bins} 206 extend_bin = ${data.plot_format.format_specific.extend_bins}
252 #if str($plot_type) == 'histogram': 207 #if str($plot_type) == 'histogram':
255 fill_color = $data.plot_format.format_specific.fill_color 210 fill_color = $data.plot_format.format_specific.fill_color
256 #end if 211 #end if
257 fill_under = ${data.plot_format.format_specific.fill_under} 212 fill_under = ${data.plot_format.format_specific.fill_under}
258 color = $circosColorAlpha($data.plot_format.format_specific.stroke_color, $data.plot_format.format_specific.stroke_color_alpha) 213 color = $circosColorAlpha($data.plot_format.format_specific.stroke_color, $data.plot_format.format_specific.stroke_color_alpha)
259 thickness = ${data.plot_format.format_specific.stroke_thickness} 214 thickness = ${data.plot_format.format_specific.stroke_thickness}
215 #else if str($plot_type) == 'highlight':
216 type = ${plot_type}
217 fill_color = $circosColorAlpha($data.plot_format.format_specific.fill_color, $data.plot_format.format_specific.fill_color_alpha)
218 color = $circosColorAlpha($data.plot_format.format_specific.stroke_color, $data.plot_format.format_specific.stroke_color_alpha)
219 thickness = ${data.plot_format.format_specific.stroke_thickness}
260 #else if str($plot_type) == 'heatmap': 220 #else if str($plot_type) == 'heatmap':
261 type = ${plot_type} 221 type = ${plot_type}
262 color = ${data.plot_format.format_specific.fill_color} 222 color = ${data.plot_format.format_specific.color_scale.fill_color}
223 color_mapping = ${data.plot_format.format_specific.color_mapping} # http://www.circos.ca/documentation/tutorials/2d_tracks/heat_maps/
263 scale_log_base = ${data.plot_format.format_specific.scale_log_base} 224 scale_log_base = ${data.plot_format.format_specific.scale_log_base}
225 stroke_color = $circosColorAlpha($data.plot_format.format_specific.stroke_color, $data.plot_format.format_specific.stroke_color_alpha)
226 stroke_thickness = ${data.plot_format.format_specific.stroke_thickness}
264 #else if str($plot_type) == 'line': 227 #else if str($plot_type) == 'line':
265 type = ${plot_type} 228 type = ${plot_type}
266 color = $circosColor($data.plot_format.format_specific.stroke_color) 229 color = $circosColorAlpha($data.plot_format.format_specific.stroke_color, $data.plot_format.format_specific.stroke_color_alpha)
267 thickness = ${data.plot_format.format_specific.stroke_thickness} 230 thickness = ${data.plot_format.format_specific.stroke_thickness}
231 #else if str($plot_type) == 'connector':
232 type = ${plot_type}
233 color = $circosColorAlpha($data.plot_format.format_specific.stroke_color, $data.plot_format.format_specific.stroke_color_alpha)
234 thickness = ${data.plot_format.format_specific.stroke_thickness}
235 connector_dims = ${data.plot_format.format_specific.connector_dims}
268 #else if str($plot_type) == 'scatter': 236 #else if str($plot_type) == 'scatter':
269 type = ${plot_type} 237 type = ${plot_type}
270 glyph = ${data.plot_format.format_specific.glyph} 238 glyph = ${data.plot_format.format_specific.glyph}
271 glyph_size = ${data.plot_format.format_specific.glyph_size} 239 glyph_size = ${data.plot_format.format_specific.glyph_size}
272 # So this option is ignored, and we have added an always-on rule in the 240 # So this option is ignored, and we have added an always-on rule in the
274 # only accept named colours, while you can override the colour in a rule 242 # only accept named colours, while you can override the colour in a rule
275 # block with an RGB colour. 243 # block with an RGB colour.
276 # 244 #
277 # Additionally it is named "color" in a scatter track whilst in the rule 245 # Additionally it is named "color" in a scatter track whilst in the rule
278 # you must override it with "fill_color" 246 # you must override it with "fill_color"
279 color = $circosColor($data.plot_format.format_specific.fill_color) 247 color = $circosColorAlpha($data.plot_format.format_specific.fill_color, $data.plot_format.format_specific.fill_color_alpha)
280 stroke_color = $circosColor($data.plot_format.format_specific.stroke_color) 248 stroke_color = $circosColorAlpha($data.plot_format.format_specific.stroke_color, $data.plot_format.format_specific.stroke_color_alpha)
281 stroke_thickness = ${data.plot_format.format_specific.stroke_thickness} 249 stroke_thickness = ${data.plot_format.format_specific.stroke_thickness}
282 #else if str($plot_type) == 'tile': 250 #else if str($plot_type) == 'tile':
283 type = ${plot_type} 251 type = ${plot_type}
284 color = color-tile-$hi 252 color = color-tile-$hi
285 stroke_color = $circosColor($data.plot_format.format_specific.stroke_color) 253 stroke_color = $circosColorAlpha($data.plot_format.format_specific.stroke_color, $data.plot_format.format_specific.stroke_color_alpha)
286 stroke_thickness = ${data.plot_format.format_specific.stroke_thickness} 254 stroke_thickness = ${data.plot_format.format_specific.stroke_thickness}
287 layers = ${data.plot_format.format_specific.layers} 255 layers = ${data.plot_format.format_specific.layers}
288 thickness = ${data.plot_format.format_specific.thickness} 256 thickness = ${data.plot_format.format_specific.thickness}
289 padding = ${data.plot_format.format_specific.padding} 257 padding = ${data.plot_format.format_specific.padding}
290 margin = ${data.plot_format.format_specific.margin}u 258 margin = ${data.plot_format.format_specific.margin}u
322 <rules> 290 <rules>
323 #if str($plot_type) == 'scatter': 291 #if str($plot_type) == 'scatter':
324 <rule> 292 <rule>
325 # Workaround for above commented colour bug. 293 # Workaround for above commented colour bug.
326 condition = 1 294 condition = 1
327 fill_color = $circosColor($data.plot_format.format_specific.fill_color) 295 fill_color = $circosColorAlpha($data.plot_format.format_specific.fill_color, $data.plot_format.format_specific.fill_color_alpha)
328 flow = continue 296 flow = continue
329 </rule> 297 </rule>
330 #end if 298 #end if
331 #for $rule in $data.sec_rule.rules: 299 #for $rule in $data.sec_rule.rules:
332 <rule> 300 <rule>
333 #for $condition in $rule.conditions 301 #for $condition in $rule.conditions
334 #if str($condition.application.application_select) == "1": 302 #set cond = $condition.application.application_select
303 #if $cond == "always":
335 condition = 1 304 condition = 1
336 #elif str($condition.application.application_select) == "on": 305 #elif $cond == 'random'
306 condition = rand() < ${condition.application.value}
307 #elif $cond == "on":
337 #set on_str = ' '.join([ "on(%s)" % $chr.strip() for $chr in $condition.application.on_genomes.split(',') ]) 308 #set on_str = ' '.join([ "on(%s)" % $chr.strip() for $chr in $condition.application.on_genomes.split(',') ])
338 condition = $on_str 309 condition = $on_str
339 #elif str($condition.application.application_select) == "pos": 310 #elif $cond == "pos":
340 #if $condition.application.pos_gt: 311 #if str($condition.application.pos_gt) != '':
341 condition = var(start) > $condition.application.pos_gt 312 condition = var(start) > $condition.application.pos_gt
342 #end if 313 #end if
343 314
344 #if $condition.application.pos_lt: 315 #if str($condition.application.pos_lt) != '':
345 condition = var(start) < $condition.application.pos_lt 316 condition = var(start) < $condition.application.pos_lt
346 #end if 317 #end if
347 #elif str($condition.application.application_select) == "value": 318 #elif $cond == "value":
348 #if $condition.application.pos_gt: 319 #if str($condition.application.pos_gt) != '':
349 condition = var(value) > $condition.application.pos_gt 320 condition = var(value) > $condition.application.pos_gt
350 #end if 321 #end if
351 322
352 #if $condition.application.pos_lt: 323 #if str($condition.application.pos_lt) != '':
353 condition = var(value) < $condition.application.pos_lt 324 condition = var(value) < $condition.application.pos_lt
354 #end if 325 #end if
355 #elif str($condition.application.application_select) == "var": 326 #elif $cond == "var":
356 condition = var(${condition.application.varname}) ${condition.application.cond_select} "${condition.application.varvalue}" 327 condition = var(${condition.application.varname}) ${condition.application.cond_select} "${condition.application.varvalue}"
328 #else
329 condition = 0 # Error: the Galaxy devs forgot a case
357 #end if 330 #end if
358 #end for 331 #end for
359 332
360 #for $action in $rule.actions: 333 #for $action in $rule.actions:
361 #if str($action.action.action_select) == "fill_color_value" or str($action.action.action_select) == "color_value" : 334 #if str($action.action.action_select) == "fill_color_value" or str($action.action.action_select) == "color_value" :
384 </rule> 357 </rule>
385 #end for 358 #end for
386 </rules> 359 </rules>
387 360
388 <axes> 361 <axes>
362 #if str($data.sec_axes.only_if_data) == "data":
363 show = data
364 #end if
389 #for $axis in $data.sec_axes.axes: 365 #for $axis in $data.sec_axes.axes:
390 <axis> 366 <axis>
391 color = $circosColor($axis.color) 367 color = $circosColorAlpha($axis.color, $axis.color_alpha)
392 thickness = ${axis.thickness} 368 thickness = ${axis.thickness}
393 spacing = ${axis.spacing}r 369 #if str($axis.radial_position.select) == 'plot':
370 spacing = ${axis.radial_position.spacing}r
394 y0 = ${axis.y0}r 371 y0 = ${axis.y0}r
395 y1 = ${axis.y1}r 372 y1 = ${axis.y1}r
373 #else:
374 spacing = ${axis.radial_position.spacing}
375 y0 = ${axis.y0}
376 y1 = ${axis.y1}
377 #end if
396 </axis> 378 </axis>
397 #end for 379 #end for
398 </axes> 380 </axes>
399 <backgrounds> 381 <backgrounds>
382 #if str($data.sec_bkgs.only_if_data) == "data":
383 show = data
384 #end if
400 #for $bkg in $data.sec_bkgs.backgrounds: 385 #for $bkg in $data.sec_bkgs.backgrounds:
401 <background> 386 <background>
402 color = $circosColor($bkg.color) 387 color = $circosColorAlpha($bkg.color, $bkg.color_alpha)
403 y0 = ${bkg.y0}r 388 #if str($bkg.radial_position.select) == 'plot':
404 y1 = ${bkg.y1}r 389 y0 = ${bkg.radial_position.y0}r
390 y1 = ${bkg.radial_position.y1}r
391 #else:
392 y0 = ${bkg.radial_position.y0}
393 y1 = ${bkg.radial_position.y1}
394 #end if
405 </background> 395 </background>
406 #end for 396 #end for
407 </backgrounds> 397 </backgrounds>
408 </plot> 398 </plot>
409 #end for 399 #end for
417 <links> 407 <links>
418 #for $hi, $data in enumerate($sec_links.data): 408 #for $hi, $data in enumerate($sec_links.data):
419 <link> 409 <link>
420 file = data/links-${hi}.txt # ${data.data_source.element_identifier} 410 file = data/links-${hi}.txt # ${data.data_source.element_identifier}
421 radius = ${data.radius}r 411 radius = ${data.radius}r
412 z = ${data.zdepth}
422 ribbon = ${data.linktype.ribbon} 413 ribbon = ${data.linktype.ribbon}
414 minsize = ${data.minsize}u
423 #if $data.linktype.ribbon == 'yes' 415 #if $data.linktype.ribbon == 'yes'
424 ${data.linktype.twist} 416 ${data.linktype.twist}
425 #if $data.linktype.pattern != 'solid': 417 #if $data.linktype.pattern != 'solid':
426 pattern = ${data.linktype.pattern} 418 pattern = ${data.linktype.pattern}
427 #end if 419 #end if
435 perturb = yes 427 perturb = yes
436 perturb_crest = ${data.advanced.perturbation.perturb_crest_min},${data.advanced.perturbation.perturb_crest_max} 428 perturb_crest = ${data.advanced.perturbation.perturb_crest_min},${data.advanced.perturbation.perturb_crest_max}
437 perturb_bezier_radius = ${data.advanced.perturbation.perturb_bezier_radius_min},${data.advanced.perturbation.perturb_bezier_radius_max} 429 perturb_bezier_radius = ${data.advanced.perturbation.perturb_bezier_radius_min},${data.advanced.perturbation.perturb_bezier_radius_max}
438 perturb_bezier_radius_purity = ${data.advanced.perturbation.perturb_bezier_radius_purity_min},${data.advanced.perturbation.perturb_bezier_radius_purity_max} 430 perturb_bezier_radius_purity = ${data.advanced.perturbation.perturb_bezier_radius_purity_min},${data.advanced.perturbation.perturb_bezier_radius_purity_max}
439 #end if 431 #end if
440 #if $data.advanced.zdepth
441 z = ${data.advanced.zdepth}
442 #end if
443 432
444 <rules> 433 <rules>
445 #for $rule in $data.sec_link_rule.rules: 434 #for $rule in $data.sec_link_rule.rules:
446 <rule> 435 <rule>
447 #for $condition in $rule.conditions 436 #for $condition in $rule.conditions
448 #set cond = $condition.application.application_select 437 #set cond = $condition.application.application_select
449 #if $cond == 'interchr' or $cond == 'intrachr' or $cond == 'inv' or $cond == 'rev' 438 #if $cond == 'always'
450 condition = var($cond)
451 #elif $cond == 'always'
452 condition = 1 439 condition = 1
453 #elif $cond == 'random' 440 #elif $cond == 'random'
454 condition = rand() < ${condition.application.value} 441 condition = rand() < ${condition.application.value}
442 #elif $cond == 'interchr' or $cond == 'intrachr' or $cond == 'inv' or $cond == 'rev'
443 condition = var($cond)
455 #else 444 #else
456 #set op = $condition.application.comparison.compare 445 #set op = $condition.application.comparison.compare
457 #set val = $condition.application.comparison.compval 446 #set val = $condition.application.comparison.compval
458 #if $cond == 'chr' 447 #if $cond == 'chr'
459 #if $op == 'between' or $op == 'fromto' 448 #if $op == 'between' or $op == 'fromto'
460 #set val2 = $condition.application.comparison.compval2 449 #set val2 = $condition.application.comparison.compval2
461 #set c=''.join([str($op),"(",str($val),",",str($val2),")"]) 450 condition = ${op}(${val}, ${val2})
462 #elif $op == 'on' 451 #elif $op == 'on'
463 #set c='(var(chr1) eq "%s" or var(chr2) eq "%s")' % (str($val), str($val)) 452 condition = var(chr1) eq "${val}" or var(chr2) eq "${val}"
464 #else 453 #else
465 #set c=''.join([str($op),"(",str($val),")"]) 454 condition = ${op}(${val})
466 #end if 455 #end if
467 condition = $c
468 #else 456 #else
469 #if $cond == 'dist' and $op == 'lt' 457 #if $cond == 'dist' and $op == 'lt'
470 condition = abs(var(pos1) - var(pos2)) < $val 458 condition = abs(var(pos1) - var(pos2)) < $val
471 #elif $cond == 'dist' and $op == 'gt' 459 #elif $cond == 'dist' and $op == 'gt'
472 condition = abs(var(pos1) - var(pos2)) > $val 460 condition = abs(var(pos1) - var(pos2)) > $val
479 #end if 467 #end if
480 #end for 468 #end for
481 469
482 #for $action in $rule.actions: 470 #for $action in $rule.actions:
483 #set actiontype = $action.action.action_select 471 #set actiontype = $action.action.action_select
484 #if $actiontype == 'color': 472 #if $actiontype in ('color', 'stroke_color'):
485 #if $action.action.dynamic.dynamic_select == "static": 473 #if $action.action.dynamic.dynamic_select == "static":
486 #set actionval = $circosColorAlpha($action.action.dynamic.action_value, $action.action.dynamic.action_value_alpha) 474 #set actionval = $circosColorAlpha($action.action.dynamic.action_value, $action.action.dynamic.action_value_alpha)
487 $actiontype = $actionval 475 $actiontype = $actionval
488 #else 476 #elif $action.action.dynamic.dynamic_select == 'source':
489 #set x_fill_color = $action.action.dynamic.action_value 477 $actiontype = eval(var(chr1))
490 #set x_fill_color_count = int(str($x_fill_color).split('-')[1]) 478 #elif $action.action.dynamic.dynamic_select == 'dest':
491 #set x_min = $x_fill_color_count if $action.action.dynamic.invert else 1 479 $actiontype = eval(var(chr2))
492 #set x_max = 1 if $action.action.dynamic.invert else $x_fill_color_count
493
494 $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})))
495 #end if 480 #end if
496 #elif $actiontype == 'z': 481 #elif $actiontype == 'z':
497 #if $action.action.dynamic.dynamic_select == "static": 482 #if $action.action.dynamic.dynamic_select == "static":
498 #set actionval = $action.action.dynamic.action_value 483 $actiontype = ${action.action.dynamic.action_value}
499 $actiontype = $actionval
500 #else 484 #else
501 #set x_min = 1000 if $action.action.dynamic.invert else 1 485 #set x_min = 1000 if $action.action.dynamic.invert else 1
502 #set x_max = 1 if $action.action.dynamic.invert else 1000 486 #set x_max = 1 if $action.action.dynamic.invert else 1000
503 $actiontype = eval(remap_int(var(value), ${action.action.dynamic.min_value}, ${action.action.dynamic.max_value}, ${x_min}, ${x_max})) 487 $actiontype = eval(remap_int(var(value), ${action.action.dynamic.min_value}, ${action.action.dynamic.max_value}, ${x_min}, ${x_max}))
504 #end if 488 #end if
489 #elif $actiontype == 'value_from_attr':
490 value = var(${action.action.action_value})
505 #else 491 #else
506 #set actionval = $action.action.action_value 492 $actiontype = ${action.action.action_value}
507 $actiontype = $actionval
508 #end if 493 #end if
509 #end for 494 #end for
510 495
511 $rule.continue_flow 496 $rule.continue_flow
512 497