view computeGCBias.xml @ 31:7889d260cc37 draft default tip

planemo upload for repository https://github.com/fidelram/deepTools/tree/master/galaxy/wrapper/ commit 3bc1d1c6f4e28ac7ff8df79fe4e3f00a195938e6-dirty
author bgruening
date Wed, 21 Oct 2015 02:50:24 -0400
parents 5231f398d784
children
line wrap: on
line source

<tool id="deeptools_computeGCBias" name="computeGCBias" version="@WRAPPER_VERSION@.0">
    <description>to see whether your samples should be normalized for GC bias</description>
    <macros>
        <token name="@BINARY@">computeGCBias</token>
        <import>deepTools_macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <command>
<![CDATA[
        ln -s $bamInput local_bamInput.bam;
        ln -s $bamInput.metadata.bam_index local_bamInput.bam.bai;

        computeGCBias
            @THREADS@

            --bamfile 'local_bamInput.bam'
            --GCbiasFrequenciesFile $outFileName
            --fragmentLength $fragmentLength

            @reference_genome_source@

            #if $effectiveGenomeSize.effectiveGenomeSize_opt == "specific":
                --effectiveGenomeSize $effectiveGenomeSize.effectiveGenomeSize
            #else:
                --effectiveGenomeSize $effectiveGenomeSize.effectiveGenomeSize_opt
            #end if

            #if str($region).strip() != '':
                --region '$region'
            #end if

            #if $advancedOpt.showAdvancedOpt == "yes":
                --sampleSize '$advancedOpt.sampleSize'
                --regionSize '$advancedOpt.regionSize'

                #if $advancedOpt.filterOut:
                    --filterOut $advancedOpt.filterOut
                #end if

                #if $advancedOpt.extraSampling:
                    --extraSampling $advancedOpt.extraSampling
                #end if
            #end if

            #if str($image_format) != 'none':
                --biasPlot $outImageName
                --plotFileFormat $image_format
            #end if
]]>
    </command>
    <inputs>
        <param name="bamInput" format="bam" type="data" label="BAM file"
            help="The BAM file must be sorted."/>

        <expand macro="reference_genome_source" />
        <expand macro="effectiveGenomeSize" />
        <expand macro="fragmentLength" />
        <expand macro="region_limit_operation" />

        <conditional name="advancedOpt">
            <param name="showAdvancedOpt" type="select" label="Show advanced options" >
                <option value="no" selected="true">no</option>
                <option value="yes">yes</option>
            </param>
            <when value="no" />
            <when value="yes">
                <param name="sampleSize" type="integer" value="50000000" min="1"
                    label="Number of sampling points to be considered" help="(--sampleSize)" />
                <param name="regionSize" type="integer" value="300" min="1"
                    label="Region size"
                    help ="To plot the reads per GC over a region, the size of the region is
                    required (see below for more details of the mthod). By default, the bin size
                    is set to 300 bp, which is close to the standard fragment size many sequencing
                    applications. However, if the depth of sequencing is low, a larger bin size will
                    be required, otherwise many bins will not overlap with any read. (--regionSize)"/>
                <param name="filterOut" type="data" format="bed" optional="true"
                    label="BED file containing genomic regions to be excluded from the estimation of the correction"
                    help="Such regions  usually contain repetitive regions and peaks that if included will
                    bias the correction. It is recommended to filter out known repetitive regions if multi-reads
                    (reads that map to more than one genomic position) were excluded. In the case of ChIP-seq data,
                    it is recommended to first use a peak caller to identify and filter out the identified peaks. (--filterOut)" />
                <param name="extraSampling" type="data" format="bed" optional="true"
                    label="BED file containing genomic regions for which extra sampling is required because they are underrepresented in the genome"
                    help="(--extraSampling)" />
            </when>
        </conditional>
        <param name="image_format" type="select"
            label="GC bias plot"
            help="If given, a diagnostic image summarizing the GC bias found on the sample will be created. (--plotFileFormat)">
            <option value="none">No image</option>
            <option value="png" selected="true">Image in png format</option>
            <option value="pdf">Image in pdf format</option>
            <option value="svg">Image in svg format</option>
            <option value="eps">Image in eps format</option>
            <option value="emf">Image in emf format</option>
        </param>
    </inputs>
    <outputs>
        <data name="outFileName" format="tabular" />
        <data name="outImageName" format="png" label="${tool.name} GC-bias Plot">
            <filter>
            ((
                image_format != 'none'
            ))
            </filter>
            <change_format>
                <when input="image_format" value="pdf" format="pdf" />
                <when input="image_format" value="svg" format="svg" />
                <when input="image_format" value="eps" format="eps" />
                <when input="image_format" value="emf" format="emf" />
            </change_format>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="bamInput" value="paired_chr2L.bam" ftype="bam" />
            <param name="image_format" value="png" />
            <param name="showAdvancedOpt" value="yes" />
            <param name="regionSize" value="1" />
            <param name="fragmentLength" value="100" />
            <param name="ref_source" value="history" />
            <param name="input1" value="sequence.2bit" />
            <param name="sampleSize" value="10" />
            <param name="effectiveGenomeSize_opt" value="specific" />
            <param name="effectiveGenomeSize" value="23011544" />
            <param name="region" value="chr2L" />
            <param name="image_format" value="none" />
            <output name="outFileName" file="computeGCBias_result1.tabular" ftype="tabular" />
        </test>
    </tests>
    <help>
<![CDATA[
**What it does**

This tool computes the GC bias using the method proposed by Benjamini and Speed (2012) Nucleic Acids Res. (see below for more explanations)
The output is used to plot the bias and can also be used later on to correct the bias with the tool correctGCbias.
There are two plots produced by the tool: a boxplot showing the absolute read numbers per genomic-GC bin and an x-y plot
depicting the ratio of observed/expected reads per genomic GC content bin.

-----

**Summary of the method used**

In order to estimate how many reads with what kind of GC content one should have sequenced, we first need to determine how many regions the specific
reference genome contains for each amount of GC content, i.e. how many regions in the genome have 50% GC (or 10% GC or 90% GC or...).
We then sample a large number of equally sized genome bins and count how many times we see a bin with 50% GC (or 10% GC or 90% or...). These EXPECTED values are independent of any 
sequencing as it only depends on the respective reference genome (i.e. it will most likely vary between mouse and fruit fly due to their genome's different GC contents).
The OBSERVED values are based on the reads from the sequenced sample. Instead of noting how many genomic regions there are per GC content, we now count the reads per GC content.
In an ideal sample without GC bias, the ratio of OBSERVED/EXPECTED values should be close to 1 regardless of the GC content. Due to PCR (over)amplifications, the majority of ChIP samples
usually shows a significant bias towards reads with high GC content (>50%)

.. image:: $PATH_TO_IMAGES/QC_GCplots_input.png


You can find more details on the computeGCBias wiki page: computeGCBias wiki: https://github.com/fidelram/deepTools/wiki/QC#wiki-computeGCbias


**Output files**:

- Diagnostic plot

  - box plot of absolute read numbers per genomic GC bin
  - x-y plot of observed/expected read ratios per genomic GC content bin

- Data matrix

  - to be used for GC correction with correctGCbias


-----

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