<macros>
    <xml name="requirements">
        <requirements>
            <requirement type="package" version="2.0.10.20131216">macs2</requirement>
            <yield />
        </requirements>
    </xml>

    <xml name="conditional_effective_genome_size">
        <conditional name="effective_genome_size_options">
            <param name="effective_genome_size_options_selector" type="select" label="Effective genome size" help="--gsize">
                <option value="2451960000">Human (2.451.960.000)</option>
                <option value="2150570000">Mouse (2.150.570.000)</option>
                <option value="121400000">Fly (121.400.000)</option>
                <option value="93260000">Worm (93.260.000)</option>
                <option value="user_defined">User defined</option>
            </param>
            <when value="user_defined">
                <param name="gsize" type="integer" size="12" label="Effective genome size" value=""/>
            </when>
        </conditional>
    </xml>

    <token name="@effective_genome_size@">
        #if $effective_genome_size_options.effective_genome_size_options_selector == 'user_defined':
            --gsize "${ effective_genome_size_options.gsize }"
        #else:
            --gsize "${ effective_genome_size_options.effective_genome_size_options_selector }"
        #end if
    </token>

    <xml name="version_command">
        <version_command>macs2 --version</version_command>
    </xml>

    <xml name="tag_size">
        <param name="tsize" type="float" label="Tag size" value="-1.0" help="This will overide the auto detected tag size. Per default that option is deactivated: -1.0 (--tsize)" />
    </xml>
    <xml name="band_width">
        <param name="band_width" type="integer" value="300" label="Band width for picking regions to compute fragment size"
            help="This value is only used while building the shifting model. (--bw)" />
    </xml>

    <token name="@tag_size@">
        #if $tsize == -1.0:
            --tsize "${ tsize }"
        #end if
    </token>

    <xml name="stdio">
        <stdio>
            <exit_code range="1:" />
            <exit_code range=":-1" />
            <regex match="Error:" />
            <regex match="Exception:" />
        </stdio>
    </xml>

    <token name="@citation@">
------

**Citation**

For the underlying tool, please cite Zhang Y, Liu T, Meyer CA, Eeckhoute J, Johnson DS, Bernstein BE, Nusbaum C, Myers RM, Brown M, Li W, Liu XS. Model-based analysis of ChIP-Seq (MACS). Genome Biol. 2008;9(9):R137.

Integration of MACS2 with Galaxy performed by Ziru Zhou and Bjoern Gruening.
    </token>
</macros>
