<tool id="macs2_bdgcmp" name="MACS2 bdgcmp" version="2.0.10.0">
    <description>Deduct noise by comparing two signal tracks in bedGraph</description>
    <expand macro="requirements" />
    <expand macro="version_command" />
    <macros>
        <import>macs2_macros.xml</import>
    </macros>
    <command>
        macs2 bdgcmp
            -t "${ infile_treatment }"
            -c "${ infile_control }"

            -m "${ bdgcmp_options.bdgcmp_options_selector }"
            #if str($bdgcmp_options.bdgcmp_options_selector) in ['FE', 'logFE', 'logLR']:
                -p "${ bdgcmp_options.pseudocount }"
            #end if
            -o "${ outfile }"

    </command>
    <expand macro="stdio" />
    <inputs>
        <param name="infile_control" type="data" format="bedgraph" label="Control bedGraph file" />
        <param name="infile_treatment" type="data" format="bedgraph" label="Treatment bedGraph file" />

        <conditional name="bdgcmp_options">
            <param name="bdgcmp_options_selector" type="select" label="Method to use while calculating a score in any bin by comparing treatment value and control value">
                <option value="ppois" selected="true">Poisson pvalue (-log10) using control as lambda and treatment as observation (ppois)</option>
                <option value="qpois">q-value through a BH process for poisson pvalues (qpois)</option>
                <option value="subtract">subtraction from treatment (subtract)</option>
                <option value="logFE">log10 fold enrichment (logFR)</option>
                <option value="FE">linear scale fold enrichment (FE)</option>
                <option value="logLR">log10 likelihood between ChIP-enriched model and open chromatin model (logLR)</option>
                <option value="slogLR">symmetric log10 likelihood between two ChIP-enrichment models and open chromatin model (slogLR)</option>
            </param>
            <when value="FE">
                <param name="pseudocount" type="float" label="Set pseudocount" value="0.0" help="The count will be applied after normalization of sequencing depth. default: 0.0, no pseudocount is applied."/>
            </when>
            <when value="logLR">
                <param name="pseudocount" type="float" label="Set pseudocount" value="0.0" help="The count will be applied after normalization of sequencing depth. default: 0.0, no pseudocount is applied."/>
            </when>
            <when value="logFE">
                <param name="pseudocount" type="float" label="Set pseudocount" value="0.0" help="The count will be applied after normalization of sequencing depth. default: 0.0, no pseudocount is applied."/>
            </when>
            <when value="ppois"/>
            <when value="qpois"/>
            <when value="subtract"/>
            <when value="slogLR"/>
        </conditional>
    </inputs>
    <outputs>
        <data name="outfile" format="bedgraph" label="${tool.name} on ${on_string}" />
    </outputs>
    <tests>
        <test>
            <param name="infile_control" value="callpeak_control_part.bdg" ftype="bedgraph"/>
            <param name="infile_treatment" value="callpeak_treatment_part.bdg" ftype="bedgraph"/>
            <param name="bdgcmp_options_selector" value="slogLR"/>
            <output name="outfile" file="bdgcmp_on_Control_and_ChIP_slogLR.bdg"/>
        </test>
    </tests>
    <help>
**What it does**

With the improvement of sequencing techniques, chromatin immunoprecipitation followed by high throughput sequencing (ChIP-Seq)
is getting popular to study genome-wide protein-DNA interactions. To address the lack of powerful ChIP-Seq analysis method, we present a novel algorithm, named Model-based Analysis of ChIP-Seq (MACS), for
identifying transcript factor binding sites. MACS captures the influence of genome complexity to evaluate the significance of enriched ChIP regions, and MACS improves the spatial resolution of
binding sites through combining the information of both sequencing tag position and orientation. MACS can be easily used for ChIP-Seq data alone, or with control sample with the increase of specificity.

View the original MACS2 documentation: https://github.com/taoliu/MACS/blob/master/README

------

**Usage**

**Compare .bdg files**: Deduct noise by comparing two signal tracks in bedGraph.


@citation@
    </help>
</tool>
