Mercurial > repos > iuc > circos
comparison macros_conffiles.xml @ 2:890ef899a3d7 draft
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 076837a2e9c2b6ececcea4aa286ea7a412387a96"
| author | iuc |
|---|---|
| date | Tue, 17 Sep 2019 16:54:24 -0400 |
| parents | 8464186c8503 |
| children | 6d45ebe16927 |
comparison
equal
deleted
inserted
replaced
| 1:95664f8de269 | 2:890ef899a3d7 |
|---|---|
| 1 <?xml version="1.0"?> | 1 <?xml version="1.0"?> |
| 2 <macros> | 2 <macros> |
| 3 <xml name="configfile_circos_conf"> | 3 <xml name="configfile_circos_conf"> |
| 4 <configfile name="circos_conf"><![CDATA[ | 4 <configfile name="circos_conf"><![CDATA[ |
| 5 @UTILS@ | |
| 6 | |
| 5 <<include colors_fonts_patterns.conf>> | 7 <<include colors_fonts_patterns.conf>> |
| 6 <<include housekeeping.conf>> | 8 <<include housekeeping.conf>> |
| 9 | |
| 10 <colors> | |
| 11 <<include karyotype-colors.conf>> | |
| 12 | |
| 13 #for $hi, $data in enumerate($sec_tdd.data): | |
| 14 #set plot_type = str($data.plot_format.plot_format_select) | |
| 15 #if str($plot_type) == 'tile': | |
| 16 color-tile-$hi = $circosColor($data.plot_format.format_specific.fill_color) | |
| 17 #end if | |
| 18 #end for | |
| 19 </colors> | |
| 20 | |
| 7 karyotype = karyotype.txt | 21 karyotype = karyotype.txt |
| 22 #if str($ideogram.units) == 'bases': | |
| 23 chromosomes_units = 1 | |
| 24 #else if str($ideogram.units) == 'kb': | |
| 25 chromosomes_units = 1000 | |
| 26 #else if str($ideogram.units) == 'mb': | |
| 27 chromosomes_units = 1000000 | |
| 28 #else: | |
| 29 chromosomes_units = 1000000000 | |
| 30 #end if | |
| 31 | |
| 32 #if $ideogram.limit_chromosomes: | |
| 33 chromosomes = $ideogram.limit_chromosomes | |
| 34 chromosomes_order = $chromosomesToOrder($ideogram.limit_chromosomes) | |
| 35 chromosomes_display_default = no | |
| 36 #end if | |
| 37 | |
| 38 #if $ideogram.chromosomes_reverse: | |
| 39 chromosomes_reverse = $ideogram.chromosomes_reverse | |
| 40 #end if | |
| 8 | 41 |
| 9 <image> | 42 <image> |
| 10 <<include etc/image.conf>> | 43 # Transcluded from etc/image.generic.conf |
| 44 dir = . | |
| 45 file = circos.png | |
| 46 #if $outputs.png: | |
| 47 png = yes | |
| 48 #end if | |
| 49 #if $outputs.svg: | |
| 50 svg = yes | |
| 51 #end if | |
| 52 # by default angle = 0 is at 3 o'clock position | |
| 53 angle_offset = -90 | |
| 54 auto_alpha_colors = yes | |
| 55 auto_alpha_steps = 5 | |
| 56 #if str($plot_options.background.background_select) == 'transparent': | |
| 57 background = transparent | |
| 58 #else | |
| 59 background = $circosColor($plot_options.background.background_color) | |
| 60 #end if | |
| 61 radius* = ${plot_options.radius}p | |
| 11 </image> | 62 </image> |
| 12 | 63 |
| 13 <<include ticks.conf>> | 64 <<include ticks.conf>> |
| 14 <<include ideogram.conf>> | 65 <<include ideogram.conf>> |
| 15 <plots> | 66 <<include data.conf>> |
| 16 <<include 2d.conf>> | 67 <<include highlight.conf>> |
| 17 </plots> | 68 <<include links.conf>> |
| 18 <links> | |
| 19 <<include links.conf>> | |
| 20 </links> | |
| 21 | 69 |
| 22 ]]></configfile> | 70 ]]></configfile> |
| 23 </xml> | 71 </xml> |
| 24 <xml name="configfile_ticks_conf"> | 72 <xml name="configfile_ticks_conf"> |
| 25 <configfile name="ticks_conf"><![CDATA[ | 73 <configfile name="ticks_conf"><![CDATA[ |
| 74 @UTILS@ | |
| 75 | |
| 26 show_ticks = ${ticks.show_ticks} | 76 show_ticks = ${ticks.show_ticks} |
| 27 show_tick_labels = yes | 77 show_tick_labels = yes |
| 28 | 78 |
| 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 | 79 |
| 38 <ticks> | 80 <ticks> |
| 39 radius = ${ticks.radius}r | 81 radius = ${ticks.radius}r |
| 40 color = $circosColor($ticks.color) | 82 color = black |
| 83 skip_first_label = ${ticks.skip_first_label} | |
| 84 skip_last_label = ${ticks.skip_last_label} | |
| 41 thickness = 2p | 85 thickness = 2p |
| 42 multiplier = ${ticks.multiplier} | 86 |
| 87 # Multiplier controls how 'u' behaves when used in numbers. | |
| 88 #if str($ideogram.units) == 'bases': | |
| 89 multiplier = 1 | |
| 90 #else if str($ideogram.units) == 'kb': | |
| 91 multiplier = 1e-3 | |
| 92 #else if str($ideogram.units) == 'mb': | |
| 93 multiplier = 1e-6 | |
| 94 #else if str($ideogram.units) == 'gb': | |
| 95 multiplier = 1e-9 | |
| 96 #end if | |
| 43 | 97 |
| 44 #for $tick_group in $ticks.tick_group: | 98 #for $tick_group in $ticks.tick_group: |
| 45 <tick> | 99 <tick> |
| 46 spacing = ${tick_group.spacing} | 100 spacing = ${tick_group.spacing} |
| 47 size = ${tick_group.size}p | 101 size = ${tick_group.size}p |
| 48 show_label = ${tick_group.show_tick_labels} | 102 show_label = ${tick_group.ticks.show_tick_labels} |
| 49 label_size = ${tick_group.label_size}p | 103 color = $circosColor($tick_group.color) |
| 50 label_offset = ${tick_group.label_offset}p | 104 |
| 51 format = ${tick_group.format} kb | 105 #if str($tick_group.ticks.show_tick_labels) == 'yes': |
| 52 ## TODO: figure out automated tick labels | 106 label_size = ${tick_group.ticks.label_size}p |
| 53 ##if ${ticks.multiplier} * ${tick_group.spacing} | 107 label_offset = ${tick_group.ticks.label_offset}p |
| 108 #if $tick_group.ticks.format_ext: | |
| 109 #if str($ideogram.units) == 'bases': | |
| 110 format = ${tick_group.ticks.format} | |
| 111 #else if str($ideogram.units) == 'kb': | |
| 112 format = ${tick_group.ticks.format} Kb | |
| 113 #else if str($ideogram.units) == 'mb': | |
| 114 format = ${tick_group.ticks.format} Mb | |
| 115 #else if str($ideogram.units) == 'gb': | |
| 116 format = ${tick_group.ticks.format} Gb | |
| 117 #end if | |
| 118 #else | |
| 119 format = ${tick_group.ticks.format} | |
| 120 #end if | |
| 121 #end if | |
| 54 </tick> | 122 </tick> |
| 55 #end for | 123 #end for |
| 56 </ticks> | 124 </ticks> |
| 57 ]]> | 125 ]]> |
| 58 </configfile> | 126 </configfile> |
| 59 </xml> | 127 </xml> |
| 60 <xml name="configfile_ideogram_conf"> | 128 <xml name="configfile_ideogram_conf"> |
| 61 <configfile name="ideogram_conf"><![CDATA[ | 129 <configfile name="ideogram_conf"><![CDATA[ |
| 62 | 130 @UTILS@ |
| 63 <ideogram> | 131 <ideogram> |
| 64 | |
| 65 <spacing> | 132 <spacing> |
| 66 ## spacing between ideograms | 133 ## spacing between ideograms |
| 67 default = ${ideogram.spacing}r | 134 default = ${ideogram.spacing}r |
| 68 </spacing> | 135 </spacing> |
| 69 | 136 |
| 70 # ideogram position, thickness and fill | 137 # ideogram position, thickness and fill |
| 71 radius = ${ideogram.radius}r | 138 radius = ${ideogram.radius}r |
| 72 thickness = ${ideogram.thickness}p | 139 thickness = ${ideogram.thickness}p |
| 73 fill = yes | 140 fill = yes |
| 74 | |
| 75 show_label = ${ideogram.ideogram_labels.show_label} | 141 show_label = ${ideogram.ideogram_labels.show_label} |
| 76 label_radius = dims(ideogram,radius) + 0.075r | 142 label_radius = dims(ideogram,radius) + ${ideogram.ideogram_labels.radius_offset}r |
| 77 label_size = 24 | 143 label_size = ${ideogram.ideogram_labels.size} |
| 78 label_parallel = ${ideogram.ideogram_labels.parallel} | 144 label_parallel = ${ideogram.ideogram_labels.parallel} |
| 79 | 145 |
| 146 #if $ideogram.bands.bands: | |
| 80 show_bands = yes | 147 show_bands = yes |
| 81 fill_bands = yes | 148 #else |
| 82 band_transparency = 4 | 149 show_bands = no |
| 83 | 150 #end if |
| 151 fill_bands = ${ideogram.bands.fill_bands} | |
| 152 #if int($ideogram.bands.band_transparency) > 0: | |
| 153 band_transparency = ${ideogram.bands.band_transparency} | |
| 154 #end if | |
| 155 band_stroke_color = $circosColor($ideogram.bands.band_stroke_color) | |
| 156 band_stroke_thickness = ${ideogram.bands.band_stroke_thickness} | |
| 84 </ideogram> | 157 </ideogram> |
| 85 ]]></configfile> | 158 ]]></configfile> |
| 86 </xml> | 159 </xml> |
| 87 <xml name="configfile_data_conf"> | 160 <xml name="configfile_highlight_conf"> |
| 88 <configfile name="data_conf"><![CDATA[ | 161 <configfile name="highlight_conf"><![CDATA[ |
| 89 #for $hi, $data in enumerate($sec_tdd.data): | 162 @UTILS@ |
| 90 <plot> | 163 <highlights> |
| 91 #set plot_type = str($data.plot_format.plot_format_select) | 164 #for $hi, $data in enumerate($sec_highlight.data): |
| 92 #def circosColor($value) | 165 <highlight> |
| 93 #set $value = str($value) | 166 file = data/highlight-${hi}.txt # ${data.data_source.element_identifier} |
| 94 #set $r = int($value[1:3], 16) | 167 r1 = ${data.r1}r |
| 95 #set $g = int($value[3:5], 16) | 168 r0 = ${data.r0}r |
| 96 #set $b = int($value[5:], 16) | 169 fill_color = $circosColor($data.fill_color) |
| 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 | 170 |
| 136 <rules> | 171 <rules> |
| 137 #for $rule in $data.sec_rule.rules: | 172 #for $rule in $data.sec_rule.rules: |
| 138 <rule> | 173 <rule> |
| 139 #for $condition in $rule.conditions | 174 #for $condition in $rule.conditions |
| 141 condition = 1 | 176 condition = 1 |
| 142 #elif str($condition.application.application_select) == "on": | 177 #elif str($condition.application.application_select) == "on": |
| 143 #set on_str = ' '.join([ "on(%s)" % $chr.strip() for $chr in $condition.application.on_genomes.split(',') ]) | 178 #set on_str = ' '.join([ "on(%s)" % $chr.strip() for $chr in $condition.application.on_genomes.split(',') ]) |
| 144 condition = $on_str | 179 condition = $on_str |
| 145 #elif str($condition.application.application_select) == "pos": | 180 #elif str($condition.application.application_select) == "pos": |
| 146 #if float($condition.application.pos_gt) != 0: | 181 #if $condition.application.pos_gt: |
| 147 condition = var(start) > $condition.application.pos_gt | 182 condition = var(start) > $condition.application.pos_gt |
| 148 #end if | 183 #end if |
| 149 | 184 |
| 150 #if float($condition.application.pos_lt) != 0: | 185 #if $condition.application.pos_lt: |
| 151 condition = var(start) < $condition.application.pos_lt | 186 #if $condition.application.pos_lt_sub == 'yes': |
| 187 condition = var(end) < chrlen(var(chr)) - $condition.application.pos_lt | |
| 188 #else | |
| 189 condition = var(end) < $condition.application.pos_lt | |
| 190 #end if | |
| 152 #end if | 191 #end if |
| 153 #elif str($condition.application.application_select) == "value": | 192 #elif str($condition.application.application_select) == "value": |
| 154 #if float($condition.application.pos_gt) != 0: | 193 #if $condition.application.pos_gt: |
| 155 condition = var(value) > $condition.application.pos_gt | 194 condition = var(value) > $condition.application.pos_gt |
| 156 #end if | 195 #end if |
| 157 | 196 |
| 158 #if float($condition.application.pos_lt) != 0: | 197 #if $condition.application.pos_lt: |
| 159 condition = var(value) < $condition.application.pos_lt | 198 condition = var(value) < $condition.application.pos_lt |
| 160 #end if | 199 #end if |
| 161 #elif str($condition.application.application_select) == "var": | 200 #elif str($condition.application.application_select) == "var": |
| 162 condition = var(${condition.application.varname}) ${condition.application.cond_select} "${condition.application.varvalue}" | 201 condition = var(${condition.application.varname}) ${condition.application.cond_select} "${condition.application.varvalue}" |
| 202 #elif str($condition.application.application_select) == "random": | |
| 203 condition = rand() < ${condition.application.value} | |
| 163 #end if | 204 #end if |
| 164 #end for | 205 #end for |
| 165 | 206 |
| 166 #for $action in $rule.actions: | 207 #for $action in $rule.actions: |
| 167 #if str($action.action.action_select) == "fill_color_value" or str($action.action.action_select) == "color_value" : | 208 #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 | 209 #set x_fill_color = $action.action.action_value |
| 169 #set x_fill_color_count = int(str($x_fill_color).split('-')[1]) | 210 #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 | 211 #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 | 212 #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" | 213 #set color_action = "fill_color" if str($plot_type) in ('histogram', 'histogram-stacked') else "color" |
| 173 | 214 |
| 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}))) | 215 $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}))) |
| 216 #else | |
| 217 $action.action.action_select = $circosColor($action.action.action_value) | |
| 218 #end if | |
| 219 #end for | |
| 220 $rule.continue_flow | |
| 221 </rule> | |
| 222 #end for | |
| 223 </rules> | |
| 224 </highlight> | |
| 225 #end for | |
| 226 </highlights> | |
| 227 ]]></configfile> | |
| 228 </xml> | |
| 229 | |
| 230 | |
| 231 <xml name="configfile_data_conf"> | |
| 232 <configfile name="data_conf"><![CDATA[ | |
| 233 <plots> | |
| 234 @UTILS@ | |
| 235 | |
| 236 #for $hi, $data in enumerate($sec_tdd.data): | |
| 237 <plot> | |
| 238 #set plot_type = str($data.plot_format.plot_format_select) | |
| 239 file = data/data-${hi}.txt # ${data.plot_format.data_source.element_identifier} | |
| 240 r1 = ${data.r1}r | |
| 241 r0 = ${data.r0}r | |
| 242 orientation = ${data.orientation} | |
| 243 #if str($data.minmax.minmax_select) == 'yes': | |
| 244 min = ${$data.minmax.min_value} | |
| 245 max = ${$data.minmax.max_value} | |
| 246 #end if | |
| 247 | |
| 248 #if str($plot_type) in ('histogram', 'histogram-stacked'): | |
| 249 type = histogram | |
| 250 extend_bin = ${data.plot_format.format_specific.extend_bins} | |
| 251 #if str($plot_type) == 'histogram': | |
| 252 fill_color = $circosColorAlpha($data.plot_format.format_specific.fill_color, $data.plot_format.format_specific.fill_color_alpha) | |
| 253 #else: | |
| 254 fill_color = $data.plot_format.format_specific.fill_color | |
| 255 #end if | |
| 256 fill_under = ${data.plot_format.format_specific.fill_under} | |
| 257 color = $circosColorAlpha($data.plot_format.format_specific.stroke_color, $data.plot_format.format_specific.stroke_color_alpha) | |
| 258 thickness = ${data.plot_format.format_specific.stroke_thickness} | |
| 259 #else if str($plot_type) == 'heatmap': | |
| 260 type = ${plot_type} | |
| 261 color = ${data.plot_format.format_specific.fill_color} | |
| 262 scale_log_base = ${data.plot_format.format_specific.scale_log_base} | |
| 263 #else if str($plot_type) == 'line': | |
| 264 type = ${plot_type} | |
| 265 color = $circosColor($data.plot_format.format_specific.stroke_color) | |
| 266 thickness = ${data.plot_format.format_specific.stroke_thickness} | |
| 267 #else if str($plot_type) == 'scatter': | |
| 268 type = ${plot_type} | |
| 269 glyph = ${data.plot_format.format_specific.glyph} | |
| 270 glyph_size = ${data.plot_format.format_specific.glyph_size} | |
| 271 # So this option is ignored, and we have added an always-on rule in the | |
| 272 # first place to override the colour. This is because this color option will | |
| 273 # only accept named colours, while you can override the colour in a rule | |
| 274 # block with an RGB colour. | |
| 275 # | |
| 276 # Additionally it is named "color" in a scatter track whilst in the rule | |
| 277 # you must override it with "fill_color" | |
| 278 color = $circosColor($data.plot_format.format_specific.fill_color) | |
| 279 stroke_color = $circosColor($data.plot_format.format_specific.stroke_color) | |
| 280 stroke_thickness = ${data.plot_format.format_specific.stroke_thickness} | |
| 281 #else if str($plot_type) == 'tile': | |
| 282 type = ${plot_type} | |
| 283 color = color-tile-$hi | |
| 284 stroke_color = $circosColor($data.plot_format.format_specific.stroke_color) | |
| 285 stroke_thickness = ${data.plot_format.format_specific.stroke_thickness} | |
| 286 layers = ${data.plot_format.format_specific.layers} | |
| 287 thickness = ${data.plot_format.format_specific.thickness} | |
| 288 padding = ${data.plot_format.format_specific.padding} | |
| 289 margin = ${data.plot_format.format_specific.margin}u | |
| 290 layers_overflow = ${data.plot_format.format_specific.overflow.overflow_behavior} | |
| 291 #if str($data.plot_format.format_specific.overflow.overflow_behavior) != "hide": | |
| 292 layers_overflow_color = $circosColor($data.plot_format.format_specific.overflow.layer_overflow_color) | |
| 293 #end if | |
| 294 #else if str($plot_type) == 'text': | |
| 295 type = ${plot_type} | |
| 296 #if $data.plot_format.format_specific.link.show_link == "yes": | |
| 297 show_links = yes | |
| 298 link_dims = ${data.plot_format.format_specific.link.link_dims} | |
| 299 link_thickness = ${data.plot_format.format_specific.link.link_thickness}p | |
| 300 link_color = ${data.plot_format.format_specific.link.link_color} | |
| 301 #else | |
| 302 show_links = no | |
| 303 #end if | |
| 304 | |
| 305 #if $data.plot_format.format_specific.snuggle.label_snuggle == "yes": | |
| 306 label_snuggle = ${data.plot_format.format_specific.snuggle.label_snuggle} | |
| 307 max_snuggle_distance = ${data.plot_format.format_specific.snuggle.max_snuggle_distance}r | |
| 308 snuggle_sampling = ${data.plot_format.format_specific.snuggle.snuggle_sampling} | |
| 309 snuggle_tolerance = ${data.plot_format.format_specific.snuggle.snuggle_tolerance}r | |
| 310 snuggle_link_overlap_test = ${data.plot_format.format_specific.snuggle.snuggle_link_overlap_test} | |
| 311 snuggle_link_overlap_tolerance = ${data.plot_format.format_specific.snuggle.snuggle_link_overlap_tolerance}p | |
| 312 snuggle_refine = ${data.plot_format.format_specific.snuggle.snuggle_refine} | |
| 313 #end if | |
| 314 | |
| 315 label_size = ${data.plot_format.format_specific.label_size}p | |
| 316 label_font = condensed | |
| 317 padding = 0p | |
| 318 rpadding = 0p | |
| 319 #end if | |
| 320 | |
| 321 <rules> | |
| 322 #if str($plot_type) == 'scatter': | |
| 323 <rule> | |
| 324 # Workaround for above commented colour bug. | |
| 325 condition = 1 | |
| 326 fill_color = $circosColor($data.plot_format.format_specific.fill_color) | |
| 327 flow = continue | |
| 328 </rule> | |
| 329 #end if | |
| 330 #for $rule in $data.sec_rule.rules: | |
| 331 <rule> | |
| 332 #for $condition in $rule.conditions | |
| 333 #if str($condition.application.application_select) == "1": | |
| 334 condition = 1 | |
| 335 #elif str($condition.application.application_select) == "on": | |
| 336 #set on_str = ' '.join([ "on(%s)" % $chr.strip() for $chr in $condition.application.on_genomes.split(',') ]) | |
| 337 condition = $on_str | |
| 338 #elif str($condition.application.application_select) == "pos": | |
| 339 #if $condition.application.pos_gt: | |
| 340 condition = var(start) > $condition.application.pos_gt | |
| 341 #end if | |
| 342 | |
| 343 #if $condition.application.pos_lt: | |
| 344 condition = var(start) < $condition.application.pos_lt | |
| 345 #end if | |
| 346 #elif str($condition.application.application_select) == "value": | |
| 347 #if $condition.application.pos_gt: | |
| 348 condition = var(value) > $condition.application.pos_gt | |
| 349 #end if | |
| 350 | |
| 351 #if $condition.application.pos_lt: | |
| 352 condition = var(value) < $condition.application.pos_lt | |
| 353 #end if | |
| 354 #elif str($condition.application.application_select) == "var": | |
| 355 condition = var(${condition.application.varname}) ${condition.application.cond_select} "${condition.application.varvalue}" | |
| 356 #end if | |
| 357 #end for | |
| 358 | |
| 359 #for $action in $rule.actions: | |
| 360 #if str($action.action.action_select) == "fill_color_value" or str($action.action.action_select) == "color_value" : | |
| 361 #set x_fill_color = $action.action.action_value | |
| 362 #set x_fill_color_count = int(str($x_fill_color).split('-')[1]) | |
| 363 #set x_min = $x_fill_color_count if $action.action.invert else 1 | |
| 364 #set x_max = 1 if $action.action.invert else $x_fill_color_count | |
| 365 #set color_action = "fill_color" if str($plot_type) in ('histogram', 'histogram-stacked') else "color" | |
| 366 | |
| 367 $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}))) | |
| 368 #elif str($action.action.action_select) in ('fill_color', 'stroke_color'): | |
| 369 #if str($plot_type) in ('tile', ): | |
| 370 color = $circosColor($action.action.action_value) | |
| 371 #else: | |
| 372 #if str($action.action.action_select) == "stroke_color" and str($plot_type) == "histogram": | |
| 373 color = $circosColor($action.action.action_value) | |
| 374 #else | |
| 375 $action.action.action_select = $circosColor($action.action.action_value) | |
| 376 #end if | |
| 377 #end if | |
| 175 #else | 378 #else |
| 176 $action.action.action_select = ${action.action.action_value} | 379 $action.action.action_select = ${action.action.action_value} |
| 177 #end if | 380 #end if |
| 178 #end for | 381 #end for |
| 179 $rule.continue_flow | 382 $rule.continue_flow |
| 201 </background> | 404 </background> |
| 202 #end for | 405 #end for |
| 203 </backgrounds> | 406 </backgrounds> |
| 204 </plot> | 407 </plot> |
| 205 #end for | 408 #end for |
| 409 </plots> | |
| 206 ]]></configfile> | 410 ]]></configfile> |
| 207 </xml> | 411 </xml> |
| 208 | 412 |
| 209 <xml name="configfile_links_conf"> | 413 <xml name="configfile_links_conf"> |
| 210 <configfile name="links_conf"><![CDATA[ | 414 <configfile name="links_conf"><![CDATA[ |
| 415 @UTILS@ | |
| 416 <links> | |
| 211 #for $hi, $data in enumerate($sec_links.data): | 417 #for $hi, $data in enumerate($sec_links.data): |
| 212 <link> | 418 <link> |
| 213 #def circosColor($value) | 419 file = data/links-${hi}.txt |
| 214 #set $value = str($value) | 420 radius = ${data.radius}r |
| 215 #set $r = int($value[1:3], 16) | 421 ribbon = ${data.linktype.ribbon} |
| 216 #set $g = int($value[3:5], 16) | 422 #if $data.linktype.ribbon == 'yes' |
| 217 #set $b = int($value[5:], 16) | 423 ${data.linktype.twist} |
| 218 $r, $g, $b | 424 #if $data.linktype.pattern != 'solid': |
| 219 #end def | 425 pattern = ${data.linktype.pattern} |
| 220 | 426 #end if |
| 221 file = data/links-${hi}.txt | 427 #end if |
| 222 | 428 color = $circosColorAlpha($data.color, $data.color_alpha) |
| 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 | 429 bezier_radius = ${data.bezier_radius}r |
| 230 thickness = ${data.thickness} | 430 thickness = ${data.thickness} |
| 231 crest = ${data.advanced.crest} | 431 crest = ${data.advanced.crest} |
| 232 bezier_radius_purity = ${data.advanced.bezier_radius_purity} | 432 bezier_radius_purity = ${data.advanced.bezier_radius_purity} |
| 233 | 433 #if $data.advanced.perturbation.perturb == 'yes' |
| 234 #if $data.advanced.perturbation.perturb == 'yes' | 434 perturb = yes |
| 235 perturb = yes | 435 perturb_crest = ${data.advanced.perturbation.perturb_crest_min},${data.advanced.perturbation.perturb_crest_max} |
| 236 perturb_crest = ${data.advanced.perturbation.perturb_crest_min},${data.advanced.perturbation.perturb_crest_max} | 436 perturb_bezier_radius = ${data.advanced.perturbation.perturb_bezier_radius_min},${data.advanced.perturbation.perturb_bezier_radius_max} |
| 237 perturb_bezier_radius = ${data.advanced.perturbation.perturb_bezier_radius_min},${data.advanced.perturbation.perturb_bezier_radius_max} | 437 perturb_bezier_radius_purity = ${data.advanced.perturbation.perturb_bezier_radius_purity_min},${data.advanced.perturbation.perturb_bezier_radius_purity_max} |
| 238 perturb_bezier_radius_purity = ${data.advanced.perturbation.perturb_bezier_radius_purity_min},${data.advanced.perturbation.perturb_bezier_radius_purity_max} | 438 #end if |
| 239 #end if | 439 #if $data.advanced.zdepth |
| 240 | 440 z = ${data.advanced.zdepth} |
| 241 #if $data.advanced.zdepth | 441 #end if |
| 242 z = ${data.advanced.zdepth} | |
| 243 #end if | |
| 244 | 442 |
| 245 <rules> | 443 <rules> |
| 246 #for $rule in $data.sec_link_rule.rules: | 444 #for $rule in $data.sec_link_rule.rules: |
| 247 <rule> | 445 <rule> |
| 248 #for $condition in $rule.conditions | 446 #for $condition in $rule.conditions |
| 249 #set cond = $condition.application.application_select | 447 #set cond = $condition.application.application_select |
| 250 #if $cond == 'interchr' or $cond == 'intrachr' or $cond == 'inv' or $cond == 'rev' | 448 #if $cond == 'interchr' or $cond == 'intrachr' or $cond == 'inv' or $cond == 'rev' |
| 251 condition = var($cond) | 449 condition = var($cond) |
| 252 #elif $cond == 'always' | 450 #elif $cond == 'always' |
| 253 condition = 1 | 451 condition = 1 |
| 452 #elif $cond == 'random' | |
| 453 condition = rand() < ${condition.application.value} | |
| 254 #else | 454 #else |
| 255 #set op = $condition.application.comparison.compare | 455 #set op = $condition.application.comparison.compare |
| 256 #set val = $condition.application.comparison.compval | 456 #set val = $condition.application.comparison.compval |
| 257 #if $cond == 'chr' | 457 #if $cond == 'chr' |
| 258 #if $op == 'between' or $op == 'fromto' | 458 #if $op == 'between' or $op == 'fromto' |
| 259 #set val2 = $condition.application.comparison.compval2 | 459 #set val2 = $condition.application.comparison.compval2 |
| 260 #set c=''.join([str($op),"(",str($val),",",str($val2),")"]) | 460 #set c=''.join([str($op),"(",str($val),",",str($val2),")"]) |
| 461 #elif $op == 'on' | |
| 462 #set c='(var(chr1) eq "%s" or var(chr2) eq "%s")' % (str($val), str($val)) | |
| 261 #else | 463 #else |
| 262 #set c=''.join([str($op),"(",str($val),")"]) | 464 #set c=''.join([str($op),"(",str($val),")"]) |
| 263 #end if | 465 #end if |
| 264 condition = $c | 466 condition = $c |
| 265 #else | 467 #else |
| 278 | 480 |
| 279 #for $action in $rule.actions: | 481 #for $action in $rule.actions: |
| 280 #set actiontype = $action.action.action_select | 482 #set actiontype = $action.action.action_select |
| 281 #if $actiontype == 'color': | 483 #if $actiontype == 'color': |
| 282 #if $action.action.dynamic.dynamic_select == "static": | 484 #if $action.action.dynamic.dynamic_select == "static": |
| 283 #set actionval = $circosColor($action.action.dynamic.action_value) | 485 #set actionval = $circosColorAlpha($action.action.dynamic.action_value, $action.action.dynamic.action_value_alpha) |
| 284 $actiontype = $actionval | 486 $actiontype = $actionval |
| 285 #else | 487 #else |
| 286 #set x_fill_color = $action.action.dynamic.action_value | 488 #set x_fill_color = $action.action.dynamic.action_value |
| 287 #set x_fill_color_count = int(str($x_fill_color).split('-')[1]) | 489 #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 | 490 #set x_min = $x_fill_color_count if $action.action.dynamic.invert else 1 |
| 310 </rule> | 512 </rule> |
| 311 #end for | 513 #end for |
| 312 </rules> | 514 </rules> |
| 313 </link> | 515 </link> |
| 314 #end for | 516 #end for |
| 517 </links> | |
| 315 ]]></configfile> | 518 ]]></configfile> |
| 316 </xml> | 519 </xml> |
| 317 | 520 |
| 318 <xml name="test_case"> | 521 <xml name="test_case"> |
| 319 <configfile name="test_case_conf"><![CDATA[ | 522 <inputs name="test_case_conf" /> |
| 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> | 523 </xml> |
| 424 </macros> | 524 </macros> |
