view hicPlotDistVsCounts.xml @ 2:9b664f43a90e draft

planemo upload for repository https://github.com/maxplanck-ie/HiCExplorer/tree/master/galaxy/wrapper/ commit 4d61b6bf2fed275ab38c226d0c4390b095a38251
author bgruening
date Thu, 02 Nov 2017 11:11:34 -0400
parents f768ce54ee2a
children ed96f2fd7e3f
line wrap: on
line source

<tool id="hicexplorer_hicplotdistvscounts" name="@BINARY@" version="@WRAPPER_VERSION@.0">
    <description>distance vs HiC counts plot per chromosome</description>
    <macros>
        <token name="@BINARY@">hicPlotDistVsCounts</token>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command detect_errors="aggressive"><![CDATA[
        #import re
        #set matrices_path=[]
        #set matrices_labels=[]
        #for $counter, $m, in enumerate($matrices):
            #set identifier = re.sub('[^\s\w\-]', '_', str($m.element_identifier))
            ln -f -s '${m}' '${identifier}_${counter}.npz.h5' &&
            #silent $matrices_path.append("'%s_%s.npz.h5'" % ($identifier, $counter))
            #silent $matrices_labels.append("'%s'" % ($identifier))
        #end for

        @BINARY@
            --matrices #echo " ".join($matrices_path)#
            --labels #echo " ".join($matrices_labels)#
            $skipDiagonal
            --plotFile plot.png
            #if $plotsize:
                --plotsize $plotsize
            #end if
            --maxdepth $maxdepth
            $perchr
            #set chroms = " ".join([ "'%s'" % $var.chromosomeExclude for $var in $chromosomeExclude ])
            #if $chromosomeExclude:
                --chromosomeExclude '$chroms'
            #end if
]]>
    </command>
    <inputs>
        <param argument="--matrices" type="data" format="h5" multiple="True" label="HiC normalized (corrected) matrices"/>

        <param argument="--skipDiagonal" type="boolean" truevalue="--skipDiagonal" falsevalue="" label="Exclude diagonal counts" />
        <param argument="--perchr" type="boolean" truevalue="--perchr" falsevalue="" label="Generate plots per chromosome"
            help="If more than one HiC matrix is given for each chromosome a new plot is made. Otherewise, a single plot with one line per chromosome is created." />
        <param argument="--maxdepth" type="integer" value="3000000" label="Max Depth"
            help="Maximum distance from diagonal to use. In other words, distances up to maxDeph are computed." />
        <param argument="--plotsize" type="text" optional="True" label="Plot size"
            help="Width and height of the plot (in inches). Default is 6*number of cols, 4 * number of rows. The maximum number of rows is 4. Example --plotsize 6 5." />
        <repeat name="chromosomeExclude" min="0" title="Chromosomes to exclude"
            help="This is useful for example to exclude the Y chromosome.">
            <param argument="--chromosomeExclude" type="text" value="" >
                <validator type="empty_field" />
            </param>
        </repeat>

    </inputs>
    <outputs>
        <data name="plotFile" from_work_dir="plot.png" format="png" label="${tool.name} on ${on_string}"/>
    </outputs>
    <tests>
        <test>
            <param name="matrices" ftype="h5" value="small_test_matrix_50kb_res.h5"/>
            <param name="skipDiagonal" value="False"/>
            <output name="plotFile" file="hicPlotDistVsCounts_result1.png" ftype="png" compare="sim_size"/>
        </test>
        <test>
            <param name="matrices" ftype="h5" value="small_test_matrix_50kb_res.h5,small_test_matrix_50kb_res.h5"/>
            <param name="skipDiagonal" value="False"/>
            <param name="perchr" value="True" />
            <repeat name="chromosomeExclude">
                <param name="chromosomeExclude" value="chrUextra"/>
            </repeat>
            <repeat name="chromosomeExclude">
                <param name="chromosomeExclude" value="chrM"/>
            </repeat>
            <repeat name="chromosomeExclude">
                <param name="chromosomeExclude" value="chr3LHet"/>
            </repeat>
            <output name="plotFile" file="hicPlotDistVsCounts_result2.png" ftype="png" compare="sim_size" delta="40000"/>
        </test>
    </tests>
    <help><![CDATA[

**What it does**

This program makes a distance vs. Hi-C counts plots. It can use several matrix files to compare
them. If the `--perchr` option is given, each chromosome is plotted independently. In the case
of more than one matrix, multiple plots are created, one per chromosome. When plotting multiple
matrices denser matrices are scaled down to match the sum of the smaller matrix.


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