view multiIntersectBed.xml @ 19:a8eabd2838f6 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 542ddc9e98cee5cc2a9e4caae945dee4b2c747b8
author iuc
date Fri, 08 Dec 2017 03:26:42 -0500
parents 44867b59dbf2
children 95a3b2c25bd1
line wrap: on
line source

<tool id="bedtools_multiintersectbed" name="Multiple Intersect" version="@WRAPPER_VERSION@.0">
    <description>identifies common intervals among multiple interval files</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <expand macro="stdio" />
    <command>
<![CDATA[
        bedtools multiinter
        $header
        $cluster
        -filler "${filler}"
        $empty.empty_selector
        @GENOME_FILE_UNION@

        #if str($tag.tag_select) == "tag":
            #set files = '" "'.join( [ str( $file ) for $file in $tag.inputs ] )
            -i "${files}"
        #else:
            -i
            #for $file in $tag.beds:
                "${file.input}"
            #end for
            -names
            #for $file in $tag.beds:
                "{$file.custom_name}"
            #end for
        #end if

        > '$output'
]]>
    </command>
    <inputs>
        <conditional name="tag">
            <param name="tag_select" type="select" label="Sample name">
                <option value="tag" selected="true">Use input's tag</option>
                <option value="custom">Enter custom name per file</option>
            </param>
            <when value="tag">
                <param name="inputs" format="bed" type="data" multiple="True" label="BED files" />
            </when>
            <when value="custom">
                <repeat name="beds" title="Add BED files" min="2" >
                    <param name="input" format="bed" type="data" multiple="True" label="BED file" />
                    <param name="custom_name" type="text" area="false" label="Custom sample name" />
                </repeat>
            </when>
        </conditional>
        <param name="cluster" type="boolean" checked="false" truevalue="-cluster" falsevalue=""
            label="Invoke Ryan Layers's clustering algorithm"
            help="(-cluster)" />
        <conditional name="empty">
            <param name="empty_selector" argument="-empty" type="select" label="Report empty regions" help="Include regions that have zero coverage in all BedGraph datasets">
                <option value="-empty">Yes</option>
                <option value="">No</option>
            </param>
            <when value="-empty">
                <expand macro="input_conditional_genome_file" />
            </when>
            <when value="" />
        </conditional>
        <param name="filler" type="text" value="N/A"
            label="Text to use for no-coverage value"
            help="Can be 0.0, N/A, - or any other value. (-filler)" />
        <expand macro="print_header" />

    </inputs>
    <outputs>
        <data format="bed" name="output" />
    </outputs>
    <tests>
        <test>
            <param name="tag_select" value="tag" />
            <param name="inputs" value="multiIntersectBed1.bed,multiIntersectBed2.bed,multiIntersectBed3.bed" ftype="bed" />
            <param name="empty_selector" value="" />
            <output name="output" file="multiIntersectBed_result1.bed" ftype="bed" />
        </test>
        <test>
            <param name="tag_select" value="tag" />
            <param name="inputs" value="multiIntersectBed1.bed,multiIntersectBed2.bed,multiIntersectBed3.bed" ftype="bed" />
            <param name="header" value="True" />
            <param name="empty_selector" value="" />
            <output name="output" file="multiIntersectBed_result2.bed" lines_diff="2" ftype="bed" />
        </test>
        <test>
            <param name="tag_select" value="tag" />
            <param name="inputs" value="multiIntersectBed1.bed,multiIntersectBed2.bed,multiIntersectBed3.bed" ftype="bed" />
            <param name="empty_selector" value="-empty" />
            <param name="genome_file_opts_selector" value="hist" />
            <param name="genome" value="multiIntersectBed1.len" />
            <output name="output" file="multiIntersectBed_result3.bed" ftype="bed" />
        </test>
    </tests>
    <help>
<![CDATA[
**What it does**

This tool identifies common intervals among multiple, sorted BED files. Intervals can be common among 0 to N of the N input BED files.


.. class:: warningmark

This tool requires that each BED file is reference-sorted (chrom, then start).


.. class:: infomark

The output file will contain five fixed columns, plus additional columns for each BED file:

    * 1. Chromosome name (or 'genome' for whole-genome coverage).
    * 2. The zero-based start position of the interval.
    * 3. The one-based end position of the interval.
    * 4. The number of input files that had at least one feature overlapping this interval.
    * 5. A list of input files or labels that had at least one feature overlapping this interval.
    * 6. For each input file, an indication (1 = Yes, 0 = No) of whether or not the file had at least one feature overlapping this interval.

------

**Example input**::

    # a.bed
    chr1  6   12bed
    chr1  10  20
    chr1  22  27
    chr1  24  30

    # b.bed
    chr1  12  32
    chr1  14  30

    # c.bed
    chr1  8   15
    chr1  10  14
    chr1  32  34


------

**Example without a header and without reporting intervals with zero coverage**::


    chr1	6	8	1	1	1	0	0
    chr1	8	12	2	1,3	1	0	1
    chr1	12	15	3	1,2,3	1	1	1
    chr1	15	20	2	1,2	1	1	0
    chr1	20	22	1	2	0	1	0
    chr1	22	30	2	1,2	1	1	0
    chr1	30	32	1	2	0	1	0
    chr1	32	34	1	3	0	0	1


**Example adding a header line**::


    chrom	start	end	num	list	a.bed	b.bed	c.bed
    chr1	6	8	1	1	1	0	0
    chr1	8	12	2	1,3	1	0	1
    chr1	12	15	3	1,2,3	1	1	1
    chr1	15	20	2	1,2	1	1	0
    chr1	20	22	1	2	0	1	0
    chr1	22	30	2	1,2	1	1	0
    chr1	30	32	1	2	0	1	0
    chr1	32	34	1	3	0	0	1


**Example adding a header line and custom file labels**::


    chrom	start	end	num	list	    joe	bob	sue
    chr1	6	8	1	joe	    1	0	0
    chr1	8	12	2	joe,sue	    1	0	1
    chr1	12	15	3	joe,bob,sue 1	1	1
    chr1	15	20	2	joe,bob	    1	1	0
    chr1	20	22	1	bob	    0	1	0
    chr1	22	30	2	joe,bob	    1	1	0
    chr1	30	32	1	bob	    0	1	0
    chr1	32	34	1	sue	    0	0	1


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