comparison tableviewer.xml @ 2:014a21767ac4 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:57 -0400
parents
children fd59d783248a
comparison
equal deleted inserted replaced
1:ae9994cf526f 2:014a21767ac4
1 <?xml version="1.0"?>
2 <tool id="circos_tableviewer" name="Circos: Table viewer" version="@WRAPPER_VERSION@">
3 <description>easily creates circos plots from tabular data</description>
4 <macros>
5 <import>macros.xml</import>
6 </macros>
7 <expand macro="requirements" />
8 <command detect_errors="exit_code"><![CDATA[
9 mkdir -p circos/data/ &&
10 mkdir -p circos/etc/ &&
11 cp '$circos_conf' circos/etc/circos.conf &&
12
13 parse-table -file '$table' -conf '$parse_table_conf' > tmp &&
14
15 make-conf -dir circos/data < tmp &&
16
17 tar cvfz circos.tar.gz circos &&
18 cd circos &&
19 circos -conf etc/circos.conf &&
20 mv circos.png ../ &&
21 mv circos.svg ../
22 ]]></command>
23 <configfiles>
24 <configfile name="parse_table_conf"><![CDATA[
25 ################################################################
26 #
27 # This is a fairly complicated configuration file. Take your time in
28 # experimenting and adjust one thing at a time :)
29 #
30 ################################################################
31
32 max_col_num = 200
33 max_row_num = 200
34
35 # skip this many rows before reading in header and data
36 skip_rows = 0
37
38 # is there a header line that identifies the columns?
39 header = yes
40
41 # is there a row that specifies the order of columns in the image?
42 # - if so, this must be the first line of the header
43 # - if the line exists (col_order_row=yes), employ the use_col_order_row to toggle whether it is used
44 col_order_row = no
45 use_col_order_row = no
46
47 # is there a row that specifies the size of columns in the image?
48 # - if so, this must be the next line of the header
49 # - if the line exists (col_size_row=yes), employ the use_col_size_row to toggle whether it is used
50 col_size_row = no
51 use_col_size_row = no
52
53 # is there a row that specifies the color of each column segment in the image?
54 # - if so, this must be the next line of the header
55 # - if the line exists (col_color_row=yes), employ the use_col_color_row to toggle whether it is used
56 col_color_row = no
57 use_col_color_row = no
58
59 # is there a column that specifies the order of rows in the image?
60 # - if so, this must be the first column
61 # - if the line exists (row_order_col=yes), employ the use_row_order_col to toggle whether it is used
62 row_order_col = no
63 use_row_order_col = no
64
65 row_size_col = no
66 use_row_size_col = no
67
68 # is there a column that specifies the color of each row segment in the image?
69 # - if so, this must be the second column
70 # - if the line exists (row_color_col=yes), employ the use_row_color_col to toggle whether it is used
71 row_color_col = no
72 use_row_color_col = no
73
74 # if you do not have a column/row that explicitly defines order
75 # of segments in the image, you can set this here. Use one (or more) of
76 # these values to specify how segments should be ordered.
77 # - row_major (row segments first, then column)
78 # - col_major (col segments first, then row)
79 # - ascii (asciibetic order)
80 # - row_size (total of rows for the segment - useful if the segment has both row and column contributions)
81 # - col_size (total of colums for the segment - useful if the segment has both row and column contributions)
82 # - row_to_col_ratio (ratio of total of rows to columns for the segment)
83 # - col_to_row_ratio (ratio of total of rows to columns for the segment)
84 # - size_asc (size, in ascending order)
85 # - size_desc (size, in descending order)
86
87 #segment_order = row_to_col_ratio,size_desc # col_major,size_desc
88 segment_order = size_desc
89 #segment_order = ascii
90 #segment_order = file:etc/order-by-table-remapped.txt
91 #segment_order = size_desc,row_to_col_ratio
92 segment_color_order = ascii
93
94 # values for segments can be normalized if the use_segment_normalization is set to yes
95 use_segment_normalization = no
96
97 # the normalization function can be one of the following, and is applied to
98 # all values that correspond to the segment's label
99 # total - sum of cell values for the segment label (row and col)
100 # average - average of cell values for the segment label (row and col)
101 # row_total, row_average - sum or average for cell values for the segment row
102 # col_total, col_average - sum or average for cell values for the segment col
103 # row_size, col_size, total_size - based on the optional size column (see col_size_row and row_size_col above)
104 # VALUE - segments are scaled to a constant VALUE (e.g. 1000)
105 segment_normalization_function = 1000
106
107 # normalization can be performed by either altering the actual data values or
108 # by applying a visual scaling of the segments. When 'value' is used, the data
109 # is changed. When 'visual' is used, then a chromosomes_scale line is reported
110 # by this script which you must include in circos.conf for the scaling to be applied
111 segment_normalization_scheme = value
112
113 ################################################################
114 # placement of cell ribbons on row/column segments
115 #
116 # for segments that share both column and row ribbons, the
117 # order of ribbon position can be adjusted with placement_order
118
119 placement_order = row,col # col,row or row,col
120
121 # within the row/column ribbon bundle for each segment,
122 # ribbon_bundle_order determines how the ribbons will be
123 # ordered
124 # - size_asc - by value of the cell, ascending
125 # - size_desc - by value of the cell, descending
126 # - ascii - sorted by destination label, ascending
127 # - native - sorted by order of destination segment
128
129 ribbon_bundle_order = size_desc # size, ascii, native
130
131 # reverse the position of links in table/row segments?
132
133 reverse_rows = no
134 reverse_columns = no
135
136 # values for cells with the same row/column name can be treated
137 # independently. You can
138 # show - show these cells and not filter them at all
139 # hide - hide these cells from the image, but not resize the row/columns
140 # remove - entirely remove these cells from the data set (equivalent to setting cells to missing value)
141 intra_cell_handling = show
142
143 # ribbon layering - order in which the ribbons are drawn on the image
144 # size_asc - ascending by ribbon size (small ribbons drawn first, therefore large ribbons will be at front)
145 # size_desc - descending by ribbon size (large ribbons drawn first, therefore small ribbons will be at front)
146
147 ribbon_layer_order = size_asc
148
149 # if both (A,B)=x and (B,A)=y cells exist, you can choose to have the ribbon
150 # ends sized variably so that ribbon at A has width x and at B has width y
151
152 ribbon_variable = no
153 ribbon_variable_intra_collapse = yes
154
155 ################################################################
156 # cell value mapping allows you to remap the cell values using
157 # any Perl expression that uses X as the cell value. For example,
158 #
159 # cell_remap_formula = log(X)
160 # = sqrt(X)
161 # = X/10
162 # = X ? log(X) : 0
163 #
164 # This remapping takes place before any filters or scaling is applied. Its effect
165 # is the same as remapping the cell values in the input file.
166
167 use_cell_remap = no
168 cell_remap_formula = round(10*X)
169
170 ################################################################
171 # scale your values with a power rule (useful if the range of values
172 # is very large) to
173 # - atten_large: attenuate large values and maintain visibility
174 # of ribbons corresponding to small values, or
175 # - atten_small: attenuate small values to increase visibility
176 # of ribbons corresponding to large values
177 #
178 # given a value, v, and a maximum, m
179 #
180 # atten_small:
181 #
182 # v_new = m * ( exp(scale_factor * v / m) - 1 ) / ( exp(scale_factor) - 1 )
183 #
184 # atten_large:
185 #
186 # v_new = m * ( log(scale_factor * v ) ) / ( log(scale_factor * m ) )
187 #
188 # essentially the values are remapped to a log-type scale
189 # with the range 0..m
190
191 use_scaling = no
192 scaling_type = atten_large
193 scale_factor = 1
194
195 blank_means_missing = no
196 missing_cell_value = -
197
198 ################################################################
199 # Value cutoffs for cell values and ribbon formatting.
200 #
201 # You can toggle the visibility of ribbons for cells outside
202 # a min/max range. You can define one or more of these cutoffs.
203 # The cutoffs are applied to unscaled cell values.
204
205 #cell_min_value = 10
206 #cell_min_percentile = 10
207 #cell_max_value = 100
208 #cell_max_percentile = 100
209
210 # For cell values that do not pass the min/max filters above,
211 # you can specify whether they are hidden or removed. If the
212 # parameter is not defined, "hide" will be assumed.
213 # hide - cell values won't be shown, but row/col will not be resized
214 # remove - entirely remove these cells from the data set (equivalent to setting cells to missing value)
215
216 cutoff_cell_handling = hide
217
218 # The color of ribbons is by default the color of the row segment from
219 # which they originate. The block below allows you to remap the color
220 # of the ribbons based on cell percentile values. There are two ways
221 # to remap colors
222 #
223 # - color_remap=yes, color_autoremap=no
224 # Uses <percentile> blocks to define the percentile values and associated
225 # color/stroke_color characteristics for ribbons. Percentile value defined
226 # in the block (e.g. <percentile 55>) is the max percentile value for
227 # cells associated with this block.
228 # - color_remap=yes, color_autoremap=yes
229 # Uses colors associated with each percentile window of size
230 # percentile_sampling for each cell
231
232 <linkcolor>
233 color_source = row
234 percentile_source = larger
235 color_transparency = 1
236 color_remap = no
237 color_autoremap = no
238
239 <percentile 50>
240 color = dgrey
241 transparency = 5
242 </percentile>
243
244 <percentile 60>
245 transparency = 5
246 </percentile>
247
248 <percentile 70>
249 transparency = 4
250 </percentile>
251
252 <percentile 80>
253 transparency = 3
254 </percentile>
255
256 <percentile 90>
257 transparency = 2
258 stroke_color = black
259 stroke_thickness = 1p
260 </percentile>
261
262 <percentile 100>
263 transparency = 1
264 stroke_color = black
265 stroke_thickness = 3p
266 </percentile>
267
268 </linkcolor>
269
270 <linkparam>
271 color = vdgrey
272 #stroke_color = black
273 #stroke_thickness = 1p
274 </linkparam>
275
276 # If you are using color_autoremap=yes above, then
277 # define the percentile sampling window and
278 # the start/end HSV color values. Percentile window
279 # colors are interpolated between this HSV pair.
280 #
281 # HSV = (hue saturation value)
282 # hue=(0..360) saturation=(0..1) value=(0..1)
283
284 percentile_sampling = 5
285
286 # count - percentile based on counts
287 # value - percentile based on value
288
289 percentile_method = count
290
291 # use all values or only unique values when
292 # calculating percentiles
293 percentile_unique_only = yes
294
295 # use a function, f(X), to remap cell values when calculating percentiles
296 # for the purpose of color mapping. This allows you to apply a remapping to how
297 # colors are calculated, without actually changing the values. The remap
298 # applies only if percentile_method=value
299
300 # percentile_remap = sqrt(X)
301
302 # Which cell value set to use for percentile color mapping
303 # raw - original values
304 # filtered - values that pass min/max filters
305 # scaled - filtered values that have been scaled if use_scaling is set
306 percentile_data_domain = raw
307
308 <colors>
309 h0 = 0
310 s0 = 1
311 v0 = 1
312 h1 = 300
313 s1 = 1
314 v1 = 1
315 </colors>
316
317 # You can control the color and stroke of ribbons for each
318 # quartile (q1, q2, q3, q4). Any values defined here will
319 # overwrite colors determined by remapping.
320 #
321 # For example, if you have a lot of cells and wish to attenuate
322 # the visibility of ribbons associated with small values, you can
323 # set cell_q1_color=vvlgrey,cell_q1_nostroke=yes to fade the
324 # ribbons into the background.
325
326 #cell_q1_color = vvlgrey
327 #cell_q2_color = vlgrey
328 #cell_q3_color = lgrey
329 #cell_q4_color = red
330 #cell_q1_nostroke = yes
331 #cell_q2_nostroke = yes
332 #cell_q3_nostroke = yes
333 #cell_q4_nostroke = yes
334
335 # cell value multiplier, required when all data is small (e.g. <1), in which
336 # case set the multiplier to something like 1000 because Circos
337 # works only with integer scales
338
339 data_mult = 1
340
341 ################################################################
342 # Segment labels can be optionally set to a size that is
343 # proportional to the size of the segment. Set min/max size
344 # values here. If this line is commented out, then the label
345 # size is determined by the circos.conf file used to draw the image
346
347 #segment_label_size_range = 60,60
348
349 # progression controls how fast the label size changes from
350 # min to max (larger value of progression means values close to max
351 # are achieved for smaller segments)
352
353 segment_label_size_progression = 4
354
355 segment_label_uppercase = no
356
357 ################################################################
358 # Segment colors can be specified in the data file (in this
359 # case use row_color_col and col_color_row), otherwise colors
360 # are interpolated within an HSV range. Color interpolation can be
361 # done in two ways: based on segment index (interpolation steps through
362 # colors uniformly for each segment) and total size (interpolation
363 # steps through colors in proportion to segment size).
364
365 <segment_colors>
366 interpolate_type = size # size or count
367 h0 = 0
368 s0 = 0.8
369 v0 = 0.9
370 h1 = 300
371 s1 = 0.8
372 v1 = 0.9
373 </segment_colors>
374
375 ################################################################
376 # Shorten the labels of segments. Specify whether to do this
377 # with shorten_text=yes|no parameter and provide regular
378 # expressions in string_replace which define the text to
379 # replace.
380
381 shorten_text = no
382
383 <string_replace>
384 chromosome = chr
385 </string_replace>
386
387 # exit on any error
388 strict_sanity = yes
389
390 ################################################################
391 # if the segment_prefix is set, then rows and columns will be
392 # renamed to internal fields segment_prefix + DIGIT
393
394 #segment_prefix = id
395 color_prefix = color
396
397 # field delimiter regular expression
398 # if this is not defined, any whitespace will be considered a delimiter
399 field_delim = \s
400
401 # collapse adjacent delimiters?
402 field_delim_collapse = yes
403
404 # remove any leading space in the input file
405 # by default, this is on - if you set this to "no", make sure that you don't have any leading spaces in your table!
406 strip_leading_space = yes
407
408 # remove quotes and thousand separators - concatenate characters to remove
409 #
410 # e.g. to remove characters a b c set remove_cell_rx=abc
411 # e.g. to remove characters " ' , set remove_cell_rx="',
412 remove_cell_rx = "',
413
414 ]]></configfile>
415 <configfile name="circos_conf"><![CDATA[
416 #def circosColor($value)
417 #set $value = str($value)
418 #set $r = int($value[1:3], 16)
419 #set $g = int($value[3:5], 16)
420 #set $b = int($value[5:], 16)
421 $r, $g, $b
422 #end def
423
424 # This is the main configuration file for the Circos tableviewer. This
425 # file also depends on colors.conf (definition on basic colors),
426 # ideogram.conf (size and spacing of row/cell segments), and
427 # ticks.conf (tick spacing and label definitions - these are turned
428 # off by default).
429 #
430 # In addition to these configuration files, the bin/make-conf script
431 # creates colors.conf (colors of row/col segments) and
432 # colors_percentile.conf (colors based on cell percentile
433 # values). These configuration files are also included via the
434 # <<include>> directive.
435 #
436 # Some elements of the output image are toggled off by default
437 # (e.g. row and column highlights, anchor links to segment labels,
438 # tick marks).
439
440 <colors>
441 <<include data/colors.conf>>
442 <<include data/colors_percentile.conf>>
443 </colors>
444
445 <ideogram>
446 <spacing>
447 default = 0.010r
448 </spacing>
449
450 thickness = 25p
451 stroke_thickness = 2
452 stroke_color = vdgrey
453 fill = yes
454 fill_color = $circosColor($labels.segment.color)
455
456 # fractional radius position of chromosome ideogram within image
457 radius = 0.70r
458 show_label = $labels.segment.show
459 label_font = $labels.segment.font
460 label_radius = dims(image,radius) - 50p
461 label_size = $labels.segment.size
462 label_parallel = $labels.segment.parallel
463
464 show_bands = no
465 </ideogram>
466
467 show_ticks = yes
468 show_tick_labels = $labels.ticks.show
469
470 <ticks>
471 skip_first_label = no
472 skip_last_label = no
473 radius = dims(ideogram,radius_outer)
474 size = 12p
475 label_font = $labels.ticks.font
476 label_size = $labels.ticks.size
477 label_offset = 5p
478 format = %d
479 color = $circosColor($labels.ticks.color)
480 thickness = 2p
481
482 <tick>
483 spacing_type = relative
484 rspacing = 0.1
485 show_label = yes
486 label_relative = yes
487 label_size = 20p
488 suffix = %
489 rmultiplier = 100
490 offset = 100p
491 </tick>
492
493 <tick>
494 spacing_type = relative
495 rspacing = 0.02
496 show_label = no
497 offset = 100p
498 </tick>
499
500 <tick>
501 spacing = 10u
502 show_label = yes
503 </tick>
504
505 <tick>
506 spacing = 1u
507 show_label = no
508 </tick>
509 </ticks>
510
511 karyotype = data/karyotype.txt
512
513 <image>
514 <<include etc/image.conf>>
515 </image>
516
517 chromosomes_units = 10
518 chromosomes_display_default = yes
519 chromosomes_order_by_karyotype = yes
520
521 <highlights>
522 stroke_color = vdgrey
523 stroke_thickness = 1
524
525 <highlight>
526 show = yes
527 file = data/row.txt
528 r0 = 1r+300p
529 r1 = 1r+310p
530 </highlight>
531
532 <highlight>
533 show = yes
534 file = data/col.txt
535 r1 = 1r+330p
536 r0 = 1r+320p
537 </highlight>
538
539 <highlight>
540 show = yes
541 file = data/all.txt
542 r1 = 1r+280p
543 r0 = 1r+260p
544 </highlight>
545
546 <highlight>
547 file = data/cap.col.txt
548 r1 = 0.999r-10p
549 r0 = 0.999r-30p
550 </highlight>
551
552 <highlight>
553 file = data/cap.row.txt
554 r1 = 0.999r
555 r0 = 0.999r-20p
556 </highlight>
557 </highlights>
558
559 <links>
560 <link>
561 ribbon = yes
562 flat = yes
563 file = data/cells.txt
564 bezier_radius = 0.0r
565 radius = 0.999r-30p
566 thickness = 1
567 color = grey
568 stroke_color = dgrey
569 stroke_thickness = 1
570
571 <rules>
572 <rule>
573 condition = 1
574 radius1 = 0.999r-20p
575 </rule>
576 </rules>
577 </link>
578 </links>
579
580 <<include etc/colors_fonts_patterns.conf>>
581 <<include etc/housekeeping.conf>>
582 ]]></configfile>
583 </configfiles>
584 <inputs>
585 <param name="table" type="data" format="tabular" label="Input table"/>
586 <section name="outputs" title="Outputs" expanded="true">
587 <param name="png" type="boolean" truevalue="yes" falsevalue="no" label="Output PNG" checked="true"/>
588 <param name="svg" type="boolean" truevalue="yes" falsevalue="no" label="Output SVG" checked="false"/>
589 <param name="tar" type="boolean" truevalue="yes" falsevalue="no" label="Output Configuration Archive" checked="false"/>
590 </section>
591
592 <section name="labels" title="Ticks &amp; Labels" expanded="false">
593 <section name="segment" title="Segment Labels" expanded="true">
594 <param name="show" type="boolean" truevalue="yes" falsevalue="no" label="Show label" checked="true" />
595 <param name="parallel" type="boolean" truevalue="yes" falsevalue="no" label="Show parallel to rack" />
596 <param type="integer" value="50" label="Font Size" name="size" />
597 <expand macro="font_select" normal="false" bold="true" />
598 <expand macro="circos_color" label="Color" name="color" value="#000000" />
599 </section>
600 <section name="ticks" title="Tick Labels" expanded="true">
601 <param name="show" type="boolean" truevalue="yes" falsevalue="no" label="Show label" checked="true" />
602 <param name="parallel" type="boolean" truevalue="yes" falsevalue="no" label="Show parallel to rack" />
603 <param type="integer" value="24" label="Font Size" name="size" />
604 <expand macro="font_select" normal="true"/>
605 <expand macro="circos_color" label="Color" name="color" value="#000000" />
606 </section>
607 </section>
608 </inputs>
609 <outputs>
610 <data name="output_png" format="png" from_work_dir="circos.png" label="Circos TableViewer Plot">
611 <filter>outputs['png']</filter>
612 </data>
613 <data name="output_svg" format="svg" from_work_dir="circos.svg" label="Circos TableViewer Plot">
614 <filter>outputs['svg']</filter>
615 </data>
616 <data name="output_tar" format="tar.gz" from_work_dir="circos.tar.gz" label="Circos TableViewer Conf Files">
617 <filter>outputs['tar']</filter>
618 </data>
619 </outputs>
620 <tests>
621 <test>
622 <param name="table" value="tableviewer/1.tab" ftype="tabular" />
623 <output name="output_png" file="tableviewer/1.png" ftype="png" compare="sim_size" delta="90000" />
624 </test>
625 </tests>
626 <help><![CDATA[
627 The `official documentation <http://mkweb.bcgsc.ca/tableviewer/docs/>`__ has a lot of useful information.
628
629 You should provide a table that looks like:
630
631 ::
632
633 labels A B C
634 A 10 15 20
635 D 15 20 25
636 E 20 30 50
637
638 The header column and row are strictly required.
639 ]]></help>
640 <expand macro="citations" />
641 </tool>