1
|
1 <tool id="bedtools_genomecoveragebed" name="Genome Coverage" version="@WRAPPER_VERSION@.0">
|
|
2 <description>in bedGraph or histogram format</description>
|
|
3 <macros>
|
|
4 <import>macros.xml</import>
|
|
5 </macros>
|
|
6 <expand macro="requirements" />
|
|
7 <expand macro="stdio" />
|
|
8 <command>
|
|
9 <![CDATA[
|
|
10 bedtools genomecov
|
|
11 #if $input.ext == "bam"
|
|
12 -ibam '$input'
|
|
13 #else
|
|
14 -i '$input'
|
|
15 -g $genome
|
|
16 #end if
|
|
17
|
|
18 $split
|
|
19 $strand
|
|
20
|
|
21 #if str($report.report_select) == "bg":
|
|
22 #if $zero_regions.value:
|
|
23 $zero_regions
|
|
24 #else:
|
|
25 -bg
|
|
26 #end if
|
|
27
|
|
28 #if str($scale):
|
|
29 -scale $scale
|
|
30 #end if
|
|
31 #else:
|
|
32 #if str($report.max):
|
|
33 -max $report.max
|
|
34 #end if
|
|
35 #end if
|
|
36 $d
|
|
37 $dz
|
|
38 $five
|
|
39 $three
|
|
40
|
|
41 > '$output'
|
|
42 ]]>
|
|
43 </command>
|
|
44 <inputs>
|
|
45 <param format="bed,bam" name="input" type="data" label="The BAM or BED file from which coverage should be computed">
|
|
46 <validator type="unspecified_build" />
|
|
47 </param>
|
|
48 <conditional name="report">
|
|
49 <param name="report_select" type="select" label="Output type">
|
|
50 <option value="bg" selected="true">BedGraph coverage file</option>
|
|
51 <option value="hist">Data suiteable for Histogram</option>
|
|
52 </param>
|
|
53 <when value="bg">
|
|
54 <param name="zero_regions" type="boolean" checked="False" truevalue="-bga" falsevalue=""
|
|
55 label="Report regions with zero coverage" help="If set, regions without any coverage will also be reported. (-bga)" />
|
|
56 <param name="scale" type="float" value="1.0"
|
|
57 label="Scale the coverage by a constant factor"
|
|
58 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)"/>
|
|
59 </when>
|
|
60 <when value="hist">
|
|
61 <param name="max" type="integer" label="Specify max depth" value="0"
|
|
62 help="Combine all positions with a depth >= max into a single bin in the histogram. (-max)"/>
|
|
63 </when>
|
|
64 </conditional>
|
|
65 <expand macro="genome" />
|
|
66 <expand macro="split" />
|
|
67 <param name="strand" type="select" label="Calculate coverage based on" help="(-strand)">
|
|
68 <option value="">both strands combined</option>
|
|
69 <option value="-strand +">positive strand only</option>
|
|
70 <option value="-strand -">negative strand only</option>
|
|
71 </param>
|
|
72
|
|
73 <param name="d" type="boolean" checked="False" truevalue="-d" falsevalue=""
|
|
74 label="Report the depth at each genome position with 1-based coordinates" help="(-d)" />
|
|
75 <param name="dz" type="boolean" checked="False" truevalue="-dz" falsevalue=""
|
|
76 label="Report the depth at each genome position with 0-based coordinatess" help="(-dz)" />
|
|
77 <param name="five" type="boolean" checked="False" truevalue="-d" falsevalue=""
|
|
78 label="Calculate coverage of 5’ positions" help="Instead of entire interval. (-5)" />
|
|
79 <param name="three" type="boolean" checked="False" truevalue="-3" falsevalue=""
|
|
80 label="Calculate coverage of 3’ positions" help="Instead of entire interval. (-3)" />
|
|
81 </inputs>
|
|
82 <outputs>
|
|
83 <data format="bedgraph" name="output">
|
|
84 <change_format>
|
|
85 <when input="report.report_select" value="hist" format="tabular" />
|
|
86 </change_format>
|
|
87 </data>
|
|
88 </outputs>
|
|
89 <tests>
|
|
90 <test>
|
|
91 <param name="input" value="genomeCoverageBed1.bed" ftype="bed" />
|
|
92 <param name="genome" value="genomeCoverageBed1.len" />
|
|
93 <param name="report_select" value="hist" />
|
|
94 <output name="output" file="genomeCoverageBed_result1.bed" ftype="tabular" />
|
|
95 </test>
|
|
96 </tests>
|
|
97 <help>
|
|
98 <![CDATA[
|
|
99 **What it does**
|
|
100
|
|
101 This tool calculates the genome-wide coverage of intervals defined in a BAM or BED file and reports them in BedGraph format.
|
|
102
|
|
103 .. image:: $PATH_TO_IMAGES/genomecov-glyph.png
|
|
104
|
|
105 .. class:: warningmark
|
|
106
|
|
107 The input BED or BAM file must be sorted by chromosome name (but doesn't necessarily have to be sorted by start position).
|
|
108
|
|
109 -----
|
|
110
|
|
111 **Example 1**
|
|
112
|
|
113 Input (BED format)-
|
|
114 Overlapping, un-sorted intervals::
|
|
115
|
|
116 chr1 140 176
|
|
117 chr1 100 130
|
|
118 chr1 120 147
|
|
119
|
|
120
|
|
121 Output (BedGraph format)-
|
|
122 Sorted, non-overlapping intervals, with coverage value on the 4th column::
|
|
123
|
|
124 chr1 100 120 1
|
|
125 chr1 120 130 2
|
|
126 chr1 130 140 1
|
|
127 chr1 140 147 2
|
|
128 chr1 147 176 1
|
|
129
|
|
130 -----
|
|
131
|
|
132 **Example 2 - with ZERO-Regions selected (assuming hg19)**
|
|
133
|
|
134 Input (BED format)-
|
|
135 Overlapping, un-sorted intervals::
|
|
136
|
|
137 chr1 140 176
|
|
138 chr1 100 130
|
|
139 chr1 120 147
|
|
140
|
|
141
|
|
142 BedGraph output will contain five columns:
|
|
143
|
|
144 * 1. Chromosome name (or 'genome' for whole-genome coverage)
|
|
145 * 2. Coverage depth
|
|
146 * 3. The number of bases on chromosome (or genome) with depth equal to column 2.
|
|
147 * 4. The size of chromosome (or entire genome) in base pairs
|
|
148 * 5. The fraction of bases on chromosome (or entire genome) with depth equal to column 2.
|
|
149
|
|
150 **Example Output**:
|
|
151
|
|
152 chr2L 0 1379895 23011544 0.0599653
|
|
153 chr2L 1 837250 23011544 0.0363839
|
|
154 chr2L 2 904442 23011544 0.0393038
|
|
155 chr2L 3 913723 23011544 0.0397072
|
|
156 chr2L 4 952166 23011544 0.0413778
|
|
157 chr2L 5 967763 23011544 0.0420555
|
|
158 chr2L 6 986331 23011544 0.0428624
|
|
159 chr2L 7 998244 23011544 0.0433801
|
|
160 chr2L 8 995791 23011544 0.0432735
|
|
161 chr2L 9 996398 23011544 0.0432999
|
|
162
|
|
163
|
|
164 @REFERENCES@
|
|
165 ]]>
|
|
166 </help>
|
|
167 <expand macro="citations" />
|
|
168 </tool>
|