upstream-extended/iuc/tools/bedtools/coverageBed.xml
1<tool id="bedtools_coveragebed" name="bedtools Compute both the depth and breadth of coverage" version="@TOOL_VERSION@+galaxy0" profile="@PROFILE@">
2 <description>of features in file B on the features in file A (bedtools coverage)</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <expand macro="bio_tools"/>
7 <expand macro="requirements">
8 <requirement type="package" version="1.18">samtools</requirement>
9 </expand>
10 <expand macro="stdio"/>
11 <command><![CDATA[
12bedtools coverage
13$d
14$hist
15$split
16$strandedness
17$mean
18#if str($overlap_a):
19 -f $overlap_a
20#end if
21#if str($overlap_b):
22 -F $overlap_b
23#end if
24$reciprocal_overlap
25$a_or_b
26-a '$inputA'
27#if str($reduce_or_iterate.reduce_or_iterate_selector) == 'iterate':
28 -b '$reduce_or_iterate.inputB'
29#else:
30 -b
31 #for $file in $reduce_or_iterate.inputB
32 '$file'
33 #end for
34#end if
35@SORTED@
36#if $inputA.is_of_type('gff'):
37 | sort -k1,1 -k4,2n
38#else:
39 | sort -k1,1 -k2,2n
40#end if
41> '$output'
42 ]]></command>
43 <inputs>
44 <param name="inputA" argument="-a" type="data" format="bam,@STD_BEDTOOLS_INPUTS@" label="File A (on which coverage is calculated)" help="BAM/@STD_BEDTOOLS_INPUT_LABEL@ format"/>
45 <conditional name="reduce_or_iterate">
46 <param name="reduce_or_iterate_selector" type="select" label="Combined or separate output files">
47 <option value="iterate" selected="true">One output file per 'input B' file</option>
48 <option value="reduce">Single output containing results for all 'input B' files</option>
49 </param>
50 <when value="iterate">
51 <param name="inputB" argument="-b" type="data" format="bam,@STD_BEDTOOLS_INPUTS@" label="File B (for which coverage is calculated)" help="BAM/@STD_BEDTOOLS_INPUT_LABEL@ format"/>
52 </when>
53 <when value="reduce">
54 <param name="inputB" argument="-b" type="data" format="bam,@STD_BEDTOOLS_INPUTS@" label="File(s) B (for which coverage is calculated)" help="BAM/@STD_BEDTOOLS_INPUT_LABEL@ format" multiple="true"/>
55 </when>
56 </conditional>
57 <expand macro="split"/>
58 <param name="strandedness" argument="-s" type="boolean" truevalue="-s" falsevalue="" checked="false" label="Force strandedness" help="Only report hits in B that overlap A on the same strand. By default, overlaps are reported without respect to strand"/>
59 <param argument="-d" type="boolean" truevalue="-d" falsevalue="" checked="false" label="Report the depth at each position in each A feature" help="Positions reported are one based. Each position and depth follow the complete B feature"/>
60 <param argument="-hist" type="boolean" truevalue="-hist" falsevalue="" checked="false" label="Report a histogram of coverage for each feature in A as well as a summary histogram for all features in A" help="Additional columns after each feature in A: 1) depth 2) # bases at depth 3) size of A 4) % of A at depth"/>
61 <param argument="-mean" type="boolean" truevalue="-mean" falsevalue="" checked="false" label="Mean depth" help="Report the mean depth of all positions in each A feature."/>
62 <expand macro="overlap" name="overlap_a"/>
63 <expand macro="overlap" name="overlap_b" argument="-F" fracof="B"/>
64 <param name="reciprocal_overlap" argument="-r" type="boolean" truevalue="-r" falsevalue="" checked="false" label="Require that the fraction overlap be reciprocal for A AND B." help="if -f is 0.90 and -r is used, this requires that B overlap 90% of A and A _also_ overlaps 90% of B"/>
65 <param name="a_or_b" argument="-e" type="boolean" truevalue="-e" falsevalue="" checked="false" label="Require that the minimum fraction be satisfied for A OR B." help="If -e is used with -f 0.90 and -F 0.10 this requires that either 90% of A is covered OR 10% of B is covered. Without -e, both fractions would have to be satisfied"/>
66 <!-- -sorted -g -->
67 <expand macro="sorted"/>
68 </inputs>
69 <outputs>
70 <data name="output" format="bed" metadata_source="inputA" label="Count of overlaps on ${inputA.name}"/>
71 </outputs>
72 <tests>
73 <test>
74 <param name="inputA" value="coverageBedA.bed" ftype="bed"/>
75 <param name="reduce_or_iterate|inputB" value="coverageBedB.bed" ftype="bed"/>
76 <output name="output" file="coverageBed_result1.bed" ftype="bed"/>
77 </test>
78 <test>
79 <param name="inputA" value="multiCov1.bed" ftype="bed"/>
80 <param name="reduce_or_iterate|inputB" value="srma_in3.bam" ftype="bam"/>
81 <param name="sorted" value="true"/>
82 <output name="output" file="multicov1_by_srma_in3.cov.bed" ftype="bed"/>
83 </test>
84 <test>
85 <param name="inputA" value="multiCov1.bed" ftype="bed"/>
86 <param name="reduce_or_iterate|reduce_or_iterate_selector" value="reduce"/>
87 <param name="reduce_or_iterate|inputB" value="srma_in3.bam" ftype="bam"/>
88 <param name="sorted" value="true"/>
89 <output name="output" file="multicov1_by_srma_in3.cov.bed" ftype="bed"/>
90 </test>
91 <test>
92 <param name="inputA" value="coverageBedA.bed" ftype="bed"/>
93 <param name="reduce_or_iterate|inputB" value="coverageBedB.bed" ftype="bed"/>
94 <param name="overlap_b" value="1"/>
95 <output name="output" file="coverageBed_result2_F1.bed" ftype="bed"/>
96 </test>
97 <test>
98 <param name="inputA" value="coverageBedA.bed" ftype="bed"/>
99 <param name="reduce_or_iterate|inputB" value="coverageBedB.bed" ftype="bed"/>
100 <param name="overlap_a" value="1E-5"/>
101 <param name="reciprocal_overlap" value="true"/>
102 <output name="output" file="coverageBed_result3_f1r.bed" ftype="bed"/>
103 </test>
104 <test>
105 <param name="inputA" value="multiCov1.bed" ftype="bed"/>
106 <param name="reduce_or_iterate|reduce_or_iterate_selector" value="reduce"/>
107 <param name="reduce_or_iterate|inputB" value="srma_in3.bam,coverageBed.bam" ftype="bam"/>
108 <param name="sorted" value="true"/>
109 <output name="output" file="coverageBed_result4_2bam.bed" ftype="bed"/>
110 </test>
111 <test>
112 <param name="inputA" value="coverageBedA2.bed" ftype="bed"/>
113 <param name="reduce_or_iterate|inputB" value="coverageBed.bam" ftype="bam"/>
114 <output name="output" file="coverageBed_result5_unsorted.bed" ftype="bed"/>
115 </test>
116 <test>
117 <param name="inputA" value="coverageBedA2.bed" ftype="bed"/>
118 <param name="reduce_or_iterate|inputB" value="coverageBed.bam" ftype="bam"/>
119 <param name="mean" value="true"/>
120 <output name="output" file="mean_coverage.bed" ftype="bed"/>
121 </test>
122 </tests>
123 <help><![CDATA[
124**What it does**
125
126`bedtools coverage`_ computes both the *depth* and *breadth* of coverage of features in
127file B on the features in file A. For example, ``bedtools coverage`` can compute the coverage of sequence alignments
128(file B) across 1 kilobase (arbitrary) windows (file A) tiling a genome of interest.
129One advantage that ``bedtools coverage`` offers is that it not only *counts* the number of features that
130overlap an interval in file A, it also computes the fraction of bases in the interval in A that were overlapped by one or more features.
131Thus, ``bedtools coverage`` also computes the *breadth* of coverage for each interval in A.
132
133.. _bedtools coverage: http://bedtools.readthedocs.org/en/latest/content/tools/coverage.html
134
135.. class:: infomark
136
137The lines in the output will be comprised of each interval in A, followed by:
138
1391. The number of features in B that overlapped (by at least one base pair) the A interval.
1402. The number of bases in A that had non-zero coverage from features in B.
1413. The length of the entry in A.
1424. The fraction of bases in A that had non-zero coverage from features in B.
143
144@REFERENCES@
145 ]]></help>
146 <expand macro="citations"/>
147</tool>