view intervene_pairwise.xml @ 3:21beb30956c2 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/intervene commit f0241966e9185e5960947d12dcb490cce1fc6301
author iuc
date Fri, 21 Oct 2022 16:07:46 +0000
parents 33b8c5eedc04
children
line wrap: on
line source

<tool id="intervene_pairwise" name="Pairwise intersection" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
    <description>and heatmap for genomic intervals</description>
    <xrefs>
        <xref type="bio.tools">intervene</xref>
    </xrefs>
    <macros>
        <import>macros.xml</import>
    </macros>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">intervene</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
#import re
#set $labels = ",".join(["'%s'" % @ESCAPE_IDENTIFIER@ for file in $input])
#set $type = 'genomic 'if $input[0].is_of_type('interval') else 'list'
intervene pairwise
--type $type
--input #echo " ".join(["'%s'" % file for file in $input])
--names $labels
--compute $compute_conditional.compute
#if $compute_conditional.compute == 'fisher'
    --genome '$compute_conditional.genome'
#end if
#if str($corrtype) != 'None'
    --corr
    --corrtype $corrtype
#end if
--htype $htype
$diagonal
--output results
--barcolor '$barcolor'
--fontsize '$fontsize'
--title '$title'
--figtype $figtype
--figsize $figsize_width $figsize_height
--dpi $dpi &&
mv results/Intervene_pairwise_*.${figtype} results/Intervene_pairwise.plot
    ]]></command>
    <inputs>
        <param argument="--input" type="data" format="interval" multiple="true" label="Select input files for which to produce intersections"/>
        <conditional name="compute_conditional">
            <param argument="--compute" type="select" label="Use this metric for the heatmap">
                <option value="count">count: calculates the number of overlaps</option>
                <option value="frac" selected="true">frac: calculates the fraction of overlap</option>
                <option value="jaccard">jaccard: calculate the Jaccard statistic</option>
                <option value="reldist">reldist: calculate the distribution of relative distances</option>
                <option value="fisher">fisher: calculate Fisher`s statistic</option>
            </param>
            <when value="count"/>
            <when value="frac"/>
            <when value="jaccard"/>
            <when value="reldist"/>
            <when value="fisher">
                <param argument="--genome" type="text" value="" label="Reference genome ID" help="Needs to be a string assembly name such as mm10 or hg38">
                    <sanitizer invalid_char="">
                        <valid initial="string.letters,string.digits">
                        </valid>
                    </sanitizer>
                    <validator type="regex">[0-9a-zA-Z]+</validator>
                </param>
            </when>
        </conditional>
        <param argument="--corrtype" type="select" label="Select the type of correlation">
            <option value="None">Don't calculate correlation</option>
            <option value="pearson">Pearson correlation</option>
            <option value="kendall">Kendall correlation</option>
            <option value="spearman">Spearman correlation</option>
        </param>
        <param argument="--htype" type="select" label="Heatmap plot type">
            <option value="tribar">tribar</option>
            <option value="dendrogram">dendrogram</option>
            <option value="color">color</option>
            <option value="pie">pie</option>
            <option value="circle">circle</option>
            <option value="square">square</option>
            <option value="ellipse">ellipse</option>
            <option value="number">number</option>
            <option value="shade">shade</option>
        </param>
        <param argument="--diagonal" type="boolean" truevalue="--diagonal" falsevalue="" label="Show the diagonal values in the heatmap ?"/>
        <!-- the argparse action is wrong for showsize, check this when upgrading tool in future -->
        <param argument="--barcolor" type="color" label="Boxplot color" value="#53cfff">
            <expand macro="color_sanitizer"/>
        </param>
        <param argument="--fontsize" type="integer" value="8" label="Label font size"/>
        <param argument="--title" type="text" label="Heatmap main title" value="Pairwise intersection">
            <expand macro="quote_sanitizer"/>
        </param>
        <expand macro="figure_params"/>
        <param name="out_matrix" type="boolean" truevalue="true" falsevalue="false" label="Output the intervene matrix file?"/>
    </inputs>
    <outputs>
        <data name="plot" format="pdf" label="Pairwise plot on ${on_string}" from_work_dir="results/Intervene_pairwise.plot">
            <actions>
                <action type="format">
                    <option type="from_param" name="figtype"/>
                </action>
            </actions>
        </data>
        <data name="matrix" format="txt" label="Matrix on ${on_string}" from_work_dir="results/Intervene_pairwise_frac_matrix.txt">
            <filter>out_matrix</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="2">
            <param name="input" value="a.bed,b.bed,c.bed"/>
            <param name="out_matrix" value="true"/>
            <output name="plot" value="bed_pairwise.pdf" compare="sim_size"/>
            <output name="matrix" value="matrix.txt" />
        </test>
        <!-- Test fisher option -->
        <test expect_num_outputs="1">
            <param name="input" value="a.bed,b.bed,c.bed"/>
            <conditional name="compute_conditional">
                <param name="compute" value="fisher"/>
                <param name="genome" value="mm10"/>
            </conditional>
            <output name="plot" value="bed_pairwise_fisher.pdf" compare="sim_size"/>
        </test>
    </tests>
    <help><![CDATA[
**What it does**

Plots the pairwise intersections of multiple interval files.

.. image:: $PATH_TO_IMAGES/pairwise.png

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