view pyGenomeTracks.xml @ 6:5cec5fb749f0 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/pygenometracks commit d5b42c5571c64be9fcfe515e79210cbf4c75beaf"
author iuc
date Tue, 11 Feb 2020 10:20:24 -0500
parents eca03db4f612
children 326a3db8d9d1
line wrap: on
line source

<tool id="pygenomeTracks" name="@BINARY@" version="@WRAPPER_VERSION@">
    <description>plot genomic data tracks</description>
    <macros>
        <token name="@BINARY@">pyGenomeTracks</token>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="exit_code">
<![CDATA[
        ## First symlink data of hic or bed/gtf to have the good extension
        #for $counter, $track in enumerate($tracks):
            #if $track.track_file_style_conditional.track_file_style_selector == "hic_matrix_option":
                #for $counter_matrix, $data_matrix in enumerate($track.track_file_style_conditional.matrix_h5_cooler_multiple):
                    #set ext = $data_matrix.extension
                    ln -s $data_matrix ${counter}_${counter_matrix}.$ext &&
                #end for
            #end if
            #if $track.track_file_style_conditional.track_file_style_selector == "gene_track_option":
                #for $counter_bed, $data_bed in enumerate($track.track_file_style_conditional.track_input_bed):
                    #set ext = $data_bed.extension
                    ln -s $data_bed ${counter}_${counter_bed}.$ext &&
                #end for
            #end if
        #end for


        sed '/^$/d' '$tracks_config' &&
        @BINARY@
            --tracks '$tracks_config'
            #if $region and $region is not None:
                --region '$region'
            #end if
            --outFileName plot.$image_file_format
        && mv plot.$image_file_format plot
]]>
    </command>
    <configfiles>
        <configfile name="tracks_config">
## First the xaxis if where = top
#if $x_axis.x_axis_select == "true":
  #if $x_axis.where == 'top':
[x-axis]
    #if $x_axis.fontsize:
fontsize = $x_axis.fontsize
    #end if
where = top
  #end if
#end if

## Then each track:
#for $counter, $track in enumerate($tracks):
  ## Hi-C Track
  #if $track.track_file_style_conditional.track_file_style_selector == "hic_matrix_option":
    #for $counter_matrix, $data_matrix in enumerate($track.track_file_style_conditional.matrix_h5_cooler_multiple):
[hic_section_${counter}_${counter_matrix}]
      #set ext = $data_matrix.extension
file = ${counter}_${counter_matrix}.$ext
file_type = hic_matrix
      #if $track.track_file_style_conditional.title:
title = $track.track_file_style_conditional.title
      #else:
title = $data_matrix.name
      #end if
      #if $track.track_file_style_conditional.depth:
depth = $track.track_file_style_conditional.depth
      #end if
      #if $track.track_file_style_conditional.colormap:
colormap = $track.track_file_style_conditional.colormap
      #end if
      #if $track.track_file_style_conditional.min_value != "":
min_value = $track.track_file_style_conditional.min_value
      #end if
      #if $track.track_file_style_conditional.max_value != "":
max_value = $track.track_file_style_conditional.max_value
      #end if
transform = $track.track_file_style_conditional.transform
      #if $track.track_file_style_conditional.height_matrix != "":
height = $track.track_file_style_conditional.height_matrix
      #end if
      #if $track.track_file_style_conditional.show_masked_bins:
show_masked_bins = $track.track_file_style_conditional.show_masked_bins
      #end if
      #if $track.track_file_style_conditional.invert_orientation:
orientation = inverted
      #end if
      #if $track.track_file_style_conditional.scale_factor:
scale_factor = $track.track_file_style_conditional.scale_factor
      #end if
rasterize = $track.track_file_style_conditional.rasterize
      ## If a boundary file is given a new section needs to be written:
      #if str($track.track_file_style_conditional.boundaries_file) != "None":
        #if len($track.track_file_style_conditional.boundaries_file)>$counter_matrix:
          #set boundary_file = $track.track_file_style_conditional.boundaries_file[$counter_matrix]
        #else:
          #set boundary_file = $track.track_file_style_conditional.boundaries_file[0]
        #end if
[tads_${counter}_${counter_matrix}]
file = $boundary_file
file_type = domains
border_color = black
color = none
overlay_previous = share-y
      #end if
      ## If spacer is asked a new section is created:
      #if $track.track_file_style_conditional.spacer_height != "":
[spacer]
height = $track.track_file_style_conditional.spacer_height
      #end if
    #end for
  #end if

  ## Chrom_state track
  #if $track.track_file_style_conditional.track_file_style_selector == "chrom_states_option":
    #for $data_bed in $track.track_file_style_conditional.track_input_bed:
[chrom states_$counter]
file = $data_bed
      #if $track.track_file_style_conditional.title:
title = $track.track_file_style_conditional.title
      #else:
title = $data_bed.name
      #end if
      #if $track.track_file_style_conditional.color_bed.color_bed_select == "bed_rgb":
color = bed_rgb
      #elif $track.track_file_style_conditional.color_bed.color:
color = $track.track_file_style_conditional.color_bed.color
      #end if
      #if $track.track_file_style_conditional.border_color:
border_color = $track.track_file_style_conditional.border_color
      #end if
display = collapsed
      #if $track.track_file_style_conditional.height_chrom:
height = $track.track_file_style_conditional.height_chrom
      #end if
line_width = $track.track_file_style_conditional.line_width
file_type = bed
      ## If spacer is asked a new section is created:
      #if $track.track_file_style_conditional.spacer_height != "":
[spacer]
height = $track.track_file_style_conditional.spacer_height
      #end if
    #end for
  #end if

  ## Gene/gtf track
  #if $track.track_file_style_conditional.track_file_style_selector == "gene_track_option":
    #for $counter_bed, $data_bed in enumerate($track.track_file_style_conditional.track_input_bed):
[genes_${counter}_${counter_bed}]
      #set ext = $data_bed.extension
file = ${counter}_${counter_bed}.$ext
      #if $ext == 'gtf':
prefered_name = $track.track_file_style_conditional.bed_advanced.gtf.prefered_name
merge_transcripts = $track.track_file_style_conditional.bed_advanced.gtf.merge_transcripts
      #end if
      #if $track.track_file_style_conditional.title:
title = $track.track_file_style_conditional.title
      #elif $track.track_file_style_conditional.overlay_select == 'no':
title = $data_bed.name
      #end if
      #if $track.track_file_style_conditional.color_bed.color_bed_select == "bed_rgb":
color = bed_rgb
      #elif $track.track_file_style_conditional.color_bed.color:
color = $track.track_file_style_conditional.color_bed.color
      #end if
      #if $track.track_file_style_conditional.border_color:
border_color = $track.track_file_style_conditional.border_color
      #end if
      #if $track.track_file_style_conditional.flybase:
style = flybase
height_utr = $track.track_file_style_conditional.bed_advanced.flybase.height_utr
color_utr = $track.track_file_style_conditional.bed_advanced.flybase.color_utr
      #else
style = UCSC
arrow_interval = $track.track_file_style_conditional.bed_advanced.ucsc.arrow_interval
      #end if
display = $track.track_file_style_conditional.display
      #if $track.track_file_style_conditional.height_bed:
height = $track.track_file_style_conditional.height_bed
      #end if
labels = $track.track_file_style_conditional.labels
file_type = bed
      #if $track.track_file_style_conditional.fontsize:
fontsize = $track.track_file_style_conditional.fontsize
      #end if
      #if $track.track_file_style_conditional.bed_advanced.gene_rows:
gene_rows = $track.track_file_style_conditional.bed_advanced.gene_rows
      #end if
global_max_row = $track.track_file_style_conditional.bed_advanced.global_max_row
max_labels = $track.track_file_style_conditional.bed_advanced.max_labels
line_width = $track.track_file_style_conditional.bed_advanced.line_width
arrowhead_included = $track.track_file_style_conditional.arrowhead_included
      #if $track.track_file_style_conditional.invert_orientation:
orientation = inverted
      #end if
overlay_previous = $track.track_file_style_conditional.overlay_select
      ## If spacer is asked a new section is created:
      #if $track.track_file_style_conditional.spacer_height != "":
[spacer]
height = $track.track_file_style_conditional.spacer_height
      #end if
    #end for
  #end if

  ## Link
  #if $track.track_file_style_conditional.track_file_style_selector == "link_track_option":
[links_$counter]
file = $track.track_file_style_conditional.track_input_link
    #if $track.track_file_style_conditional.title:
title = $track.track_file_style_conditional.title
    #elif $track.track_file_style_conditional.overlay_select == 'no':
title = $track.track_file_style_conditional.track_input_link.name
    #end if
    #if $track.track_file_style_conditional.height:
height = $track.track_file_style_conditional.height
    #end if
    #if $track.track_file_style_conditional.min_value != "":
min_value = $track.track_file_style_conditional.min_value
    #end if
    #if $track.track_file_style_conditional.max_value != "":
max_value = $track.track_file_style_conditional.max_value
    #end if
color = $track.track_file_style_conditional.color_link.color
alpha = $track.track_file_style_conditional.alpha
line_width = $track.track_file_style_conditional.line_width
line_style = $track.track_file_style_conditional.line_style
links_type = $track.track_file_style_conditional.links_type
    #if $track.track_file_style_conditional.invert_orientation:
orientation = inverted
    #end if
overlay_previous = $track.track_file_style_conditional.overlay_select
file_type = links
    ## If spacer is asked a new section is created:
    #if $track.track_file_style_conditional.spacer_height != "":
[spacer]
height = $track.track_file_style_conditional.spacer_height
    #end if
  #end if

  ## Narrow peak
  #if $track.track_file_style_conditional.track_file_style_selector == "narrow_peak_track_option":
    #for $counter_narrow_peak, $data_narrow_peak in enumerate($track.track_file_style_conditional.track_input_narrow_peak):
[narrow_peak_${counter}_${counter_narrow_peak}]
file = $data_narrow_peak
      #if $track.track_file_style_conditional.title:
title = $track.track_file_style_conditional.title
      #elif $track.track_file_style_conditional.overlay_select == 'no':
title = $data_narrow_peak.name
      #end if
color = $track.track_file_style_conditional.color
type = $track.track_file_style_conditional.display.display_selector
use_summit = $track.track_file_style_conditional.display.use_summit
      #if $track.track_file_style_conditional.display.display_selector == "peak":
show_data_range = $track.track_file_style_conditional.display.show_data
        #if $track.track_file_style_conditional.display.width_adjust:
width_adjust = $track.track_file_style_conditional.display.width_adjust
        #end if
        #if $track.track_file_style_conditional.display.min_value != "":
min_value = $track.track_file_style_conditional.display.min_value
        #end if
        #if $track.track_file_style_conditional.display.max_value != "":
max_value = $track.track_file_style_conditional.display.max_value
        #end if
      #end if
      #if $track.track_file_style_conditional.height_narrow_peak:
height = $track.track_file_style_conditional.height_narrow_peak
      #end if
show_labels = $track.track_file_style_conditional.show_labels
file_type = narrow_peak
      #if $track.track_file_style_conditional.fontsize:
fontsize = $track.track_file_style_conditional.fontsize
      #end if
      #if $track.track_file_style_conditional.invert_orientation:
orientation = inverted
      #end if
overlay_previous = $track.track_file_style_conditional.overlay_select
      ## If spacer is asked a new section is created:
      #if $track.track_file_style_conditional.spacer_height != "":
[spacer]
height = $track.track_file_style_conditional.spacer_height
      #end if
    #end for
  #end if

  ## Bedgraph track
  #if $track.track_file_style_conditional.track_file_style_selector == "bedgraph_track_option":
    #for $data_bedgraph in $track.track_file_style_conditional.track_input_bedgraph:
[bedgraph_$counter]
file = $data_bedgraph
      #if $track.track_file_style_conditional.title:
title = $track.track_file_style_conditional.title
      #elif $track.track_file_style_conditional.overlay_select == "no":
title = $data_bedgraph.name
      #end if
      #if $track.track_file_style_conditional.color:
color = $track.track_file_style_conditional.color
      #end if
alpha = $track.track_file_style_conditional.alpha
      #if $track.track_file_style_conditional.color_negative.color_negative_select == "true":
negative_color = $track.track_file_style_conditional.color_negative.color
      #end if
      #if $track.track_file_style_conditional.height_bedgraph:
height = $track.track_file_style_conditional.height_bedgraph
      #end if
      #if $track.track_file_style_conditional.min_value != "":
min_value = $track.track_file_style_conditional.min_value
      #end if
      #if $track.track_file_style_conditional.max_value != "":
max_value = $track.track_file_style_conditional.max_value
      #end if
show_data_range = $track.track_file_style_conditional.show_data
nans_to_zeros = $track.track_file_style_conditional.nans_to_zeros
use_middle = $track.track_file_style_conditional.use_middle
      #set $columns = len(open(str($track.track_file_style_conditional.track_input_bedgraph)).readline().split('\t'))
      #if $columns > 4:
file_type = bedgraph_matrix
type = lines
      #else:
file_type = bedgraph
        #if $track.track_file_style_conditional.type_conditional.type_selector == 'fill_option':
type = fill
        #elif $track.track_file_style_conditional.type_conditional.type_selector == 'line_option':
type = line:$track.track_file_style_conditional.type_conditional.width_line
        #elif $track.track_file_style_conditional.type_conditional.type_selector == 'point_option':
type = points:$track.track_file_style_conditional.type_conditional.width_point
        #end if
      #end if
      #if $track.track_file_style_conditional.invert_orientation:
orientation = inverted
      #end if
overlay_previous = $track.track_file_style_conditional.overlay_select
      ## If spacer is asked a new section is created:
      #if $track.track_file_style_conditional.spacer_height != "":
[spacer]
height = $track.track_file_style_conditional.spacer_height
      #end if
    #end for
  #end if

  ## Bigwig tracks
  #if $track.track_file_style_conditional.track_file_style_selector == "bigwig_track_option":
    #for $data_bigwig in $track.track_file_style_conditional.track_input_bigwig:
[bigwig_$counter]
file = $data_bigwig
      #if $track.track_file_style_conditional.title:
title = $track.track_file_style_conditional.title
      #elif $track.track_file_style_conditional.overlay_select == "no":
title = $data_bigwig.name
      #end if
      #if $track.track_file_style_conditional.color:
color = $track.track_file_style_conditional.color
      #end if
alpha = $track.track_file_style_conditional.alpha
      #if $track.track_file_style_conditional.color_negative.color_negative_select == "true":
negative_color = $track.track_file_style_conditional.color_negative.color
      #end if
      #if $track.track_file_style_conditional.min_value != "":
min_value = $track.track_file_style_conditional.min_value
      #end if
      #if $track.track_file_style_conditional.max_value != "":
max_value = $track.track_file_style_conditional.max_value
      #end if
height = $track.track_file_style_conditional.height_bigwig
summary_method = $track.track_file_style_conditional.reading_bw_conditional.summary
nans_to_zeros = $track.track_file_style_conditional.reading_bw_conditional.nans_to_zeros
      #if $track.track_file_style_conditional.reading_bw_conditional.number_of_bins:
number_of_bins = $track.track_file_style_conditional.reading_bw_conditional.number_of_bins
      #end if
      #if $track.track_file_style_conditional.type_conditional.type_selector == 'fill_option':
type = fill
      #elif $track.track_file_style_conditional.type_conditional.type_selector == 'line_option':
type = line:$track.track_file_style_conditional.type_conditional.width_line
      #elif $track.track_file_style_conditional.type_conditional.type_selector == 'point_option':
type = points:$track.track_file_style_conditional.type_conditional.width_point
      #end if
show_data_range = $track.track_file_style_conditional.show_data
file_type = bigwig
      #if $track.track_file_style_conditional.invert_orientation:
orientation = inverted
      #end if
overlay_previous = $track.track_file_style_conditional.overlay_select
      ## If spacer is asked a new section is created:
      #if $track.track_file_style_conditional.spacer_height != "":
[spacer]
height = $track.track_file_style_conditional.spacer_height
      #end if
    #end for
  #end if

  ## bedgraph_matrix
  #if $track.track_file_style_conditional.track_file_style_selector == "bedgraph_matrix_track_option":
    #for $data_bedgraph_matrix in $track.track_file_style_conditional.track_input_bedgraph_matrix:
[bedgraph_matrix_$counter]
file = $data_bedgraph_matrix
      #if $track.track_file_style_conditional.title:
title = $track.track_file_style_conditional.title
      #else:
title = $data_bedgraph_matrix.name
      #end if
      #if $track.track_file_style_conditional.height_bedgraph:
height = $track.track_file_style_conditional.height_bedgraph
      #end if
      #if $track.track_file_style_conditional.min_value != "":
min_value = $track.track_file_style_conditional.min_value
      #end if
      #if $track.track_file_style_conditional.max_value != "":
max_value = $track.track_file_style_conditional.max_value
      #end if
      #if $track.track_file_style_conditional.type_lines:
type = $track.track_file_style_conditional.type_lines
      #end if
file_type = bedgraph_matrix
show_data_range = $track.track_file_style_conditional.show_data
plot_horizontal_lines = $track.track_file_style_conditional.plot_horizontal_lines
pos_score_in_bin = $track.track_file_style_conditional.pos_score_in_bin
      #if $track.track_file_style_conditional.invert_orientation:
orientation = inverted
      #end if
      ## If spacer is asked a new section is created:
      #if $track.track_file_style_conditional.spacer_height != "":
[spacer]
height = $track.track_file_style_conditional.spacer_height
      #end if
    #end for
  #end if

  ## Vlines:
  #if $track.track_file_style_conditional.track_file_style_selector == "vlines_track_option":
[vlines_$counter]
file = $track.track_file_style_conditional.track_input_bed_single
type = vlines
  #end if

  ## Hlines:
  #if $track.track_file_style_conditional.track_file_style_selector == "hlines_track_option":
[hlines_$counter]
    #if $track.track_file_style_conditional.title:
title = $track.track_file_style_conditional.title
    #end if
    #if $track.track_file_style_conditional.height:
height = $track.track_file_style_conditional.height
    #end if
    #if $track.track_file_style_conditional.min_value != "":
min_value = $track.track_file_style_conditional.min_value
    #end if
    #if $track.track_file_style_conditional.max_value != "":
max_value = $track.track_file_style_conditional.max_value
    #end if
y_values = $track.track_file_style_conditional.y_values
show_data_range = $track.track_file_style_conditional.show_data
color = $track.track_file_style_conditional.color
alpha = $track.track_file_style_conditional.alpha
line_width = $track.track_file_style_conditional.line_width
line_style = $track.track_file_style_conditional.line_style
    #if $track.track_file_style_conditional.invert_orientation:
orientation = inverted
    #end if
overlay_previous = $track.track_file_style_conditional.overlay_select
file_type = hlines
    ## If spacer is asked a new section is created:
    #if $track.track_file_style_conditional.spacer_height != "":
[spacer]
height = $track.track_file_style_conditional.spacer_height
    #end if
  #end if

  ## Spacer
  #if $track.track_file_style_conditional.track_file_style_selector == "spacer_option":
[spacer]
    #if $track.track_file_style_conditional.spacer_height != "":
height = $track.track_file_style_conditional.spacer_height
    #end if
  #end if
#end for

#if $x_axis.x_axis_select == "true":
  #if $x_axis.where == 'bottom':
[x-axis]
    #if $x_axis.fontsize:
fontsize = $x_axis.fontsize
    #end if
where = bottom
  #end if
#end if
</configfile>
    </configfiles>
    <inputs>
        <expand macro="region" />

        <repeat name="tracks" min="1" title="Include tracks in your plot"
            help="Tracks can be of different filetypes. E.g BED, HiC-Matrix, BigWig or BedGraph">
            <conditional name="track_file_style_conditional">
                <param name="track_file_style_selector" type="select" label="Choose style of the track">
                    <option value="hic_matrix_option">TAD visualization</option>
                    <option value="chrom_states_option">Chromatine states</option>
                    <option value="bedgraph_matrix_track_option">TAD score</option>
                    <option value="gene_track_option">Gene track / Bed track</option>
                    <option value="link_track_option">Link track</option>
                    <option value="narrow_peak_track_option">NarrowPeak track</option>
                    <option value="bigwig_track_option">Bigwig track</option>
                    <option value="bedgraph_track_option">Bedgraph track </option>
                    <option value="bedgraph_matrix_track_option">Bedgraph matrix track</option>
                    <option value="vlines_track_option">Vlines track</option>
                    <option value="hlines_track_option">Hlines track</option>
                    <option value="spacer_option">Spacer</option>
                </param>
                <when value="hic_matrix_option">
                    <expand macro="plot_title" />
                    <expand macro="matrix_h5_cooler_multiple_macro" />

                    <expand macro="colormap" />
                    <param name="depth" type="integer" value="8000000" optional="True" label="Depth" />
                    <expand macro="minmax_macro" />
                    <param name="transform" type="select" label="Plot the transformed value">
                        <option value="log1p" selected="True" >log1p</option>
                        <option value="log">log</option>
                        <option value="-log">-log</option>
                        <option value="no">no transformation</option>

                    </param>
                    <param name="height_matrix" type="float" value="" optional="True" label="height"/>
                    <param name="show_masked_bins" type="boolean" truevalue="true" falsevalue="false" checked="false"
                            label="Show masked bins" />
                    <param name="boundaries_file" type="data" optional="True" format="bed" label="Boundaries file" multiple="True"/>
                    <param name="scale_factor" type="float" value="1.0" optional="True" label="Scale factor" help="if the values in the matrix need to be scaled the following parameter can be used" />
                    <param name="rasterize" type="boolean" truevalue="true" falsevalue="false" checked="true"
                            label="Rasterize the heatmap" />
                    <expand macro="inverted_macro" />
                    <expand macro="spacer_macro" />

                </when>
                <when value="chrom_states_option">
                    <expand macro="plot_title" />
                    <expand macro="track_input_bed_macro" />
                    <expand macro="color_bed_macro" />
                    <param name="line_width" type="float" value="0.5" label="width of lines" />
                    <param name="height_chrom" type="float" value="1.5" optional="True" label="height"/>
                    <param name="labels" type="boolean" truevalue="true" falsevalue="false" checked="true"
                            label="Plot labels" />
                    <expand macro="spacer_macro" />

                </when>
                <when value="gene_track_option">
                    <expand macro="plot_title" />

                    <expand macro="track_input_bed_gtf_macro" />
                    <expand macro="color_bed_macro" />
                    <param name="height_bed" type="float" value="1.5" optional="True" label="height"/>
                    <param name="labels" type="boolean" truevalue="true" falsevalue="false" checked="true"
                            label="Plot labels" />
                    <param name="flybase" type="boolean" checked="true" label="Use flybase style" help="This will be only used for bed with 12 columns"/>
                    <param name="display" type="select" label="display to use">
                        <option value="stacked" selected="True">stacked (no overlap even with the label)</option>
                        <option value="interleaved">interleaved (everything on 2 lines)</option>
                        <option value="collapsed">collapsed (everything on 1 line)</option>
                        <option value="triangles">triangles (plot triangles between start and end)</option>
                    </param>
                    <param name="arrowhead_included" type="boolean" truevalue="true" falsevalue="false" checked="false"
                            label="Include the arrowhead in the bed interval:"
                            help="When set to False, the arrow indicating the orientation of the interval is plotted outside of the interval."/>
                    <param name="fontsize" type="integer" value="" optional="True" label="Fontsize" />
                    <expand macro="bed_advanced_macro" />
                    <expand macro="overlay_macro" />
                    <expand macro="inverted_macro" />
                    <expand macro="spacer_macro" />

                </when>
                <when value="link_track_option">
                    <expand macro="plot_title" />
                    <expand macro="track_input_link_macro" />
                    <expand macro="links_color_macro" />
                    <expand macro="lines_macro" />
                    <param name="links_type" type="select" label="Representation of the link:">
                        <option value="arcs" selected="True">arcs (a line between the centers of the 2 regions)</option>
                        <option value="triangles">triangles</option>
                        <option value="loops">loops (a rectangle highlighting the intersection)</option>
                    </param>
                    <param name="height" type="float" value="1.5" optional="True" label="height"/>
                    <expand macro="minmax_macro" />
                    <expand macro="overlay_macro" />
                    <expand macro="inverted_macro" />
                    <expand macro="spacer_macro" />
                </when>
                <when value="narrow_peak_track_option">
                    <expand macro="plot_title" />
                    <expand macro="track_input_narrow_peak_macro" />
                    <param name="color" type="color" value="#000000" label="Color of track" optional="True" />
                    <param name="height_narrow_peak" type="float" value="1.5" optional="True" label="height"/>
                    <conditional name="display">
                        <param name="display_selector" type="select" label="display to use">
                            <option value="peak" selected="True">peak: Draw a peak shape from start, end, summit, height</option>
                            <option value="box">box: Draw a box</option>
                        </param>
                        <when value="peak">
                            <param name="use_summit" type="boolean" truevalue="true" falsevalue="false" checked="true"
                                   optional="True" label="Use summit information to make the curve." />
                            <param name="show_data" type="boolean" truevalue="true" falsevalue="false" checked="false"
                                   label="Show visualization of data range" />
                            <param name="width_adjust" type="float" value="1.5" optional="True"
                                   label="Factor to change the width of the curve."/>
                            <expand macro="minmax_macro" />
                        </when>
                        <when value="box">
                            <param name="use_summit" type="boolean" truevalue="true" falsevalue="false" checked="true"
                                   optional="True" label="Plot a vertical bar at the summit position." />
                        </when>
                    </conditional>
                    <param name="show_labels" type="boolean" truevalue="true" falsevalue="false" checked="true"
                            label="Plot labels (name, p-val, q-val)" />
                    <param name="fontsize" type="integer" value="" optional="True" label="Fontsize" />
                    <expand macro="overlay_macro" />
                    <expand macro="inverted_macro" />
                    <expand macro="spacer_macro" />

                </when>
                <when value="bedgraph_track_option">
                    <expand macro="plot_title" />
                    <expand macro="track_input_bedgraph_macro" />
                    <expand macro="color_coverage_macro" />
                    <expand macro="minmax_macro" />
                    <param name="height_bedgraph" type="float" value="1.5" optional="True" label="height"/>
                    <expand macro="type_coverage_macro" />
                    <param name="nans_to_zeros" type="boolean" truevalue="true" falsevalue="false" checked="false"
                        label="NAN's to zeros" />
                    <param name="use_middle" type="boolean" truevalue="true" falsevalue="false" checked="false"
                        label="Use middle: Instead of using start and end, use the middle of intervals (useful for 4C-seq tracks)." />
                    <param name="show_data" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Show visualization of data range" />
                    <expand macro="inverted_macro" />
                    <expand macro="overlay_macro" />
                    <expand macro="spacer_macro" />
                </when>
                <when value="bigwig_track_option">
                    <expand macro="plot_title" />

                    <expand macro="track_input_bigwig_macro" />
                    <expand macro="color_coverage_macro" />

                    <expand macro="minmax_macro" />

                    <param name="height_bigwig" type="float" value="1.5" optional="True" label="height"/>
                    <expand macro="reading_bw_macro" />
                    <expand macro="type_coverage_macro" />
                    <expand macro="type_coverage_macro" />
                    <param name="show_data" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Show visualization of data range"/>
                    <expand macro="inverted_macro" />
                    <expand macro="overlay_macro" />
                    <expand macro="spacer_macro" />

                </when>

                <when value="bedgraph_matrix_track_option">
                    <expand macro="plot_title" />

                    <expand macro="track_input_bedgraph_matrix_macro" />
                    <expand macro="minmax_macro" />

                    <param name="height_bedgraph" type="float" value="1.5" optional="True" label="height"/>

                    <param name="type_lines" type="boolean" truevalue="lines" falsevalue="" checked="false"
                            label="Set 'type' to 'lines'" help="if type is set as lines, then the TAD score lines are drawn instead
                            of the matrix."/>
                    <param name="pos_score_in_bin" type="select" label="Position of the score with respect to bin start and end" help="Only used when type is lines">
                        <option value="center" selected="True">Center</option>
                        <option value="block">Block (draw a horizontal line between start and end)</option>
                    </param>
                    <param name="plot_horizontal_lines" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Plot an horizontal line at 0 when type is lines" />
                    <param name="show_data" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Show visualization of data range" />
                    <expand macro="inverted_macro" />
                    <expand macro="spacer_macro" />

                </when>
                <when value="vlines_track_option">
                    <expand macro="track_input_bed_single_macro" />
                </when>
                <when value="hlines_track_option">
                    <expand macro="plot_title" />
                    <param name="y_values" type="text" value="10, 200" label="Values where horizontal lines should be plotted separated by comma"/>
                    <param name="color" type="color" value="#000000" label="Color of line(s)" optional="True" />
                    <expand macro="lines_macro" />
                    <param name="height" type="float" value="1.5" optional="True" label="height"/>
                    <expand macro="minmax_macro" />
                    <param name="show_data" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Show visualization of data range"/>
                    <expand macro="inverted_macro" />
                    <expand macro="overlay_macro" />
                    <expand macro="spacer_macro" />
                </when>
                <when value="spacer_option">
                    <param name="spacer_height" type="float" value="" optional="True"
                        label="Height of the spacer."/>
                </when>
            </conditional>

        </repeat>


        <conditional name="x_axis">
            <param name="x_axis_select" type="select" label="Configure x-axis">
                <option value="false" selected="True">No</option>
                <option value="true">Yes</option>
            </param>
            <when value="true">
                <param name="fontsize" type="integer" value="" optional="True" label="Fontsize" />
                <param name="where" type="select" label="Where to place the x-axis">
                    <option value="top" selected="True">Top</option>
                    <option value="bottom">Bottom</option>
                </param>
            </when>
            <when value="false" />
        </conditional>
        <param name="image_file_format" type="select" label="Image output format">
                <option value="png">png</option>
                <option value="svg">svg</option>
        </param>
    </inputs>
    <outputs>
        <data format="png" name="outFileName" from_work_dir="plot" label="${tool.name} on [${on_string}]: Plot">
            <change_format>
                <when input="image_file_format" value="png" format="png" />
                <when input="image_file_format" value="svg" format="svg" />
            </change_format>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="region" value="chrX:3000000-3500000"/>
            <conditional name="x_axis">
                <param name="x_axis_select" value="true" />
            </conditional>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="hic_matrix_option" />
                    <param name="matrix_h5_cooler_multiple" value="Li_et_al_2015.h5"/>
                    <param name="title" value="Kc DpnII (Li et al. 2015)" />
                    <param name="colormap" value="RdYlBu_r" />
                    <param name="depth" value="200000" />
                    <param name="transform" value="log1p" />
                    <param name="boundaries_file" value="domains.bed" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="spacer_option" />
                    <param name="spacer_height" value="0.05" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="chrom_states_option" />
                    <param name="track_input_bed" value="tad_classification.bed" ftype="bed" />
                    <param name="title" value="TAD state" />
                    <param name="height_chrom" value="0.5" />
                    <param name="labels" value="false" />
                    <conditional name="color_bed">
                        <param name="color_bed_select" value="bed_rgb" />
                    </conditional>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bedgraph_matrix_track_option" />
                    <param name="track_input_bedgraph_matrix" value="tad_score.gz" ftype="bedgraph" />
                    <param name="title" value="TAD separation score (Ramirez et al.)" />
                    <param name="height_bedgraph" value="10" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="spacer_option" />
                    <param name="spacer_height" value="1" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bedgraph_track_option" />
                    <param name="track_input_bedgraph" value="bedgraph_chrx_2e6_5e6.bg" ftype="bedgraph" />
                    <param name="title" value="bedgraph" />
                    <param name="height_bedgraph" value="4" />
                    <param name="color" value="blue" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bigwig_track_option" />
                    <param name="track_input_bigwig" value="bigwig_chrx_2e6_5e6.bw" ftype="bigwig" />
                    <param name="title" value="rep 1 test fill" />
                    <param name="height_bigwig" value="4" />
                    <param name="color" value="blue" />
                    <conditional name="type_conditional">
                        <param name="type_selector" value="fill_option" />
                    </conditional>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bigwig_track_option" />
                    <param name="track_input_bigwig" value="bigwig_chrx_2e6_5e6.bw" ftype="bigwig" />
                    <param name="title" value="rep 1 test line" />
                    <param name="height_bigwig" value="4" />
                    <param name="color" value="red" />
                    <conditional name="type_conditional">
                        <param name="type_selector" value="line_option" />
                        <param name="width_line" value="1" />
                    </conditional>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bigwig_track_option" />
                    <param name="track_input_bigwig" value="bigwig_chrx_2e6_5e6.bw" ftype="bigwig" />
                    <param name="title" value="rep 1 test lw=0.2" />
                    <param name="height_bigwig" value="4" />
                    <param name="color" value="red" />
                    <conditional name="type_conditional">
                        <param name="type_selector" value="line_option" />
                        <param name="width_line" value="0.1" />

                    </conditional>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bigwig_track_option" />
                    <param name="track_input_bigwig" value="bigwig_chrx_2e6_5e6.bw" ftype="bigwig" />
                    <param name="title" value="rep 1 test point:0.5" />
                    <param name="height_bigwig" value="4" />
                    <param name="color" value="black" />
                    <conditional name="type_conditional">
                        <param name="type_selector" value="point_option" />
                        <param name="width_point" value="0.5" />

                    </conditional>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="spacer_option" />
                    <param name="spacer_height" value="0.5" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_genes.bed.gz" ftype="bed" />
                    <param name="title" value="genes" />
                    <param name="height_bed" value="5" />
                    <param name="fontsize" value="10" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="spacer_option" />
                    <param name="spacer_height" value="1" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_genes.bed.gz" ftype="bed" />
                    <param name="title" value="max num rows 3" />
                    <param name="height_bed" value="3" />
                    <param name="fontsize" value="8" />
                    <section name="bed_advanced">
                        <param name="gene_rows" value="3" />
                    </section>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="spacer_option" />
                    <param name="spacer_height" value="1" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_genes.bed6.gz" ftype="bed" />
                    <param name="title" value="bed6 global max row" />
                    <param name="height_bed" value="20" />
                    <param name="fontsize" value="10" />
                    <section name="bed_advanced">
                        <param name="global_max_row" value="true" />
                    </section>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="vlines_track_option" />
                    <param name="track_input_bed_single" value="domains.bed" ftype="bed" />
                </conditional>
            </repeat>
            <param name="image_file_format" value="png" />
            <output name="outFileName" file="master_TADs_plot.png" ftype="png" compare="sim_size" delta="35000" />
        </test>
        <test>
            <param name="region" value="chrX:3000000-3500000"/>
            <conditional name="x_axis">
                <param name="x_axis_select" value="true" />
            </conditional>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bigwig_track_option" />
                    <param name="track_input_bigwig" value="bigwig_chrx_2e6_5e6.bw,bigwig_chrx_2e6_5e6.bw" ftype="bigwig" />
                    <param name="title" value="rep 1 test line" />
                    <param name="height_bigwig" value="4" />
                    <param name="color" value="red" />
                    <conditional name="type_conditional">
                        <param name="type_selector" value="line_option" />
                        <param name="width_line" value="1" />
                    </conditional>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bigwig_track_option" />
                    <param name="track_input_bigwig" value="bigwig_chrx_2e6_5e6.bw" ftype="bigwig" />
                    <param name="title" value="nans_to_zeros" />
                    <param name="height_bigwig" value="4" />
                    <param name="color" value="blue" />
                    <section name="reading_bw_conditional">
                        <param name="nans_to_zeros" value="true" />
                    </section>
                    <param name="show_data" value="true" />
                    <conditional name="type_conditional">
                        <param name="type_selector" value="line_option" />
                        <param name="width_line" value="1" />
                    </conditional>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="hlines_track_option" />
                    <param name="title" value="" />
                    <param name="color" value="orange" />
                    <param name="y_values" value="50" />
                    <param name="line_width" value="2" />
                    <param name="line_style" value="dashed" />
                    <param name="overlay_select" value="share-y" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="hlines_track_option" />
                    <param name="title" value="hlines" />
                    <param name="color" value="purple" />
                    <param name="y_values" value="0, 10, 20, 100" />
                    <param name="min_value" value="12" />
                    <param name="show_data" value="true" />
                    <param name="invert_orientation" value="true" />
                </conditional>
            </repeat>
            <param name="image_file_format" value="png" />
            <output name="outFileName" file="bigwig_multiple.png" ftype="png" compare="sim_size" delta="35000" />
        </test>
        <test>
            <param name="region" value="chrX:3000000-3500000"/>
            <conditional name="x_axis">
                <param name="x_axis_select" value="true" />
            </conditional>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="hic_matrix_option" />
                    <param name="matrix_h5_cooler_multiple" value="Li_et_al_2015.h5"/>
                    <param name="title" value="Kc DpnII (Li et al. 2015) log1p" />
                    <param name="colormap" value="RdYlBu_r" />
                    <param name="depth" value="200000" />
                    <param name="transform" value="log1p" />
                    <param name="boundaries_file" value="domains.bed" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="chrom_states_option" />
                    <param name="track_input_bed" value="tad_classification.bed" ftype="bed" />
                    <param name="title" value="TAD state" />
                    <param name="height_chrom" value="0.5" />
                    <param name="labels" value="false" />
                    <conditional name="color_bed">
                        <param name="color_bed_select" value="bed_rgb" />
                    </conditional>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="hic_matrix_option" />
                    <param name="matrix_h5_cooler_multiple" value="Li_et_al_2015.h5"/>
                    <param name="title" value="Kc DpnII (Li et al. 2015) inverted no transform" />
                    <param name="colormap" value="Reds" />
                    <param name="depth" value="200000" />
                    <param name="transform" value="no" />
                    <param name="invert_orientation" value="true" />
                    <param name="min_value" value="5" />
                    <param name="max_value" value="70" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="spacer_option" />
                    <param name="spacer_height" value="1" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bedgraph_track_option" />
                    <param name="track_input_bedgraph" value="test_with_neg_values.bg.gz" ftype="bedgraph" />
                    <param name="title" value="bedgraph with negative values" />
                    <param name="height_bedgraph" value="4" />
                    <param name="color" value="black" />
                    <conditional name="color_negative">
                        <param name="color_negative_select" value="true" />
                        <param name="color" value="red" />
                    </conditional>
                    <conditional name="type_conditional">
                        <param name="type_selector" value="fill_option" />
                    </conditional>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bedgraph_track_option" />
                    <param name="track_input_bedgraph" value="bedgraph_chrx_2e6_5e6.bg" ftype="bedgraph" />
                    <param name="title" value="bedgraph" />
                    <param name="height_bedgraph" value="4" />
                    <param name="color" value="blue" />
                    <conditional name="type_conditional">
                        <param name="type_selector" value="fill_option" />
                    </conditional>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bigwig_track_option" />
                    <param name="track_input_bigwig" value="bigwig_chrx_2e6_5e6.bw" ftype="bigwig" />
                    <param name="title" value="rep 1 test fill" />
                    <param name="height_bigwig" value="4" />
                    <param name="color" value="blue" />
                    <conditional name="type_conditional">
                        <param name="type_selector" value="fill_option" />
                    </conditional>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bigwig_track_option" />
                    <param name="track_input_bigwig" value="bigwig_chrx_2e6_5e6.bw" ftype="bigwig" />
                    <param name="title" value="(red points/width=5/max value/100 bins) overlayed with (dark red line/min value/30000 bins) overlayed with (black line/min value)" />
                    <param name="height_bigwig" value="10" />
                    <param name="color" value="red" />
                    <conditional name="type_conditional">
                        <param name="type_selector" value="point_option" />
                        <param name="width_point" value="5" />
                    </conditional>
                    <section name="reading_bw_conditional">
                        <param name="summary" value="max"/>
                        <param name="number_of_bins" value="100"/>
                    </section>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bigwig_track_option" />
                    <param name="track_input_bigwig" value="bigwig_chrx_2e6_5e6.bw" ftype="bigwig" />
                    <param name="height_bigwig" value="10" />
                    <param name="color" value="#c00000" />
                    <conditional name="type_conditional">
                        <param name="type_selector" value="line_option" />
                    </conditional>
                    <section name="reading_bw_conditional">
                        <param name="summary" value="min"/>
                    </section>
                    <param name="overlay_select" value="share-y" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bigwig_track_option" />
                    <param name="track_input_bigwig" value="bigwig_chrx_2e6_5e6.bw" ftype="bigwig" />
                    <param name="height_bigwig" value="10" />
                    <param name="color" value="black" />
                    <conditional name="type_conditional">
                        <param name="type_selector" value="line_option" />
                    </conditional>
                    <section name="reading_bw_conditional">
                        <param name="summary" value="min"/>
                        <param name="number_of_bins" value="30000"/>
                    </section>
                    <param name="overlay_select" value="share-y" />
                    <param name="spacer_height" value="1" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_genes.bed.gz" ftype="bed" />
                    <param name="title" value="genes in ucsc" />
                    <param name="height_bed" value="5" />
                    <param name="fontsize" value="10" />
                    <param name="flybase" value="false"/>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_genes.bed6.gz" ftype="bed" />
                    <param name="title" value="bed6 global max row color from score" />
                    <param name="height_bed" value="20" />
                    <param name="fontsize" value="10" />
                    <section name="bed_advanced">
                        <param name="global_max_row" value="true" />
                    </section>
                    <conditional name="color_bed">
                        <param name="color_bed_select" value="colormap" />
                        <param name="color" value="RdYlBu_r" />
                    </conditional>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="domains.bed" ftype="bed" />
                    <param name="title" value="domains.bed using the 9th field for colors interleaved" />
                    <param name="height_bed" value="2" />
                    <param name="fontsize" value="10" />
                    <conditional name="color_bed">
                        <param name="color_bed_select" value="bed_rgb" />
                    </conditional>
                    <param name="border_color" value="red" />
                    <param name="labels" value="false" />
                    <param name="display" value="interleaved" />
                </conditional>
            </repeat>
            <param name="image_file_format" value="png" />
            <output name="outFileName" file="master_TADs_BW_plot.png" ftype="png" compare="sim_size" delta="35000" />
        </test>
        <test>
            <param name="region" value="X:2700000-3100000"/>
            <conditional name="x_axis">
                <param name="x_axis_select" value="true" />
                <param name="where" value="bottom" />
            </conditional>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bigwig_track_option" />
                    <param name="track_input_bigwig" value="bigwig_chrx_2e6_5e6.bw" ftype="bigwig" />
                    <param name="title" value="(bigwig color=blue 2000 bins) overlayed with (bigwig mean color=red alpha = 0.5 max over 300 bins)" />
                    <param name="height_bigwig" value="7" />
                    <param name="color" value="#00b0f0" />
                    <section name="reading_bw_conditional">
                        <param name="number_of_bins" value="2000"/>
                    </section>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bigwig_track_option" />
                    <param name="track_input_bigwig" value="bigwig_chrx_2e6_5e6.bw" ftype="bigwig" />
                    <param name="title" value="" />
                    <param name="color" value="#ff0000" />
                    <param name="alpha" value="0.5" />
                    <param name="summary" value="max" />
                    <section name="reading_bw_conditional">
                        <param name="number_of_bins" value="300"/>
                    </section>
                    <param name="overlay_select" value="share-y"/>
                </conditional>
            </repeat>
            <param name="image_file_format" value="png" />
            <output name="outFileName" file="test_alpha.png" ftype="png" compare="sim_size" delta="35000" />
        </test>
        <test>
            <param name="region" value="X:3000000-3300000"/>
            <conditional name="x_axis">
                <param name="x_axis_select" value="true" />
            </conditional>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_subset_BDGP5.78.gtf.gz" ftype="gtf" />
                    <param name="title" value="test" />
                    <param name="height_bed" value="10" />
                    <param name="color" value="#000000" />
                    <param name="flybase" value="false" />
                    <param name="spacer_height" value="1"/>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_subset_BDGP5.78_asbed4.bed.gz" ftype="bed" />
                    <param name="title" value="test" />
                    <param name="height_bed" value="10" />
                    <param name="color" value="#000000" />
                    <param name="flybase" value="false" />
                    <param name="spacer_height" value="1"/>
                </conditional>
            </repeat>
            <param name="image_file_format" value="png" />
            <output name="outFileName" file="test_gtf_bed4.png" ftype="png" compare="sim_size" delta="35000" />
        </test>
        <test>
            <param name="region" value="X:2760000-2802000"/>
            <conditional name="x_axis">
                <param name="x_axis_select" value="true" />
                <param name="where" value="bottom" />
            </conditional>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="narrow_peak_track_option" />
                    <param name="title" value="box" />
                    <param name="track_input_narrow_peak" value="test2.narrowPeak" ftype="encodepeak" />
                    <param name="color" value="#9bbb59" />
                    <param name="height_narrow_peak" value="4" />
                    <conditional name="display">
                        <param name="display_selector" value="box" />
                        <param name="use_summit" value="true" />
                    </conditional>
                    <param name="show_labels" value="true" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="narrow_peak_track_option" />
                    <param name="title" value="peak width 3" />
                    <param name="track_input_narrow_peak" value="test2.narrowPeak" ftype="encodepeak" />
                    <param name="color" value="#c0504d" />
                    <param name="height_narrow_peak" value="4" />
                    <conditional name="display">
                        <param name="display_selector" value="peak" />
                        <param name="use_summit" value="true" />
                        <param name="show_data" value="true" />
                        <param name="width_adjust" value="3" />
                        <param name="max_value" value="50" />
                    </conditional>
                    <param name="show_labels" value="false" />
                    <param name="spacer_height" value="0.5"/>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="narrow_peak_track_option" />
                    <param name="title" value="peak no data range" />
                    <param name="track_input_narrow_peak" value="test2.narrowPeak" ftype="encodepeak" />
                    <param name="color" value="#000000" />
                    <param name="height_narrow_peak" value="4" />
                    <conditional name="display">
                        <param name="display_selector" value="peak" />
                        <param name="use_summit" value="false" />
                        <param name="show_data" value="false" />
                    </conditional>
                    <param name="show_labels" value="true" />
                </conditional>
            </repeat>
            <param name="image_file_format" value="png" />
            <output name="outFileName" file="test_narrowPeak.png" ftype="png" compare="sim_size" delta="35000" />
        </test>
        <test>
            <param name="region" value="chrX:3300000-3500000"/>
            <conditional name="x_axis">
                <param name="x_axis_select" value="true" />
            </conditional>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_genes.bed.gz" ftype="bed" />
                    <param name="title" value="genes" />
                    <param name="height_bed" value="10" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_subset_BDGP5.78.gtf.gz" ftype="gtf" />
                    <param name="title" value="gtf" />
                    <param name="height_bed" value="10" />
                    <section name="bed_advanced">
                        <section name ="flybase">
                            <param name="height_utr" value="0.75"/>
                            <param name="color_utr" value="#ff0000"/>
                        </section>
                        <section name ="gtf">
                            <param name="prefered_name" value="gene_name"/>
                            <param name="merge_transcripts" value="true"/>
                        </section>
                    </section>
                </conditional>
            </repeat>
            <param name="image_file_format" value="png" />
            <output name="outFileName" file="test_gtf_flybase_param.png" ftype="png" compare="sim_size" delta="35000" />
        </test>
        <test>
            <param name="region" value="chrX:3300000-3500000"/>
            <conditional name="x_axis">
                <param name="x_axis_select" value="true" />
            </conditional>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_genes.bed.gz" ftype="bed" />
                    <param name="title" value="dm3_genes.bed" />
                    <param name="height_bed" value="10" />
                    <param name="flybase" value="false" />
                    <section name="bed_advanced">
                        <param name="global_max_row" value="true" />
                        <param name="max_labels" value="15" />
                    </section>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_genes.bed.gz" ftype="bed" />
                    <param name="title" value="genes.bed.gz" />
                    <param name="height_bed" value="10" />
                    <param name="flybase" value="false" />
                    <section name="bed_advanced">
                        <param name="line_width" value="2"/>
                        <section name ="ucsc">
                            <param name="arrow_interval" value="10"/>
                        </section>
                    </section>
                </conditional>
            </repeat>
            <param name="image_file_format" value="png" />
            <output name="outFileName" file="test_ucsc_param.png" ftype="png" compare="sim_size" delta="35000" />
        </test>
        <test>
            <param name="region" value="X:3133000-3138000"/>
            <conditional name="x_axis">
                <param name="x_axis_select" value="true" />
            </conditional>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_subset_BDGP5.78.gtf.gz" ftype="gtf" />
                    <param name="title" value="test" />
                    <param name="height_bed" value="10" />
                    <param name="flybase" value="true" />
                    <param name="spacer_height" value="1"/>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_subset_BDGP5.78_asbed4.bed.gz" ftype="bed" />
                    <param name="title" value="test" />
                    <param name="height_bed" value="10" />
                    <conditional name="color_bed">
                        <param name="color_bed_select" value="manually" />
                        <param name="color" value="red" />
                    </conditional>
                    <param name="flybase" value="false" />
                    <param name="spacer_height" value="1"/>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="dm3_subset_BDGP5.78.gtf.gz" ftype="gtf" />
                    <param name="title" value="test" />
                    <param name="height_bed" value="10" />
                    <conditional name="color_bed">
                        <param name="color_bed_select" value="manually" />
                        <param name="color" value="red" />
                    </conditional>
                    <param name="flybase" value="true" />
                    <param name="spacer_height" value="1"/>
                    <param name="arrowhead_included" value="true"/>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="vlines_track_option" />
                    <param name="track_input_bed_single" value="dm3_subset_BDGP5.78_asbed4.bed.gz" ftype="bed" />
                </conditional>
            </repeat>
            <param name="image_file_format" value="png" />
            <output name="outFileName" file="test_arrowhead_zoom.png" ftype="png" compare="sim_size" delta="35000" />
        </test>
        <test>
            <param name="region" value="X:3340000-3380000"/>
            <conditional name="x_axis">
                <param name="x_axis_select" value="true" />
            </conditional>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="gene_track_option" />
                    <param name="track_input_bed" value="domains.bed" ftype="bed" />
                    <param name="height_bed" value="6" />
                    <conditional name="color_bed">
                        <param name="color_bed_select" value="manually" />
                        <param name="color" value="yellow" />
                    </conditional>
                    <param name="display" value="triangles" />
                    <param name="spacer_height" value="1"/>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bedgraph_track_option" />
                    <param name="track_input_bedgraph" value="bedgraph_chrx_2e6_5e6.bg" ftype="bedgraph" />
                    <param name="title" value="bedgraph" />
                    <param name="height_bedgraph" value="4" />
                    <param name="color" value="blue" />
                    <conditional name="type_conditional">
                        <param name="type_selector" value="line_option" />
                    </conditional>
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bedgraph_track_option" />
                    <param name="track_input_bedgraph" value="bedgraph_chrx_2e6_5e6.bg" ftype="bedgraph" />
                    <param name="title" value="bedgraph" />
                    <param name="height_bedgraph" value="4" />
                    <param name="color" value="blue" />
                    <param name="use_middle" value="true" />
                    <conditional name="type_conditional">
                        <param name="type_selector" value="line_option" />
                    </conditional>
                </conditional>
            </repeat>
            <param name="image_file_format" value="png" />
            <output name="outFileName" file="test_middle_triangle.png" ftype="png" compare="sim_size" delta="35000" />
        </test>
        <test>
            <param name="region" value="chrX:3250000-3400000"/>
            <conditional name="x_axis">
                <param name="x_axis_select" value="true" />
            </conditional>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="hic_matrix_option" />
                    <param name="matrix_h5_cooler_multiple" value="Li_et_al_2015.h5"/>
                    <param name="title" value="Kc DpnII (Li et al. 2015)" />
                    <param name="colormap" value="RdYlBu_r" />
                    <param name="depth" value="100000" />
                    <param name="transform" value="log1p" />
                    <param name="show_masked_bins" value="true" />
                    <param name="scale_factor" value="2.0" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="spacer_option" />
                    <param name="spacer_height" value="0.05" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bedgraph_matrix_track_option" />
                    <param name="track_input_bedgraph_matrix" value="tad_score.gz" ftype="bedgraph" />
                    <param name="title" value="TAD separation score (Ramirez et al.)" />
                    <param name="height_bedgraph" value="10" />
                    <param name="type_lines" value="lines" />
                    <param name="pos_score_in_bin" value="block" />
                    <param name="plot_horizontal_lines" value="true" />
                    <param name="show_data" value="true" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="bedgraph_matrix_track_option" />
                    <param name="track_input_bedgraph_matrix" value="tad_score.gz" ftype="bedgraph" />
                    <param name="title" value="TAD separation score (Ramirez et al.)" />
                    <param name="height_bedgraph" value="10" />
                    <param name="type_lines" value="lines" />
                    <param name="pos_score_in_bin" value="center" />
                    <param name="plot_horizontal_lines" value="false" />
                </conditional>
            </repeat>
            <param name="image_file_format" value="png" />
            <output name="outFileName" file="test_TADs_bdgm.png" ftype="png" compare="sim_size" delta="35000" />
        </test>
        <test>
            <param name="region" value="chrX:3000000-3300000"/>
            <conditional name="x_axis">
                <param name="x_axis_select" value="true" />
            </conditional>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="hic_matrix_option" />
                    <param name="matrix_h5_cooler_multiple" value="Li_et_al_2015.h5"/>
                    <param name="title" value="Kc DpnII (Li et al. 2015)" />
                    <param name="colormap" value="Purples" />
                    <param name="depth" value="190000" />
                    <param name="transform" value="no" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="link_track_option" />
                    <param name="track_input_link" value="test.arcs" ftype="bed" />
                    <param name="title" value="" />
                    <param name="line_width" value="10" />
                    <param name="links_type" value="loops" />
                    <conditional name="color_link">
                        <param name="color_link_select" value="manually" />
                        <param name="color" value="red" />
                    </conditional>
                    <param name="overlay_select" value="share-y" />
                </conditional>
            </repeat>
            <repeat name="tracks">
                <conditional name="track_file_style_conditional">
                    <param name="track_file_style_selector" value="link_track_option" />
                    <param name="track_input_link" value="test.arcs" ftype="bed" />
                    <param name="title" value="" />
                    <param name="height" value="5" />
                    <conditional name="color_link">
                        <param name="color_link_select" value="colormap" />
                        <param name="color" value="hot" />
                    </conditional>
                    <param name="max_value" value="5"/>
                    <param name="invert_orientation" value="true" />
                </conditional>
            </repeat>
            <param name="image_file_format" value="png" />
            <output name="outFileName" file="test_link.png" ftype="png" compare="sim_size" delta="35000" />
        </test>
    </tests>
    <help><![CDATA[

pyGenomeTracks
==============

**pyGenomeTracks** is a visualization tool which aims to produce high-quality genome browser tracks that are highly customizable.
    Currently, it is possible to plot:

    - bigwig
    - bed (many options)
    - bedgraph
    - links (represented as arcs)
    - Hi-C matrices

_________________

Usage
-----

This tool takes various types of tracks as input:

    - **Chromatin states:** display blocks of different colors following a bed file.
    - **Gene track / Bed Track:** display genes or bed files. Labels like gene names can be toggled on or off.
    - **Bigwig track:** generic bigwig track plotting.
    - **Bedgraph track:** generic bedgraph track plotting.
    - **Bedgraph matrix track** is used to specifically plot bm files computed by HiCExplorer's ``hicFindTADs`` (TAD seperation scores).
    - **Vlines:** vertical lines drawn on top of all tracks following a bed file. It is used as a visual support where regions start / end over all tracks, for example to display TAD boundaries computed by HiCExplorer's ``hicFindTADs``.
    - **Spacer:** Add some space between two tracks.
    - **Hi-C tracks:**
        - **TAD vizualisation:** corrected Hi-C contact matrix to plot a contact heatmap. It is recommended to follow HiCExplorer's ``hicPlotMatrix`` instructions. Boundaries file can used, which is the output of HiCExplorer's ``hicFindTADs`` in bed format. If selected, TADs will be drawn directly on the contact heatmap.
        - **TAD score:** display TAD seperation score computed by HiCExplorer's ``hicFindTADs``.


For each track, parameters for the color, the width or the font size can be defined.

_________________

Output
------

**pyGenomeTracks** output is similar to a genome browser screen-shot that besides the usual genes, and score data (like bigwig or bedgraph files)
also contains Hi-C data. The plot is composed of tracks that need to be specified.
Below is represented the 85 Mb to 110 Mb region from human chromosome 2 visualized using **pyGenomeTracks**.
TADs were computed by HiCExplorer's ``hicFindTADs``. The additional tracks added correspond to:
TAD-separation score (as reported by HiCExplorer's ``hicFindTADs``), chromatin states,
principal component 1 (A/B compartment) computed using HiCExplorer's ``hicPCA``, ChIP-seq coverage for the H3K27ac mark, DNA methylation, and a gene track.
Data are from mouse cardiac myocytes, published by `Nothjunge et al. (2017)`_.

.. image:: $PATH_TO_IMAGES/pyGenomeTracks.png
   :width: 70 %

_________________

| For more information about pyGenomeTracks please consider our documentation on github_

.. _github: https://github.com/deeptools/pyGenomeTracks
.. _`Nothjunge et al. (2017)`: https://www.nature.com/articles/s41467-017-01724-9
]]></help>
    <expand macro="citations" />
</tool>