view closestBed.xml @ 4:607c0576c6ab draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 6692e3a4fa1bf6e9a407735afdbb2454ed32b316
author iuc
date Wed, 27 Jan 2016 15:15:59 -0500
parents 82aac94b06c3
children f8b7dc21b4ee
line wrap: on
line source

<tool id="bedtools_closestbed" name="ClosestBed" version="@WRAPPER_VERSION@.0">
    <description>find the closest, potentially non-overlapping interval</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <expand macro="stdio" />
    <command>
<![CDATA[
        #set inputBs = ' '.join( [ str( $file ) for $file in $inputB ] )

        closestBed
        $strand
        $addition
        #if $addition2.addition2_select:
            -D $addition2.addition2_select
            $addition2.iu
            $addition2.id
        #end if
        $io
        -mdb $mdb
        -t $ties
        #if $k:
            -k $k
        #end if
        -a $inputA
        -b $inputBs
        > $output
]]>
    </command>
    <inputs>
        <param format="bed,vcf,gff,gff3" name="inputA" type="data" label="BED/VCF/GFF file"/>
        <param format="bed,gff,vcf,gff3" name="inputB" type="data" multiple="True" label="overlap intervals in this BED/VCF/GFF file?"/>

        <param name="ties" type="select"
            label="How ties for closest feature should be handled"
            help="This occurs when two features in B have exactly the same overlap with a feature in A.">
            <option value="all" selected="True">all - Report all ties (default)</option>
            <option value="first">first - Report the first tie that occurred in the B file</option>
            <option value="last">last - Report the last tie that occurred in the B file</option>
        </param>

        <expand macro="strand2" />

        <param name="addition" type="boolean" checked="false" truevalue="-d" falsevalue=""
            label="In addition to the closest feature in B, report its distance to A as an extra column" 
            help="The reported distance for overlapping features will be 0. (-d)" />

        <conditional name="addition2">
            <param name="addition2_select" type="select" optional="True"
                label="Add additional columns to report distance to upstream feature. Distance defintion" 
                help="Like -d, report the closest feature in B, and its distance to A as an extra column. However unlike -d, use negative distances to report upstream features. (-D)">
                <option value="" selected="True">Do not report the distance et all.</option>
                <option value="ref">Report distance with respect to the reference genome. B features with a lower (start, stop) are upstream. (-ref)</option>
                <option value="a">Report distance with respect to A. When A is on the - strand, "upstream" means B has a higher (start,stop). (-a)</option>
                <option value="b">Report distance with respect to B. When B is on the - strand, "upstream" means A has a higher (start,stop). (-b)</option>
            </param>
            <when value="" />
            <when value="ref">
                <expand macro="closest_D_option" />
            </when>
            <when value="a">
                <expand macro="closest_D_option" />
            </when>
            <when value="b">
                <expand macro="closest_D_option" />
            </when>
        </conditional>

        <param name="k" type="integer" value="1" optional="True" min="1"
            label="Report the k closest hits" help="(-k)"/>

        <param name="io" type="boolean" checked="false" truevalue="-io" falsevalue=""
            label="Ignore features in B that overlap A" 
            help="That is, we want close, yet not touching features only. (-io)" />

        <param name="mdb" type="select" optional="True"
            label="How multiple databases are resolved" 
            help="(-mdb)">
            <option value="each" selected="True">Report closest records for each database. (-each)</option>
            <option value="all">Report closest records among all databases. (-all)</option>
        </param>
    </inputs>
    <outputs>
        <data format_source="inputA" name="output" metadata_source="inputA" label="Clostest region of ${inputA} in ${inputB}"/>
    </outputs>
    <tests>
        <test>
            <param name="inputA" value="closestBedA.bed" ftype="bed" />
            <param name="inputB" value="closestBedB.bed" ftype="bed" />
            <output name="output" file="closestBed_result1.bed" ftype="bed" />
        </test>
        <test>
            <param name="inputA" value="closestBed_a.bed" ftype="bed" />
            <param name="inputB" value="closestBed_b1.bed,closestBed_b2.bed" ftype="bed" />
            <param name="addition" value="True" />
            <output name="output" file="closestBed_result2.bed" ftype="bed" />
        </test>
        <test>
            <param name="inputA" value="closestBed_a.bed" ftype="bed" />
            <param name="inputB" value="closestBed_b1.bed,closestBed_b2.bed" ftype="bed" />
            <param name="addition" value="True" />
            <param name="mdb" value="all" />
            <output name="output" file="closestBed_result3.bed" ftype="bed" />
        </test>
        <test>
            <param name="inputA" value="closestBed_c.bed" ftype="bed" />
            <param name="inputB" value="closestBed_d.bed" ftype="bed" />
            <param name="addition2_select" value="ref" />
            <output name="output" file="closestBed_result4.bed" ftype="bed" />
        </test>
        <test>
            <param name="inputA" value="closestBed_c.bed" ftype="bed" />
            <param name="inputB" value="closestBed_d.bed" ftype="bed" />
            <param name="addition2_select" value="a" />
            <output name="output" file="closestBed_result5.bed" ftype="bed" />
        </test>
        <test>
            <param name="inputA" value="closestBedA.bed" ftype="bed" />
            <param name="inputB" value="a.bed" ftype="bed" />
            <param name="k" value="3" />
            <output name="output" file="closestBed_result6.bed" ftype="bed" />
        </test>
    </tests>
    <help>
<![CDATA[
**What it does**

Similar to intersectBed, closestBed searches for overlapping features in A and B. In the event that no feature in B overlaps the current feature in A, closestBed will report the closest (that is, least genomic distance from the start or end of A) feature in B. For example, one might want to find which is the closest gene to a significant GWAS polymorphism. Note that closestBed will report an overlapping feature as the closest—that is, it does not restrict to closest non-overlapping feature.

.. image:: $PATH_TO_IMAGES/closest-glyph.png


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