diff circos.xml @ 6:740057a5126d draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/circos commit 1584882716a1d2c598e8485da9d73bcf80d9b29a"
author iuc
date Fri, 01 May 2020 07:28:50 -0400
parents 184dfd9e113d
children 4b519282a05b
line wrap: on
line diff
--- a/circos.xml	Thu Jan 23 07:27:22 2020 -0500
+++ b/circos.xml	Fri May 01 07:28:50 2020 -0400
@@ -1,6 +1,11 @@
 <?xml version="1.0"?>
 <tool id="circos" name="Circos" version="@WRAPPER_VERSION@">
     <description>visualizes data in a circular layout</description>
+    <xrefs>
+        <xref type="bio.tools">galactic_circos</xref>
+        <!--<xref type="bioconda">circos</xref>-->
+        <!--<xref type="rrid">RRID:SCR_018207</xref>-->
+    </xrefs>
     <macros>
         <import>macros.xml</import>
         <import>macros_conffiles.xml</import>
@@ -8,7 +13,14 @@
     </macros>
     <expand macro="requirements"/>
     <version_command>circos --version</version_command>
-    <command detect_errors="exit_code"><![CDATA[
+    <stdio>
+      <!-- Anything other than zero is an error -->
+      <exit_code range="1:"/>
+      <exit_code range=":-1"/>
+      <!-- In case the return code has not been set propery check stderr too -->
+      <regex match="Circos::Error::fatal_error.* called at"/>
+    </stdio>
+    <command><![CDATA[
 ## Directory structure
 mkdir -p circos/conf/ circos/data/ &&
 
@@ -29,7 +41,7 @@
                 <(head -n 50 '${reference_genome.ref.fasta_indexes.fields.len_path}')
             #end if
         #end if
-        '${ideogram.color}'
+        '${reference_genome.ref.color}'
         > circos/conf/karyotype.txt &&
 #else if $reference_genome.ref.ref_source == 'karyotype':
     cp $reference_genome.ref.input_karyotype circos/conf/karyotype.txt &&
@@ -38,23 +50,26 @@
     python
         '$__tool_directory__/fasta-to-karyotype.py'
         genomeref.fa
-        '${ideogram.color}'
+        '${reference_genome.ref.color}'
 
     > circos/conf/karyotype.txt &&
+#else if $reference_genome.ref.ref_source == 'preset':
+    cp '$__tool_directory__/karyotype/'${reference_genome.ref.preset_karyotype} circos/conf/karyotype.txt &&
 #end if
 
 touch circos/conf/karyotype-colors.conf &&
-#if $ideogram.bands.bands:
-    #if $ideogram.bands.convert_bands:
-        python '$__tool_directory__/process-cytogenetic-bands.py'
-            '${ideogram.bands.bands}'
-            >> circos/conf/karyotype.txt
-            2> circos/conf/karyotype-colors.conf &&
-    #else
-        cat '${ideogram.bands.bands}'
-            >> circos/conf/karyotype.txt &&
-    #end if
-#end if
+
+## #if $ideogram.bands.bands:
+##     #if $ideogram.bands.convert_bands:
+##         python '$__tool_directory__/process-cytogenetic-bands.py'
+##             '${ideogram.bands.bands}'
+##             >> circos/conf/karyotype.txt
+##             2> circos/conf/karyotype-colors.conf &&
+##     #else
+##         cat '${ideogram.bands.bands}'
+##             >> circos/conf/karyotype.txt &&
+##     #end if
+## #end if
 
 #if $plot_options.colour_profile:
     #if str($plot_options.colour_profile) == 'cg':
@@ -66,15 +81,9 @@
 cp '$ticks_conf' circos/conf/ticks.conf &&
 cp '$ideogram_conf' circos/conf/ideogram.conf &&
 cp '$data_conf'  circos/conf/data.conf &&
-cp '$highlight_conf'  circos/conf/highlight.conf &&
 cp '$links_conf'  circos/conf/links.conf &&
 cp '$test_case_conf' circos/conf/galaxy_test_case.json &&
 
-## Highlights
-#for $hi, $data in enumerate($sec_highlight.data):
-cp '${data.data_source}' circos/data/highlight-${hi}.txt &&
-#end for
-
 ## 2D Data Plots
 #for $hi, $data in enumerate($sec_tdd.data):
     cp '${data.plot_format.data_source}' circos/data/data-${hi}.txt &&
@@ -99,16 +108,16 @@
         <expand macro="configfile_ideogram_conf" />
         <expand macro="configfile_data_conf" />
         <expand macro="configfile_links_conf" />
-        <expand macro="configfile_highlight_conf" />
         <expand macro="test_case" />
     </configfiles>
     <inputs>
         <section name="reference_genome" title="Karyotype" expanded="true">
             <conditional name="ref">
                 <param name="ref_source" type="select" label="Reference Genome Source">
-                    <option value="history" selected="True">FASTA File from History</option>
+                    <option value="preset" selected="True">Circos Presets</option>
+                    <option value="history"> FASTA File from History (can be slow, generate a length file to improve execution time.)</option>
                     <option value="cached">Locally Cached</option>
-                    <option value="karyotype">Karyotype</option>
+                    <option value="karyotype">Custom Karyotype</option>
                     <option value="lengths">Lengths File</option>
                 </param>
                 <!--
@@ -125,28 +134,161 @@
                      But none of the optinos work well or uniformly, so, no. We're forced to remove this as an option completely.
 
                 -->
+                <when value="preset">
+                    <param name="preset_karyotype" type="select" label="Choose your Circos karyotype" help="In parentheses are the naming conventions for chromosomes used in each karyotype file. These are required for some plot parameters (e.g. filtering chromosomes or specifying rules). The karyotype will also be output along with your plot, for your review.">
+                        <option value="karyotype.arabidopsis.tair10.txt">Arabidopsis tair10 (chr1,chr2,..)</option>
+                        <option value="karyotype.chimp.pt4.txt">Chimp pt4 (pt1,pt2a,pt2b,..)</option>
+                        <option value="karyotype.drosophila.dm6.hires.txt">Drosophila dm6 (M,X,Y,2L,2R,..)</option>
+                        <option value="karyotype.drosophila.hires.dm3.txt">Drosophila dm3 (dmX,dm2l,dm2r,..)</option>
+                        <option value="karyotype.human.hg38.txt" selected="True">Human hg38 (hs1,hs2,..,hsX,hsY)</option>
+                        <option value="karyotype.human.hg19.txt">Human hg19 (hs1,hs2,..,hsX,hsY)</option>
+                        <option value="karyotype.human.hg18.txt">Human hg18 (hs1,hs2,..,hsX,hsY)</option>
+                        <option value="karyotype.human.hg17.txt">Human hg17 (hs1,hs2,..,hsX,hsY)</option>
+                        <option value="karyotype.human.hg16.txt">Human hg16 (hs1,hs2,..,hsX,hsY)</option>
+                        <option value="karyotype.mouse.mm10.txt">Mouse mm10 (mm1,mm2,..)</option>
+                        <option value="karyotype.mouse.mm9.txt">Mouse mm9 (mm1,mm2,..)</option>
+                        <option value="karyotype.oryzasativa.txt">Oryzasativa (os1,os2,..)</option>
+                        <option value="karyotype.rat.rn4.txt">Rat rn4 (rn1,rn2,..)</option>
+                        <option value="karyotype.sorghum.txt">Sorghum (sb1,sb2,..)</option>
+                        <option value="karyotype.yeast.txt">Yeast (chrI, chrII,..)</option>
+                        <option value="karyotype.zeamays.txt">Zeamays (zm1,zm2,..)</option>
+                    </param>
+                </when>
                 <when value="cached">
                     <param name="fasta_indexes" type="select" label="Source Genome Build" help="Warning: this also contains unplaced scaffolds present in the reference genome. You can restrict the regions to plot in 'Limit/Filter Chromosomes' below, or supply your own file.">
                         <options from_data_table="__dbkeys__"/>
                     </param>
+                    <expand macro="brewer_scale" name="color" label="Ideogram Color Scheme" help="This will apply a color scheme to the generated karyotype file"/>
                 </when>
                 <when value="history">
                     <param name="genome_fasta" type="data" format="fasta" label="Source FASTA Sequence"/>
+                    <expand macro="brewer_scale" name="color" label="Ideogram Color Scheme" help="This will apply a color scheme to the generated karyotype file"/>
                 </when>
                 <when value="karyotype">
                     <param name="input_karyotype" type="data" format="tabular,txt" label="Karyotype Configuration" help="Provide your own karyotype configuration. Should be 'chr - ID LABEL START END COLOR'"/>
                 </when>
                 <when value="lengths">
                     <param name="input_lengths" type="data" format="tabular" label="Sequence Lengths" help="This needs to be a 2+ column tabular, e.g. from 'Compute sequence lengths', the first column should be chromosome and second should be length."/>
+                    <expand macro="brewer_scale" name="color" label="Ideogram Color Scheme" help="This will apply a color scheme to the generated karyotype file"/>
                 </when>
             </conditional>
         </section>
 
+        <section name="ideogram" title="Ideogram">
+            <param name="limit_chromosomes" type="text" optional="true" label="Limit/Filter and Order Chromosomes" help="For example: 'hs1;hs2;hs3' or 'chr1:1-1000;chr2:3000-9000' to plot only a subset of regions. The chromosome names must match those in your karyotype file. They will be displayed in this order as well, you will need to specify all chromosomes that you wish to plot. The numerical positions are in terms of chromosome units (whatever this is set to)">
+                <sanitizer>
+                    <valid initial="string.letters,string.digits">
+                        <add value=","/>
+                        <add value="_"/>
+                        <add value="."/>
+                        <add value=":"/>
+                        <add value=";"/>
+                        <add value="-"/>
+                    </valid>
+                </sanitizer>
+            </param>
+            <param name="chromosomes_reverse" type="text" optional="true" label="Reverse these Chromosomes" help="Important: If you set this, you will need to set the 'Limit/Filter Chromosomes' option (above) as well">
+                <sanitizer>
+                    <valid initial="string.letters,string.digits">
+                        <add value=","/>
+                        <add value="_"/>
+                        <add value="."/>
+                        <add value=":"/>
+                        <add value=";"/>
+                        <add value="-"/>
+                    </valid>
+                </sanitizer>
+            </param>
+
+            <param name="units" type="select" label="Chromosome units" help="Setting this to MB allows usage of numbers like 5u to represent 5MB, rather than having to specify 5000000 or 5e6">
+                <option value="bases">Bases</option>
+                <option value="kb">Kilobases</option>
+                <option value="mb" selected="true">Megabases</option>
+                <option value="gb">Gigabases</option>
+            </param>
+
+            <param name="spacing" value="0.5" type="float" min="0" label="Spacing Between Ideograms (in chromosome units)"/>
+            <repeat name="pairwise_spacing" title="Spacing between specific ideograms">
+                <param name="chr1" type="text" label="Chromosome" help="as written in your karyotype file">
+                    <sanitizer>
+                        <valid initial="string.letters,string.digits">
+                            <add value="_"/>
+                            <add value="."/>
+                            <add value="-"/>
+                        </valid>
+                    </sanitizer>
+                </param>
+
+                <param name="chr2" type="text" label="Chromosome" help="as written in your karyotype file">
+                    <sanitizer>
+                        <valid initial="string.letters,string.digits">
+                            <add value="_"/>
+                            <add value="."/>
+                            <add value="-"/>
+                        </valid>
+                    </sanitizer>
+                </param>
+
+                <param name="spacing" type="float" min="0" label="Spacing between these two ideograms (in chromosome units)" value="1" />
+            </repeat>
+
+            <param name="radius" type="float" value="0.90" label="Radius" min="0"/>
+            <param name="thickness" type="float" value="30" label="Thickness" min="0"/>
+            <param name="angle_offset" type="integer" min="-180" max="180" value="-90" label="Angle Offset" help="Rotate the plot such that the first ideogram is at the top center of the page."/>
+            <param name="angle_orientation" type="select" label="Angle orientation" help="Chromosomes are plotted clockwise around the chromosome" >
+                <option value="clockwise">Clockwise</option>
+                <option value="counterclockwise">Counterclockwise</option>
+            </param>
+
+            <section name="ideogram_labels" title="Labels">
+                <param name="show_label" type="boolean" truevalue="yes" falsevalue="no" label="Show Label" checked="true"/>
+                <param type="float" value="0.075" label="Radius" name="radius_offset"/>
+                <param type="integer" value="24" label="Label Font Size" name="size"/>
+                <param name="parallel" type="boolean" label="Parallel" truevalue="yes" falsevalue="no" checked="true"
+                    help="When set to yes/true, labels will be perpendicular to the tangent of the circle at the location of the label. Otherwise, they will be parallel with the tangent of the circle"/>
+            </section>
+
+            <section name="bands" title="Cytogenic Bands">
+                <param name="show_bands" type="boolean" truevalue="yes" falsevalue="no" label="Show Cytogenic Bands?" checked="true" help="Cytogenic bands can be defined inside the karyotype file"/>
+                <!-- Removed these based on reviewer feedback and that they are
+                     not heavily used. Re-enable upon user-request, perhaps
+                     with a more well defined use case rather than a
+                     speculative one.
+                <param name="bands" type="data" format="tabular" optional="true" label="Cytogenetic Bands" help="If defined, will display cytogenetic bands as part of the karyotype configuration. This field accepts any tabular format file. If you provide a BED file you should enable automatic conversion below. Otherwise disable conversion below and it is expected that your file have 7 columns: 'band', chromosome ID (should match fasta), band ID, band ID (again), start, end, color (gneg, gpos, or r,g,b triple). E.g. a complete row would look like: 'band chr1 p32.2 p32.2 56100000 59000000 gneg25'"/>
+                <param name="convert_bands" type="boolean" truevalue="yes" falsevalue="no" label="Convert bands from BED format to circos karyotype band format" checked="true"
+                help="Automatically reformat BED file into the appropriate columns. This should be a BED 6+ file, BED 9+ if you want the colours from the BED file automatically used. Otherwise everything will appear grey."/>
+                -->
+                <param name="fill_bands" type="boolean" truevalue="yes" falsevalue="no" label="Fill Bands" checked="true"/>
+                <param name="band_transparency" type="integer" label="Band Transparency" value="3" min="0" max="5" help="0 is solid, 1 is the least transparent, and 5 is the most transparent"/>
+
+                <param type="integer" value="0" label="Band Stroke Thickness" name="band_stroke_thickness"/>
+                <expand macro="circos_color" label="Band Stroke Color" name="band_stroke_color" value="#000000"/>
+            </section>
+        </section>
+
+        <section name="plot_options" title="General">
+            <conditional name="background">
+                <param name="background_select" type="select" label="Plot Background">
+                    <option value="transparent">Transparent</option>
+                    <option value="color" selected="true">Solid Color</option>
+                </param>
+                <when value="transparent" />
+                <when value="color">
+                    <expand macro="circos_color" label="Background Color" name="background_color" value="#ffffff"/>
+                </when>
+            </conditional>
+            <param name="radius" type="integer" label="Image Radius" value="1500" min="500" max="5000" help="Plot radius (in pixels), final plot dimensions will be 2*r by 2*r"/>
+            <param name="colour_profile" type="select" label="Load additional colour profiles" optional="true" help="Only useful in a tiny subset of situations">
+                <option value="cg">Complete Genomics</option>
+            </param>
+        </section>
+
         <section name="sec_tdd" title="2D Data Tracks">
             <repeat name="data" title="2D Data Plot" help="2D Data Plots allow you to graph all sorts of data visually such as scatter or line plots, heatmaps, or tiles representing gene locations. These are commonly used to plot sequencing density tracks or other datasets that have some value at different positions along a genome.">
                 <!-- Positioning -->
                 <param name="r1" type="float" value="0.89" min="0" max="1" label="Outside Radius" help="Value must be between 1 (outer edge of plot) and 0 (center of the plot)"/>
                 <param name="r0" type="float" value="0.8" min="0" max="1" label="Inside Radius" help="Value must be between 1 (outer edge of plot) and 0 (center of the plot)"/>
+                <expand macro="zdepth"/>
 
 
                 <conditional name="plot_format">
@@ -154,10 +296,12 @@
                         <option value="histogram" selected="True">Histogram</option>
                         <option value="histogram-stacked">Stacked Histogram</option>
                         <option value="heatmap">Heatmap</option>
+                        <option value="highlight">Highlight</option>
                         <option value="line">Line</option>
                         <option value="scatter">Scatter</option>
                         <option value="tile">Tiles</option>
                         <option value="text">Text Labels</option>
+                        <option value="connector">Connectors</option>
                     </param>
                     <when value="histogram">
                         <param name="data_source" type="data" format="tabular,interval" label="Histogram Data Source" help="Columns must be (chrom, start, end, value)"/>
@@ -185,11 +329,44 @@
                     <when value="heatmap">
                         <param name="data_source" type="data" format="tabular,interval" label="Heatmap Data Source" help="Columns must be (chrom, start, end, value)"/>
                         <section name="format_specific" title="Plot Format Specific Options">
-                            <expand macro="brewer_scale" label="Fill Color" name="fill_color"/>
+                            <conditional name="color_scale">
+                                <param name="color_scale_select" type="select" label="Color Scale">
+                                    <option value="basic" selected="True">Basic</option>
+                                    <option value="advanced">Advanced</option>
+                                </param>
+                                <when value="basic">
+                                    <expand macro="brewer_scale" label="Fill Color" name="fill_color"/>
+                                </when>
+                                <when value="advanced">
+                                    <param name="fill_color" type="text" label="Advanced color entry" help="E.g. blues-5-seq-rev,reds-5-seq">
+                                        <sanitizer>
+                                            <valid initial="string.letters,string.digits">
+                                              <add value="," />
+                                              <add value="-" />
+                                            </valid>
+                                        </sanitizer>
+                                    </param>
+                                </when>
+                            </conditional>
+                            <expand macro="stroke_opts"/>
+
+                            <param name="color_mapping" type="select" label="Color Mapping">
+                                <option value="0" selected="True">divided uniformly</option>
+                                <option value="1">division at min/max boundary 1/2 size of others</option>
+                                <option value="2">divided uniformly, 0,n reserved for [,min] and [max,]</option>
+                            </param>
+
                             <param name="scale_log_base" type="float" value="1.0" label="Scale Log Base"
                                 help="If scale_log_base&lt;1, the dynamic range of color mapping of small values will be increased. If scale_log_base&gt;1, then dynamic range of large values will be increased."/>
                         </section>
                     </when>
+                    <when value="highlight">
+                        <param name="data_source" type="data" format="tabular,interval" label="Highlight Data Source" help="Columns must be (chrom, start, end)"/>
+                        <section name="format_specific" title="Plot Format Specific Options">
+                            <expand macro="circos_color_alpha" label="Fill Color" name="fill_color" value="#000000"/>
+                            <expand macro="stroke_opts"/>
+                        </section>
+                    </when>
                     <when value="line">
                         <param name="data_source" type="data" format="tabular,interval" label="Line Data Source" help="Columns must be (chrom, start, end, value)"/>
                         <section name="format_specific" title="Plot Format Specific Options">
@@ -206,7 +383,7 @@
                                 <option value="rectangle">Rectangle</option>
                             </param>
                             <param name="glyph_size" type="integer" value="8" label="Glyph Size"/>
-                            <expand macro="circos_color_alpha" name="fill_color" value="#555555" label="Color" />
+                            <expand macro="circos_color_alpha" name="fill_color" value="#555555" label="Fill Color" />
                             <expand macro="stroke_opts"/>
                         </section>
                     </when>
@@ -252,11 +429,12 @@
                                 <when value="yes">
                                     <param name="link_thickness" type="integer" value="2" label="Link thickness" min="0" help="In pixels"/>
                                     <expand macro="circos_color" name="link_color"  label="Link Color" value="#ff0000"/>
-                                    <param name="link_dims" type="text" value="1p,2p,3p,2p,1p" label="Link dimensions">
+                                    <param name="link_dims" type="text" value="1p,2p,3p,2p,1p" label="Link dimensions" help="From the manual: &quot;Each link line has five dimensions: outer padding, outer line length (drawn at new position), connecting line length (connects old to new position), inner line length (drawn at old position) and inner padding. If snuggling is not used, then distinction between line lengths is not made&quot;.">
                                         <sanitizer>
                                             <valid initial="string.digits">
                                                 <add value="p"/>
                                                 <add value=","/>
+                                                <add value="."/>
                                             </valid>
                                         </sanitizer>
                                     </param>
@@ -284,9 +462,24 @@
 
                         </section>
                     </when>
+                    <when value="connector">
+                        <param name="data_source" type="data" format="interval" label="Connector Data Source" help="Columns must be (chrom, pos1, pos2). Connectors are articulated line segments that relate two positions on an ideogram between two radial positions."/>
+                        <section name="format_specific" title="Plot Format Specific Options">
+                            <expand macro="stroke_opts"/>
+                            <param name="connector_dims" type="text" value="0,0.3,0.4,0.3,0" label="Connector dimensions" help="From the manual: &quot;Each link line has five dimensions: outer padding, outer line length (drawn at new position), connecting line length (connects old to new position), inner line length (drawn at old position) and inner padding. If snuggling is not used, then distinction between line lengths is not made&quot;.">
+                                <sanitizer>
+                                    <valid initial="string.digits">
+                                        <add value=","/>
+                                        <add value="."/>
+                                    </valid>
+                                </sanitizer>
+                            </param>
+                        </section>
+                    </when>
                 </conditional>
                 <param name="orientation" type="boolean" label="Orient Inwards" truevalue="in" falsevalue="out"
                     help="When yes, the plot will face inwards; i.e. lowest values will be plotted to the outside"/>
+                <expand macro="minsize" />
                 <expand macro="minmax" />
 
                 <expand macro="rules" />
@@ -299,6 +492,7 @@
                 <!-- Positioning -->
                 <param name="radius" type="float" value="0.8" min="0" max="1" label="Inside Radius"
                     help="This is the radial position of the termination of the link. Value must be between 1 (outer edge of plot) and 0 (center of the plot)" />
+                <expand macro="zdepth"/>
                 <param name="data_source" type="data" format="tabular,interval" label="Link Data Source" help="Select file with link data. Format: chr1 start1 end1 chr2 start2 end2" />
                 <conditional name="linktype">
                     <param name="ribbon" type="select" label="Link Type" help="">
@@ -331,7 +525,6 @@
                     help="The radial position of the third control point (in addition to the two positions defined by the link coordinates) used to draw the Bezier curve; if this parameter is 0 then straight lines will be used"/>
 
                 <section name="advanced" title="Advanced Settings">
-                    <expand macro="zdepth"/>
                     <param name="crest" type="float" value="0.5" min="0" max="1" label="Crest"
                         help="Two additional Bezier control points can be set by using the crest parameter. When defined, points p3 and p4 are added. These points lie at the same angular position as the start and end link termini and have the radial position. In the crest=0 extreme, p3 and p4 are at the same position as p0,p1. In this case, crest has no effect. When crest=1, p3,p4 are at the radial position of p2, the control point set by bezier_radius"/>
                     <param name="bezier_radius_purity" type="float" value="0.75" min="0" max="1" label="Bezier Radius Purity"
@@ -360,94 +553,27 @@
                     </conditional>
                 </section>
                 <expand macro="linkrules"/>
+                <expand macro="minsize" />
             </repeat>
         </section>
 
-        <section name="plot_options" title="General">
-            <conditional name="background">
-                <param name="background_select" type="select" label="Plot Background">
-                    <option value="transparent">Transparent</option>
-                    <option value="color" selected="true">Solid Color</option>
-                </param>
-                <when value="transparent" />
-                <when value="color">
-                    <expand macro="circos_color" label="Background Color" name="background_color" value="#ffffff"/>
-                </when>
-            </conditional>
-            <param name="radius" type="integer" label="Image Radius" value="1500" min="500" max="5000" help="Plot radius (in pixels), final plot dimensions will be 2*r by 2*r"/>
-            <param name="colour_profile" type="select" label="Load additional colour profiles" optional="true" help="Only useful in a tiny subset of situations">
-                <option value="cg">Complete Genomics</option>
-            </param>
-        </section>
+        <section name="scaling" title="Scaling">
+            <repeat name="zooms" title="Zoomed Region" help="From the documentation: &quot;Local adjustment of scale is for cases when you want to zoom parts of your data domain without cropping. If you think of the ideogram as a rubber band, applying a local scale adjustment is analogous to locally stretching or compressing the rubber band. The effect is that you still see the entire rubber band, but the length scale across it is variable.&quot;">
+                <param name="chr" type="text" label="Chromosome" help="as written in your karyotype file" />
 
-        <section name="ideogram" title="Ideogram">
-            <expand macro="brewer_scale" name="color" label="Ideogram Color Scheme" help="Note, this will be ignored if you supplied a karyogram file containing colour specifications"/>
-            <param name="limit_chromosomes" type="text" optional="true" label="Limit/Filter Chromosomes" help="For example: 'hs1;hs2;hs3' or 'chr1:1-1000;chr2:3000-9000' to plot only a subset of regions">
-                <sanitizer>
-                    <valid initial="string.letters,string.digits">
-                        <add value=","/>
-                        <add value="_"/>
-                        <add value="."/>
-                        <add value=":"/>
-                        <add value=";"/>
-                        <add value="-"/>
-                    </valid>
-                </sanitizer>
-            </param>
-            <param name="chromosomes_reverse" type="text" optional="true" label="Reverse these Chromosomes" help="Important: If you set this, you will need to set the 'Limit/Filter Chromosomes' option (above) as well">
-                <sanitizer>
-                    <valid initial="string.letters,string.digits">
-                        <add value=","/>
-                        <add value="_"/>
-                        <add value="."/>
-                        <add value=":"/>
-                        <add value=";"/>
-                        <add value="-"/>
-                    </valid>
-                </sanitizer>
-            </param>
-
-            <param name="units" type="select" label="Chromosome units" help="Setting this to MB allows usage of numbers like 5u to represent 5MB, rather than having to specify 5000000 or 5e6">
-                <option value="bases">Bases</option>
-                <option value="kb">Kilobases</option>
-                <option value="mb" selected="true">Megabases</option>
-                <option value="gb">Gigabases</option>
-            </param>
-
-            <param name="spacing" type="float" value="0.005" label="Spacing Between Ideograms" min="0"/>
-            <param name="radius" type="float" value="0.90" label="Radius" min="0"/>
-            <param name="thickness" type="float" value="10" label="Thickness" min="0"/>
-
-            <section name="ideogram_labels" title="Labels">
-                <param name="show_label" type="boolean" truevalue="yes" falsevalue="no" label="Show Label" checked="true"/>
-                <param type="float" value="0.075" label="Radius" name="radius_offset"/>
-                <param type="integer" value="24" label="Label Font Size" name="size"/>
-                <!--<param type="float" value="10" label="Thickness" name="thickness"/>-->
-                <param name="parallel" type="boolean" label="Parallel" truevalue="yes" falsevalue="no" checked="true"
-                    help="When set to yes/true, labels will be perpendicular to the tangent of the circle at the location of the label. Otherwise, they will be parallel with the tangent of the circle"/>
-            </section>
-
-            <section name="bands" title="Cytogenic Bands">
-                <param name="bands" type="data" format="tabular" optional="true" label="Cytogenetic Bands"
-                help="If defined, will display cytogenetic bands as part of the karyotype configuration. This field accepts any tabular format file. If you provide a BED file you should enable automatic conversion below. Otherwise disable conversion below and it is expected that your file have 7 columns: 'band', chromosome ID (should match fasta), band ID, band ID (again), start, end, color (gneg, gpos, or r,g,b triple). E.g. a complete row would look like: 'band chr1 p32.2 p32.2 56100000 59000000 gneg25'"/>
-                <param name="convert_bands" type="boolean" truevalue="yes" falsevalue="no" label="Convert bands from BED format to circos karyotype band format" checked="true"
-                help="Automatically reformat BED file into the appropriate columns. This should be a BED 6+ file, BED 9+ if you want the colours from the BED file automatically used. Otherwise everything will appear grey."/>
-                <param name="fill_bands" type="boolean" truevalue="yes" falsevalue="no" label="Fill Bands" checked="true"/>
-                <param name="band_transparency" type="integer" label="Band Transparency" value="0" min="0" max="5" help="0 is solid, 1 is the least transparent, and 5 is the most transparent"/>
-
-                <param type="integer" value="2" label="Band Stroke Thickness" name="band_stroke_thickness"/>
-                <expand macro="circos_color" label="Band Stroke Color" name="band_stroke_color" value="#000000"/>
-            </section>
+                <param name="start" type="float" label="Start" value="1" help="in chromosome units" />
+                <param name="end"   type="float" label="End"   value="5" help="in chromosome units" />
+                <param name="scale" type="float" min="0" label="Scale" value="5" />
+            </repeat>
         </section>
 
         <section name="ticks" title="Ticks">
-            <param name="show_ticks" type="boolean" truevalue="yes" falsevalue="no" label="Show Ticks"/>
             <param name="radius"  type="float" value="1.0" label="Radius"/>
             <param name="skip_first_label" type="boolean" truevalue="yes" falsevalue="no" label="Skip first label"/>
             <param name="skip_last_label" type="boolean" truevalue="yes" falsevalue="no" label="Skip last label"/>
 
             <repeat name="tick_group" title="Tick Group">
-                <param name="spacing" type="text" value="5000" label="Tick Spacing" help="Number of bases (number + u syntax works)"/>
+                <param name="spacing" type="float" min="0" label="Tick Spacing" value="1" help="in chromosome units" />
                 <param name="size" type="float" value="10" label="Tick Size"/>
                 <expand macro="circos_color"/>
                 <conditional name="ticks">
@@ -478,16 +604,11 @@
 
         </section>
 
-        <section name="sec_highlight" title="Highlights">
-            <repeat name="data" title="Highlight" help="Highlights can help highlight a specific region by placing a large coloured block under some interesting or important features that the audience's eyes should be drawn towards">
-                <param name="r1" type="float" value="0.89" min="0" max="1" label="Outside Radius" help="Value must be between 1 (outer edge of plot) and 0 (center of the plot)"/>
-                <param name="r0" type="float" value="0.8" min="0" max="1" label="Inside Radius" help="Value must be between 1 (outer edge of plot) and 0 (center of the plot)"/>
-                <param name="data_source" type="data" format="tabular,interval" label="Highlight Data Source" help="Columns must be (chrom, start, end)"/>
-                <expand macro="circos_color_alpha" label="Fill Color" name="fill_color" value="#000000"/>
-                <expand macro="stroke_opts"/>
-                <expand macro="zdepth"/>
-                <expand macro="rules" />
-            </repeat>
+        <section name="limits" title="Limits">
+            <param name="max_ticks"            type="integer" min="200" value="5000"  label="Maximum number of ticks to draw" help="These are advanced options, if you increase these due to a plotting failure it may result in a significantly longer plotting time. Beware!"/>
+            <param name="max_ideograms"        type="integer" min="200" value="200"   label="Maximum number of ideograms to draw"/>
+            <param name="max_links"            type="integer" min="200" value="25000" label="Maximum number of links to draw"/>
+            <param name="max_points_per_track" type="integer" min="200" value="25000" label="Maximum number of points per track"/>
         </section>
 
         <section name="outputs" title="Outputs">
@@ -506,12 +627,25 @@
         <data name="output_tar" format="tar.gz" from_work_dir="circos.tar.gz" label="Circos Conf Files">
             <filter>outputs['tar']</filter>
         </data>
+        <data name="karyotype_txt" format="tabular" from_work_dir="circos/conf/karyotype.txt" label="Circos Karyotype">
+            <filter>reference_genome['ref']['ref_source'] != 'karyotype' and reference_genome['ref']['ref_source'] != 'preset' </filter>
+        </data>
     </outputs>
     <expand macro="test_cases" />
     <help><![CDATA[
 Circos
 ======
 
+.. class:: infomark
+
+   Made a nice plot? Share it with us in the `training materials <https://github.com/galaxyproject/training-material/issues/1867>`__, we're looking for more cool plots with scientifically relevant stories to share with the students who want to learn how to use Circos.
+
+   Have a feature request? `Share it with us! <https://github.com/galaxyproject/training-material/issues/1867>`__
+
+.. class:: warningmark
+
+   No data or plot crashes? Check that your chromosome naming scheme matches between your Karyotype file and your datasets.
+
 Circos is a software package for visualizing data and information. It visualizes data in a circular layout — this makes Circos ideal for exploring relationships between objects or positions. There are other reasons why a circular layout is advantageous, not the least being the fact that it is attractive.
 
 Circos is ideal for creating publication-quality infographics and illustrations with a high data-to-ink ratio, richly layered data and pleasant symmetries. You have fine control each element in the figure to tailor its focus points and detail to your audience.