diff bamFingerprint.xml @ 61:f3140d17939e draft

Uploaded
author bgruening
date Fri, 23 Jan 2015 16:53:31 -0500
parents
children 9bee2c86eeb1
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bamFingerprint.xml	Fri Jan 23 16:53:31 2015 -0500
@@ -0,0 +1,150 @@
+<tool id="deeptools_bamFingerprint" name="bamFingerprint" version="@WRAPPER_VERSION@.0">
+    <description>plots profiles of BAM files; useful for assesing ChIP signal strength</description>
+    <expand macro="requirements" />
+    <expand macro="stdio" />
+    <macros>
+        <token name="@BINARY@">bamFingerprint</token>
+        <import>deepTools_macros.xml</import>
+    </macros>
+    <command>
+<![CDATA[
+        @multiple_input_bams@
+
+        bamFingerprint
+
+            @THREADS@
+
+            --bamfiles #echo " ".join($files)
+            --labels #echo " ".join($labels)
+
+            --fragmentLength $fragmentLength
+
+            #set newoutFileName=str($outFileName)+".png"
+            --plotFile $newoutFileName
+
+            #if $output.showOutputSettings == "yes"
+                --plotFileFormat $output.outFileFormat
+                #if $output.saveRawCounts:
+                    --outRawCounts '$outFileRawCounts' 
+                #end if
+            #else
+                --plotFileFormat 'png'
+            #end if
+
+            #if str($region).strip() != '':
+                --region '$region'
+            #end if
+
+            #if $advancedOpt.showAdvancedOpt == "yes":
+                --binSize '$advancedOpt.binSize'
+                --numberOfSamples '$advancedOpt.numberOfSamples'
+
+                $advancedOpt.doNotExtendPairedEnds
+                $advancedOpt.ignoreDuplicates
+                $advancedOpt.skipZeros
+
+                #if $advancedOpt.minMappingQuality:
+                --minMappingQuality '$advancedOpt.minMappingQuality'
+                #end if
+            #end if
+        ; mv $newoutFileName $outFileName
+        ; rm $temp_dir -rf
+]]>
+    </command>
+
+    <inputs>
+        <expand macro="multiple_input_bams" />
+        <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="binSize" type="integer" value="500" min="1" 
+                   label="Bin size in bp"
+                   help="Length in base pairs for a window used to sample the genome."/>
+                <param name="numberOfSamples" type="integer" value="100000" min="1" 
+                   label="Number of samples"
+                   help="Number of samples taken from the genome to compute the scaling factors. (--numberOfSamples)"/>
+                <expand macro="doNotExtendPairedEnds" />
+                <expand macro="ignoreDuplicates" />
+                <expand macro="minMappingQuality" />
+                <expand macro="skipZeros" />
+
+            </when>
+        </conditional>
+        <conditional name="output">
+            <param name="showOutputSettings" type="select" label="Show advanced output settings">
+                <option value="no" selected="true">no</option>
+                <option value="yes">yes</option>
+            </param>
+            <when value="no" />
+            <when value="yes">
+                <expand macro="input_image_file_format" />
+                <param name="saveRawCounts" type="boolean" label="Save the bin counts"/>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <expand macro="output_image_file_format" />
+        <data format="tabular" name="outFileRawCounts" label="${tool.name} on ${on_string}: bin counts">
+            <filter>
+            ((
+                output['showOutputSettings'] == 'yes' and 
+                output['saveRawCounts'] is True
+            ))
+            </filter>
+        </data>
+    </outputs>
+    <tests>
+        <test>
+            <repeat name="input_files">
+                <param name="bamfile" value="bowtie2-test1.bam" ftype="bam" />
+            </repeat>
+            <repeat name="input_files">
+                <param name="bamfile" value="bowtie2-test1.bam" ftype="bam" />
+            </repeat>
+            <param name="fragmentLength" value="200" />
+            <param name="showAdvancedOpt" value="no" />
+            <param name="showOutputSettings" value="no" />
+            <output name="outFileName" file="bamFingerprint_result1.png" ftype="png" />
+        </test>
+    </tests>
+    <help>
+<![CDATA[
+**What it does**
+
+This tool is useful to assess the strength of a ChIP (i.e. how clearly the enrichment signal can be separated from the background signal)
+and it is based on a method developed by Diaz et al. (2012) Stat Appl Genet Mol Biol 11(3).
+
+The tool first samples indexed BAM files and counts all reads overlapping a window (bin) of specified length.
+These counts are then sorted according to their rank (the bin with the highest number of reads has the highest rank)
+and the cumulative sum of read counts are plotted. An ideal input (control sample) with perfect uniform distribution of reads
+along the genome (i.e. without enrichments in open chromatin etc.) should
+generate a straight diagonal line. A very specific and strong ChIP enrichment will be indicated by a prominent and steep
+rise of the cumulative sum towards the highest rank. This means that a big chunk of reads from the ChIP sample is located in
+few bins which corresponds to high, narrow enrichments seen for transcription factors.
+
+
+.. image:: $PATH_TO_IMAGES/QC_fingerprint.png
+
+
+You can find more details on the bamFingerprint wiki page: https://github.com/fidelram/deepTools/wiki/QC#wiki-bamFingerprint
+
+
+**Output files**:
+
+- Diagnostic plot
+- Data matrix of raw counts
+
+-----
+
+@REFERENCES@
+]]>
+    </help>
+    <expand macro="citations" />
+</tool>