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