view computeGCBias.xml @ 29:3a2aab18a217 draft

Uploaded
author bgruening
date Tue, 16 Sep 2014 13:46:05 -0400
parents f7712a057440
children 5231f398d784
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>
    <expand macro="requirements" />
    <expand macro="stdio" />
    <macros>
        <token name="@BINARY@">computeGCBias</token>
        <import>deepTools_macros.xml</import>
    </macros>
    <command>
        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" />

        <param name="fragmentLength" type="integer" value="300" min="1"
            label="Fragment length used for the sequencing"
            help ="If paired-end reads are used, the fragment length is computed from the BAM file."/>

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

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

                <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." />
                <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="" />
            </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.">
            <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 format="tabular" name="outFileName" />
        <data format="png" name="outImageName" 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>
    <help>

**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>