annotate genomeCoverageBed.xml @ 2:457b09031d57 draft

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