annotate bedtools_genomecov/genomeCoverageBed.xml @ 12:e54b9793e28d draft

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