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