view macs2_callpeak.xml @ 15:d89001e78ee4 draft

Uploaded
author bgruening
date Fri, 24 Jan 2014 11:18:29 -0500
parents 836578426f44
children
line wrap: on
line source

<tool id="macs2_callpeak" name="MACS2 callpeak" version="2.0.10.0">
    <description>Call peaks from alignment results</description>
    <expand macro="requirements">
        <requirement type="package" version="3.0.1">R_3_0_1</requirement>
        <requirement type="set_environment">MACS2_SCRIPT_PATH</requirement>
    </expand>
    <expand macro="version_command" />
    <macros>
        <import>macs2_macros.xml</import>
    </macros>
    <command>
        #import os
        #set $temp_stderr = 'macs2_stderr'
        macs2 callpeak

            --name "MACS2"
            -t #echo ' '.join( map(str, $input_treatment_file) )#

            #if ' '.join( map(str, $input_control_file) ) != 'None':
                -c #echo ' '.join( map(str, $input_control_file) )#
            #end if

        #for $ifile in $input_treatment_file:
            --format='$ifile.ext.upper()'
        #end for

        @effective_genome_size@

        --bw='$band_width'

        ## advanced options
        #if str( $advanced_options.advanced_options_selector ) == 'on':
            --mfold $advanced_options.mfoldlo $advanced_options.mfoldhi
            $advanced_options.nolambda

            #if str($advanced_options.broad_options.broad_options_selector) == '--broad':
                --broad
                --broad-cutoff='$advanced_options.broad_options.broad_cutoff'
            #end if

        #else:
            ## set default parameter
            --mfold 10 30
        #end if

        ## With --bdg two additional output files will be generated.
        #if 'bdg' in str($outputs).split(','):
            --bdg
        #end if

        ## pq value select options
        #if str( $pq_options.pq_options_selector ) == 'qvalue':
            --qvalue $pq_options.qvalue
        #else:
            --pvalue $pq_options.pvalue
        #end if

        ## model options
        #if str( $nomodel_type.nomodel_type_selector ) == 'nomodel':
            --nomodel --shiftsize='$nomodel_type.shiftsize'
        #end if

        2> $temp_stderr;

        ## run R to create pdf from model script
        #if 'pdf' in str($outputs).split(','):
            Rscript MACS2_model.r > MACS2_model.r.log;
        #end if

        #if 'html' in str($outputs).split(','):
            ## if output files exists, move them to the extra_files_path and create a html result page linking to them
            count=`ls -1 MACS2* 2>/dev/null | wc -l`;
            if [ \$count != 0 ];
            then 
                mkdir $output_extra_files.extra_files_path;
                cp MACS2* $output_extra_files.extra_files_path;
                python \$MACS2_SCRIPT_PATH/dir2html.py $output_extra_files.extra_files_path $temp_stderr > $output_extra_files;
            fi;
        #end if

        cat $temp_stderr 2>&#38;1
    </command>
    <expand macro="stdio" />
    <inputs>
        <param name="input_control_file" type="data" format="bam,sam,bed" multiple="True" optional="True" label="ChIP-Seq Control File" />
        <param name="input_treatment_file" type="data" format="bam,sam,bed" multiple="True" label="ChIP-Seq Treatment File" />

        <expand macro="conditional_effective_genome_size" />

        <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." />

        <conditional name="pq_options">
            <param name="pq_options_selector" type="select" label="Peak detection based on" help="default uses q-value">
                <option value="qvalue">q-value</option>
                <option value="pvalue">p-value</option>
            </param>
            <when value="pvalue">
                <param name="pvalue" type="float" label="p-value cutoff for peak detection" value="1e-2" help="default: 1e-2 (--pvalue)"/>
            </when>
            <when value="qvalue">
                <param name="qvalue" type="float" label="q-value cutoff for peak detection" value="5e-2" help="default: 5e-2 (--qvalue)"/>
            </when> 
        </conditional>

        <conditional name="nomodel_type">
            <param name="nomodel_type_selector" type="select" label="Build Model">
                <option value="nomodel">Do not build the shifting model (--nomodel)</option>
                <option value="create_model" selected="true">Build the shifting model</option>
            </param>
            <when value="nomodel">
                <param name="shiftsize" type="integer" label="Arbitrary shift size in bp" value="100" help="(--shiftsize)"/>
            </when>
        </conditional>

        <param name="outputs" type="select" display="checkboxes" multiple="True" label="Outputs">
            <option value="peaks_bed" selected="True">Peaks as BED file</option>
            <option value="narrow">narrow Peaks</option>
            <option value="summits" selected="true">summits</option>
            <option value="bdg" selected="true">Scores in bedGraph files (--bdg)</option>
            <option value="html">Summary page (html)</option>
            <option value="pdf">Plot in PDF</option>
            <validator type="no_options" message="Please select at least one output file." />
        </param>

        <conditional name="advanced_options">
            <param name="advanced_options_selector" type="select" label="Advanced options">
                <option value="off">Hide advanced options</option>
                <option value="on">Display advanced options</option>
            </param>
            <when value="on">
                <param name="mfoldlo" type="integer" label="Fold-enrichment lower limit" value="10" help="Select the regions with MFOLD high-confidence enrichment ratio against background to build model (--mfold)"/>
                <param name="mfoldhi" type="integer" label="Fold-enrichment upper-limit" value="30" help="Select the regions with MFOLD high-confidence enrichment ratio against background to build model (--mfold)"/>
                <param name="nolambda" label="Use fixed background lambda as local lambda for every peak region" type="boolean" truevalue="--nolambda" falsevalue="" checked="False" help="up to 9X more time consuming (--nolambda)"/>
                <conditional name="broad_options">
                    <param name="broad_options_selector" type="select" label="Composite broad regions" help="by putting nearby highly enriched regions into a broad region with loose cutoff (--broad)">
                        <option value="">No broad regions</option>
                        <option value="--broad">broad regions</option>
                    </param>
                    <when value="--broad">
                        <param name="broad_cutoff" type="float" label="Cutoff for broad region" value="0.1" help="value is either p-value or q-value as specified above (--broad-cutoff)"/>
                    </when>
                </conditional>
            </when>
            <when value="off" />
        </conditional>

    </inputs>
    <outputs>
        <!--callpeaks output-->
        <data name="output_bed" format="tabular" from_work_dir="MACS2_peaks.bed" label="${tool.name} on ${on_string} (peaks in BED)">
            <filter>'peaks_bed' in outputs</filter>
        </data>
        <data name="output_narrowpeaks" format="tabular" from_work_dir="MACS2_peaks.encodePeak" label="${tool.name} on ${on_string} (narrow Peaks)">
            <filter>'narrow' in outputs</filter>
        </data>
        <data name="output_broadpeaks" format="tabular" from_work_dir="MACS2_broad_peaks.bed" label="${tool.name} on ${on_string} (broad Peaks)">
            <filter>
            ((
              advanced_options['advanced_options_selector'] == "on" and
              advanced_options['broad_options']['broad_options_selector'] == "--broad"
            ))
            </filter>
        </data>
        <data name="output_summits" format="bed" from_work_dir="MACS2_summits.bed" label="${tool.name} on ${on_string} (summits in BED)">
            <filter>'summits' in outputs</filter>
        </data>
        <data name="output_plot" format="pdf" from_work_dir="MACS2_model.pdf" label="${tool.name} on ${on_string} (plot)">
            <filter>'pdf' in outputs</filter>
        </data>
        <data name="output_treat_pileup" format="bedgraph" from_work_dir="MACS2_treat_pileup.bdg" label="${tool.name} on ${on_string} (Bedgraph Treatment)">
            <filter>'bdg' in outputs</filter>
        </data>
        <data name="output_control_lambda" format="bedgraph" from_work_dir="MACS2_control_lambda.bdg" label="${tool.name} on ${on_string} (Bedgraph Control)">
            <filter>'bdg' in outputs</filter>
        </data>
        <data name="output_extra_files" format="html" label="${tool.name} on ${on_string} (html report)">
            <filter>'html' in outputs</filter>
        </data>
  </outputs>
  <tests>
    <!--none yet for macs2-->
  </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**

**Peak Calling**: Main MACS2 Function to Call peaks from alignment results.

If you choose "Scores in bedGraph files" MACS will output the fragment pileup, control lambda, -log10-pvalue and -log10-qvalue scores in bedGraph files.


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


@citation@
  </help>
</tool>