view hicPlotTADs.xml @ 1:daf20a1cf63b draft

planemo upload for repository https://github.com/maxplanck-ie/HiCExplorer/tree/master/galaxy/wrapper/ commit 2f347b0756d720114f037ed1ff9ba4836e1b3b04
author bgruening
date Wed, 29 Mar 2017 18:30:58 -0400
parents 83b1998b0ec6
children 35cec6bc9513
line wrap: on
line source

<tool id="hicexplorer_hicplottads" name="@BINARY@" version="@WRAPPER_VERSION@.0">
    <description>Plots the diagonal, and some values close to the diagonal of a HiC matrix</description>
    <macros>
        <token name="@BINARY@">hicPlotTADs</token>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="aggressive">
<![CDATA[
        sed '/^$/d' '$tracks_config' &&

        @BINARY@
            --tracks '$tracks_config'
            #if $region and $region is not None:
                --region '$region'
            #end if
            --outFileName plot.svg

]]>
    </command>
    <configfiles>
        <configfile name="tracks_config">
## lines that start with '#' are comment lines
## and are not interpreted by the program
## the different tracks are represented by sections in this file
## each section starts with a header of the form [hic]
## the content of the section label (in the previous example 'hic') is irrelevant for
## plotting and only used to tell the user when something goes wrong.
## There are two exceptions for this, the [x-axis] and the [spacer] sections
## that use the secion label to determine the action.

#if $x_axis.x_axis_select == "yes":
[x-axis]
fontsize = $x_axis.fontsize
where = $x_axis.where
#else:
[x-axis]
#end if

#for $counter, $track in enumerate($tracks):
[hic_section_$counter]

file = $track.track_input

#if $track.title
title = $track.title
#end if

#if $track.colormap and $track.track_input.ext == "h5":
colormap = $track.colormap
#end if

#if $track.color and $track.track_input.ext != "h5":
color = $track.color
#end if

#if $track.depth:
depth = $track.depth
#end if

#if $track.display:
display = $track.display
#end if

##color = black

#if $track.width
width = $track.width
#end if

#if $track.min_value:
# auto is possible
min_value = $track.min_value
#end if

#if $track.max_value:
max_value = $track.max_value
#end if

#if $track.transform
transform = $track.transform
#end if

#if $track.boundaries_file:
boundaries_file = $track.boundaries_file
#end if

#if $track.x_labels == 'yes':
x labels = yes
#end if

#if $track.track_input.ext == "bedgraph":
#set $columns = len(open(str($track.track_input)).readline().split('\t'))
#if $columns > 5:
file_type = bedgraph_matrix
#else:
file_type = bedgraph
#end if
#elif $track.track_input.ext == "h5":
file_type = hic_matrix
#else
file_type = $track.track_input.ext
#end if

## show masked bins plots as white lines
## those bins that were not used during the correction
## the default is to extend neighboring bins to
## obtain an aesthetically pleasant output
#if $track.show_masked_bins:
show_masked_bins = $track.show_masked_bins
#end if

#if $track.show_data_range:
show data range = $track.show_data_range
#end if

#if $track.nans_to_zeros:
nans to zeros = $track.nans_to_zeros
#end if

## to turn off/on printing of labels
#if str($track.labels) == 'off'
labels = off
#end if

#if $track.global_max_row == 'yes':
global max row = yes
#end if

## optional: font size can be given if default are not good
#if $track.fontsize:
fontsize = $track.fontsize
#end if

#if $track.number_of_bins:
number of bins = $track.number_of_bins
#end if

#if $track.orientation
orientation = $track.orientation
#end if

#if $track.type
type = $track.type
#end if

#if $track.gene_rows
gene rows = $track.gene_rows
#end if

#if $track.spacer_width:
[spacer]
width = $track.spacer_width
#end if


#end for</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">

            <param name="track_input" type="data" format="h5,bed,bedgraph,bigwig,tabular" label="Track file"/>
            <param name="boundaries_file" type="data" optional="True" format="bed" label="Boundaries file"/>
            <param name="title" type="text" optional="true" label="Plot title"/>
            <expand macro="colormap" />
            <param name="color" type="color" value="#000000" label="Track color" optional="True" />
            <param name="min_value" type="float" value="" optional="True" label="Minimum value"/>
            <param name="max_value" type="float" value="" optional="True" label="Maximum value"/>

            <param name="width" type="float" value="1.5" optional="True" label="Width"/>

            <param name="transform" type="select" optional="True" label="Plot the transformed value">
                <option value="log1p">log1p</option>
                <option value="log">log</option>
            </param>
            <param name="show_masked_bins" type="boolean" truevalue="yes" falsevalue="no" checked="false"
                label="Show masked bins" />

            <param name="nans_to_zeros" type="boolean" truevalue="True" falsevalue="False" checked="false"
                label="NAN's to zeros" />

            <param name="show_data_range" type="boolean" truevalue="yes" falsevalue="no" checked="false"
                label="SHow data range" />

            <param name="labels" type="boolean" truevalue="on" falsevalue="off" checked="true"
                label="Plot labels" />

            <param name="x_labels" type="boolean" truevalue="yes" falsevalue="no" checked="false"
                label="X labels" />

            <param name="global_max_row" type="boolean" truevalue="yes" falsevalue="no" checked="false"
                label="Global max rows" />

            <param name="orientation" type="select" optional="True" label="Orientation">
                <option value="inverted">Inverted</option>
            </param>

            <param name="display" type="select" optional="True" label="Display type">
                <option value="collapsed">collapsed</option>
                <option value="domain">domain</option>
                <option value="interlaced">interlaced</option>
            </param>

            <param name="type" type="select" optional="True" label="Plotting type">
                <option value="lines">Lines</option>
                <option value="vlines">vertical dotted lines from the top to the bottom</option>
                <option value="arcplot">arcplot</option>
                <option value="interaction">interaction</option>
                <option value="genes">Genes</option>
            </param>

            <param name="depth" type="integer" value="8000000" optional="True" label="Depth" />
            <param name="number_of_bins" type="integer" value="" optional="True" label="Number of bins" />

            <param name="fontsize" type="integer" value="" optional="True" label="Fontsize" />
            <param name="gene_rows" type="integer" value="" optional="True" label="Gene rows" />

            <param name="spacer_width" type="float" value="" optional="True"
                label="Include spacer at the end of the track." help="Width of the spacer." />

        </repeat>

        <conditional name="x_axis">
            <param name="x_axis_select" type="select" label="Configure x-axis">
                <option value="no" selected="True">No</option>
                <option value="yes">Yes</option>
            </param>
            <when value="yes">
                <param name="fontsize" type="integer" value="" optional="True" label="Fontsize" />
                <param name="where" type="select" optional="True" label="Where to place the x-axis">
                    <option value="top">Top</option>
                    <option value="bottom">Bottom</option>
                </param>
            </when>
            <when value="no" />
        </conditional>

    </inputs>
    <outputs>
        <data name="outFileName" from_work_dir="plot.svg" format="svg"/>
    </outputs>
    <tests>
        <test>
            <param name="region" value="chrX:3000000-3500000"/>
            <repeat name="tracks">
                <param name="track_input" value="Li_et_al_2015.h5" ftype="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"/>
                <param name="spacer_width" value="0.5"/>
            </repeat>
            <repeat name="tracks">
                <param name="track_input" value="tad_classification.bed" ftype="bed" />
                <param name="title" value="TAD state"/>
                <param name="width" value="0.5"/>
                <param name="display" value="collapsed"/>
                <param name="labels" value="off"/>
            </repeat>
            <repeat name="tracks">
                <param name="track_input" value="tad_score.gz" ftype="bedgraph" />
                <param name="title" value="TAD separation score (Ramirez et al.)"/>
                <param name="width" value="10"/>
                <param name="type" value="lines"/>
                <param name="spacer_width" value="1"/>
            </repeat>
            <repeat name="tracks">
                <param name="track_input" value="dm3_genes.bed.gz" ftype="bed" />
                <param name="title" value="genes"/>
                <param name="width" value="5"/>
                <param name="fontsize" value="10"/>
                <param name="spacer_width" value="1"/>
            </repeat>
            <repeat name="tracks">
                <param name="track_input" value="dm3_genes.bed.gz" ftype="bed" />
                <param name="title" value="max num rows 3"/>
                <param name="width" value="3"/>
                <param name="fontsize" value="8"/>
                <param name="gene_rows" value="3"/>
                <param name="spacer_width" value="1"/>
            </repeat>
            <repeat name="tracks">
                <param name="track_input" value="dm3_genes.bed6.gz" ftype="bed" />
                <param name="title" value="bed6 global max row"/>
                <param name="width" value="20"/>
                <param name="fontsize" value="10"/>
                <param name="global_max_row" value="True"/>
            </repeat>
            <repeat name="tracks">
                <param name="track_input" value="domains.bed" ftype="bed" />
                <param name="type" value="vlines"/>
            </repeat>
            <output name="outFileName" file="hicPlotTADs_result1.svg" ftype="svg" compare="sim_size" delta="35000"/>
        </test>
    </tests>
    <help><![CDATA[

**What it does**

Plots the diagonal, and some values close to the diagonal of a HiC matrix. The diagonal of the matrix is plotted horizontally for a region.

]]></help>
    <expand macro="citations" />
</tool>