diff genomeCoverageBed.xml @ 1:82aac94b06c3 draft

Uploaded
author iuc
date Thu, 08 Jan 2015 14:25:51 -0500
parents
children 457b09031d57
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/genomeCoverageBed.xml	Thu Jan 08 14:25:51 2015 -0500
@@ -0,0 +1,168 @@
+<tool id="bedtools_genomecoveragebed" name="Genome Coverage" version="@WRAPPER_VERSION@.0">
+    <description>in bedGraph or histogram format</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="requirements" />
+    <expand macro="stdio" />
+    <command>
+<![CDATA[
+        bedtools genomecov
+        #if $input.ext == "bam"
+            -ibam '$input'
+        #else
+            -i '$input'
+            -g $genome
+        #end if
+
+        $split
+        $strand
+
+        #if str($report.report_select) == "bg":
+            #if $zero_regions.value:
+                $zero_regions
+            #else:
+                -bg
+            #end if
+
+            #if str($scale):
+              -scale $scale
+            #end if
+        #else:
+            #if str($report.max):
+              -max $report.max
+            #end if
+        #end if
+        $d
+        $dz
+        $five
+        $three
+
+        > '$output'
+]]>
+    </command>
+    <inputs>
+        <param format="bed,bam" name="input" type="data" label="The BAM or BED file from which coverage should be computed">
+              <validator type="unspecified_build" />
+        </param>
+        <conditional name="report">
+            <param name="report_select" type="select" label="Output type">
+                <option value="bg" selected="true">BedGraph coverage file</option>
+                <option value="hist">Data suiteable for Histogram</option>
+            </param>
+            <when value="bg">
+                <param name="zero_regions" type="boolean" checked="False" truevalue="-bga" falsevalue=""
+                    label="Report regions with zero coverage" help="If set, regions without any coverage will also be reported.  (-bga)" />
+                <param name="scale" type="float" value="1.0"
+                    label="Scale the coverage by a constant factor"
+                    help="Each bedGraph coverage value is multiplied by this factor before being reported. Useful for normalizing coverage by, e.g., reads per million (RPM). (-scale)"/>
+            </when>
+            <when value="hist">
+                <param name="max" type="integer" label="Specify max depth" value="0"
+                    help="Combine all positions with a depth >= max into a single bin in the histogram. (-max)"/>
+            </when>
+        </conditional>
+        <expand macro="genome" />
+        <expand macro="split" />
+        <param name="strand" type="select" label="Calculate coverage based on" help="(-strand)">
+            <option value="">both strands combined</option>
+            <option value="-strand +">positive strand only</option>
+            <option value="-strand -">negative strand only</option>
+        </param>
+
+        <param name="d" type="boolean" checked="False" truevalue="-d" falsevalue=""
+            label="Report the depth at each genome position with 1-based coordinates" help="(-d)" />
+        <param name="dz" type="boolean" checked="False" truevalue="-dz" falsevalue=""
+            label="Report the depth at each genome position with 0-based coordinatess" help="(-dz)" />
+        <param name="five" type="boolean" checked="False" truevalue="-d" falsevalue=""
+            label="Calculate coverage of 5’ positions" help="Instead of entire interval. (-5)" />
+        <param name="three" type="boolean" checked="False" truevalue="-3" falsevalue=""
+            label="Calculate coverage of 3’ positions" help="Instead of entire interval. (-3)" />
+    </inputs>
+    <outputs>
+        <data format="bedgraph" name="output">
+            <change_format>
+                <when input="report.report_select" value="hist" format="tabular" />
+            </change_format>
+        </data>
+    </outputs>
+    <tests>
+        <test>
+            <param name="input" value="genomeCoverageBed1.bed" ftype="bed" />
+            <param name="genome" value="genomeCoverageBed1.len" />
+            <param name="report_select" value="hist" />
+            <output name="output" file="genomeCoverageBed_result1.bed" ftype="tabular" />
+        </test>
+    </tests>
+    <help>
+<![CDATA[
+**What it does**
+
+This tool calculates the genome-wide coverage of intervals defined in a BAM or BED file and reports them in BedGraph format.
+
+.. image:: $PATH_TO_IMAGES/genomecov-glyph.png
+
+.. class:: warningmark
+
+The input BED or BAM file must be sorted by chromosome name (but doesn't necessarily have to be sorted by start position).
+
+-----
+
+**Example 1**
+
+Input (BED format)-
+Overlapping, un-sorted intervals::
+
+    chr1    140 176
+    chr1    100 130
+    chr1    120 147
+
+
+Output (BedGraph format)-
+Sorted, non-overlapping intervals, with coverage value on the 4th column::
+
+    chr1    100 120 1
+    chr1    120 130 2
+    chr1    130 140 1
+    chr1    140 147 2
+    chr1    147 176 1
+
+-----
+
+**Example 2 - with ZERO-Regions selected (assuming hg19)**
+
+Input (BED format)-
+Overlapping, un-sorted intervals::
+
+    chr1    140 176
+    chr1    100 130
+    chr1    120 147
+
+
+BedGraph output will contain five columns:
+
+    * 1. Chromosome name (or 'genome' for whole-genome coverage)
+    * 2. Coverage depth
+    * 3. The number of bases on chromosome (or genome) with depth equal to column 2.
+    * 4. The size of chromosome (or entire genome) in base pairs
+    * 5. The fraction of bases on chromosome (or entire genome) with depth equal to column 2.
+
+**Example Output**:
+    
+    chr2L       0           1379895     23011544    0.0599653
+    chr2L       1           837250      23011544    0.0363839
+    chr2L       2           904442      23011544    0.0393038
+    chr2L       3           913723      23011544    0.0397072
+    chr2L       4           952166      23011544    0.0413778
+    chr2L       5           967763      23011544    0.0420555
+    chr2L       6           986331      23011544    0.0428624
+    chr2L       7           998244      23011544    0.0433801
+    chr2L       8           995791      23011544    0.0432735
+    chr2L       9           996398      23011544    0.0432999
+
+
+@REFERENCES@
+]]>
+    </help>
+    <expand macro="citations" />
+</tool>