5
|
1 <tool id="bedtools_genomecoveragebed_bedgraph" name="Create a BedGraph of genome coverage" version="0.2.0">
|
|
2 <description>
|
|
3 </description>
|
|
4 <macros>
|
|
5 <import>macros.xml</import>
|
|
6 </macros>
|
|
7 <expand macro="requirements" />
|
|
8 <expand macro="stdio" />
|
|
9 <command>
|
|
10 genomeCoverageBed
|
|
11 #if $input.ext == "bam"
|
|
12 -ibam '$input'
|
|
13 #else
|
|
14 -i '$input'
|
|
15 -g ${chromInfo}
|
|
16 #end if
|
|
17
|
|
18 #if str($scale):
|
|
19 -scale $scale
|
|
20 #end if
|
|
21
|
|
22 -bg
|
|
23 $zero_regions
|
|
24 $split
|
|
25 $strand
|
|
26 > '$output'
|
|
27 </command>
|
|
28 <inputs>
|
|
29 <param format="bed,bam" name="input" type="data" label="The BAM or BED file from which coverage should be computed">
|
|
30 <validator type="unspecified_build" />
|
|
31 </param>
|
|
32
|
|
33 <param name="zero_regions" type="boolean" checked="true" truevalue="-bga" falsevalue="" label="Report regions with zero coverage" help="If set, regions without any coverage will also be reported." />
|
|
34
|
|
35 <param name="split" type="boolean" checked="false" truevalue="-split" falsevalue="" label="Treat split/spliced BAM or BED12 entries as distinct BED intervals when computing coverage." help="If set, the coverage will be calculated based the spliced intervals only. For BAM files, this inspects the CIGAR N operation to infer the blocks for computing coverage. For BED12 files, this inspects the BlockCount, BlockStarts, and BlockEnds fields (i.e., columns 10,11,12). If this option is not set, coverage will be calculated based on the interval's START/END coordinates, and would include introns in the case of RNAseq data." />
|
|
36
|
|
37 <param name="strand" type="select" label="Calculate coverage based on">
|
|
38 <option value="">both strands combined</option>
|
|
39 <option value="-strand +">positive strand only</option>
|
|
40 <option value="-strand -">negative strand only</option>
|
|
41 </param>
|
|
42
|
|
43 <param name="scale" type="float" optional="true" label="Scale the coverage by a constant factor" help="Each BEDGRAPH coverage value is multiplied by this factor before being reported. Useful for normalizing coverage by, e.g., reads per million (RPM)"/>
|
|
44 </inputs>
|
|
45 <outputs>
|
|
46 <data format="bedgraph" name="output" metadata_source="input" label="${input.name} (Genome Coverage BedGraph)" />
|
|
47 </outputs>
|
|
48
|
|
49 $ cat A.bed
|
|
50 chr1 10 20
|
|
51 chr1 20 30
|
|
52 chr2 0 500
|
|
53
|
|
54 $ cat my.genome
|
|
55 chr1 1000
|
|
56 chr2 500
|
|
57
|
|
58 $ bedtools genomecov -i A.bed -g my.genome
|
|
59 chr1 0 980 1000 0.98
|
|
60 chr1 1 20 1000 0.02
|
|
61 chr2 1 500 500 1
|
|
62 genome 0 980 1500 0.653333
|
|
63 genome 1 520 1500 0.346667
|
|
64
|
|
65 <help>
|
|
66
|
|
67
|
|
68 **What it does**
|
|
69
|
|
70 This tool calculates the genome-wide coverage of intervals defined in a BAM or BED file and reports them in BedGraph format.
|
|
71
|
|
72 .. class:: warningmark
|
|
73
|
|
74 The input BED or BAM file must be sorted by chromosome name (but doesn't necessarily have to be sorted by start position).
|
|
75
|
|
76 -----
|
|
77
|
|
78 **Example 1**
|
|
79
|
|
80 Input (BED format)-
|
|
81 Overlapping, un-sorted intervals::
|
|
82
|
|
83 chr1 140 176
|
|
84 chr1 100 130
|
|
85 chr1 120 147
|
|
86
|
|
87
|
|
88 Output (BedGraph format)-
|
|
89 Sorted, non-overlapping intervals, with coverage value on the 4th column::
|
|
90
|
|
91 chr1 100 120 1
|
|
92 chr1 120 130 2
|
|
93 chr1 130 140 1
|
|
94 chr1 140 147 2
|
|
95 chr1 147 176 1
|
|
96
|
|
97 -----
|
|
98
|
|
99 **Example 2 - with ZERO-Regions selected (assuming hg19)**
|
|
100
|
|
101 Input (BED format)-
|
|
102 Overlapping, un-sorted intervals::
|
|
103
|
|
104 chr1 140 176
|
|
105 chr1 100 130
|
|
106 chr1 120 147
|
|
107
|
|
108
|
|
109 Output (BedGraph format)-
|
|
110 Sorted, non-overlapping intervals, with coverage value on the 4th column::
|
|
111
|
|
112 chr1 0 100 0
|
|
113 chr1 100 120 1
|
|
114 chr1 120 130 2
|
|
115 chr1 130 140 1
|
|
116 chr1 140 147 2
|
|
117 chr1 147 176 1
|
|
118 chr1 176 249250621 0
|
|
119
|
|
120 @REFERENCES@
|
|
121 </help>
|
|
122 </tool>
|