annotate mergeBed.xml @ 0:b8348686a0b9 draft

Imported from capsule None
author iuc
date Tue, 04 Nov 2014 01:45:04 -0500
parents
children 82aac94b06c3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
1 <tool id="bedtools_mergebed" name="Merge BED files" version="@WRAPPER_VERSION@.0">
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
2 <description>(mergeBed)</description>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
3 <macros>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
4 <import>macros.xml</import>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
5 </macros>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
6 <expand macro="requirements" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
7 <expand macro="stdio" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
8 <command>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
9 mergeBed
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
10 -i $input
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
11 $strandedness
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
12 $report_number
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
13 -d $distance
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
14 $nms
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
15 #if str($scores) != 'none'
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
16 -scores $scores
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
17 #end if
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
18 &gt; $output
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
19 </command>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
20 <inputs>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
21 <param name="input" format="bed,gff,vcf" type="data" label="Sort the following BED/VCF/GFF file"/>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
22 <param name="strandedness" type="boolean" label="Force strandedness." truevalue="-s" falsevalue="" checked="false"
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
23 help="That is, only merge features that are the same strand."/>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
24 <param name="report_number" type="boolean" label="Report the number of BED entries that were merged." truevalue="-n" falsevalue="" checked="false"
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
25 help="1 is reported if no merging occurred."/>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
26 <param name="nms" type="boolean" label="Report the names of the merged features separated by commas." truevalue="-nms" falsevalue="" checked="false"
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
27 help="1 is reported if no merging occurred."/>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
28
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
29 <param name="distance" type="integer" value="0" label="Maximum distance between features allowed for features to be merged."
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
30 help="That is, overlapping and/or book-ended features are merged."/>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
31 <param name="scores" type="select" label="Report the scores of the merged features as">
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
32 <option value="none" selected="True">Do not report at all</option>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
33 <option value="sum">Sum</option>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
34 <expand macro="math_options" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
35 </param>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
36 </inputs>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
37 <outputs>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
38 <data format="bed" name="output" metadata_source="input" label="Merged ${input.name}"/>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
39 </outputs>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
40 <tests>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
41 <test>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
42 <param name="input" value="0.bed" ftype="bed" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
43 <output name="output" file="0_result.bed" ftype="bed" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
44 </test>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
45 <test>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
46 <param name="input" value="1.bed" ftype="bed" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
47 <param name="strandedness" value="-s" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
48 <output name="output" file="1_result.bed" ftype="bed" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
49 </test>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
50 <test>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
51 <param name="input" value="2.bed" ftype="bed" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
52 <param name="report_number" value="-n" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
53 <output name="output" file="2_result.bed" ftype="bed" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
54 </test>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
55 <test>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
56 <param name="input" value="3.bed" ftype="bed" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
57 <param name="distance" value="1000" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
58 <output name="output" file="3_result.bed" ftype="bed" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
59 </test>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
60 </tests>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
61 <help>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
62
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
63 **What it does**
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
64
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
65 bedtools merge combines overlapping or "book-ended" features in an interval file into a single feature which spans all of the combined features.
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
66
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
67
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
68 .. image:: $PATH_TO_IMAGES/merge-glyph.png
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
69
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
70
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
71 .. class:: warningmark
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
72
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
73 bedtools merge requires that you presort your data by chromosome and then by start position.
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
74
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
75
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
76 ==========================================================================
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
77 Default behavior
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
78 ==========================================================================
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
79 By default, ``bedtools merge`` combines overlapping (by at least 1 bp) and/or
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
80 bookended intervals into a single, "flattened" or "merged" interval.
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
81
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
82 ::
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
83
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
84 $ cat A.bed
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
85 chr1 100 200
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
86 chr1 180 250
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
87 chr1 250 500
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
88 chr1 501 1000
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
89
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
90 $ bedtools merge -i A.bed
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
91 chr1 100 500
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
92 chr1 501 1000
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
93
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
94
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
95 ==========================================================================
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
96 *-s* Enforcing "strandedness"
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
97 ==========================================================================
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
98 The ``-s`` option will only merge intervals that are overlapping/bookended
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
99 *and* are on the same strand.
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
100
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
101 ::
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
102
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
103 $ cat A.bed
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
104 chr1 100 200 a1 1 +
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
105 chr1 180 250 a2 2 +
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
106 chr1 250 500 a3 3 -
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
107 chr1 501 1000 a4 4 +
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
108
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
109 $ bedtools merge -i A.bed -s
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
110 chr1 100 250 +
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
111 chr1 501 1000 +
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
112 chr1 250 500 -
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
113
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
114
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
115 ==========================================================================
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
116 *-n* Reporting the number of features that were merged
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
117 ==========================================================================
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
118 The -n option will report the number of features that were combined from the
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
119 original file in order to make the newly merged feature. If a feature in the
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
120 original file was not merged with any other features, a "1" is reported.
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
121
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
122 ::
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
123
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
124 $ cat A.bed
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
125 chr1 100 200
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
126 chr1 180 250
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
127 chr1 250 500
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
128 chr1 501 1000
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
129
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
130 $ bedtools merge -i A.bed -n
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
131 chr1 100 500 3
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
132 chr1 501 1000 1
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
133
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
134
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
135 ==========================================================================
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
136 *-d* Controlling how close two features must be in order to merge
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
137 ==========================================================================
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
138 By default, only overlapping or book-ended features are combined into a new
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
139 feature. However, one can force ``merge`` to combine more distant features
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
140 with the ``-d`` option. For example, were one to set ``-d`` to 1000, any
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
141 features that overlap or are within 1000 base pairs of one another will be
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
142 combined.
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
143
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
144 ::
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
145
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
146 $ cat A.bed
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
147 chr1 100 200
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
148 chr1 501 1000
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
149
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
150 $ bedtools merge -i A.bed
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
151 chr1 100 200
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
152 chr1 501 1000
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
153
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
154 $ bedtools merge -i A.bed -d 1000
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
155 chr1 100 200 1000
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
156
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
157
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
158 =============================================================
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
159 *-nms* Reporting the names of the features that were merged
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
160 =============================================================
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
161 Occasionally, one might like to know that names of the features that were
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
162 merged into a new feature. The ``-nms`` option will add an extra column to the
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
163 ``merge`` output which lists (separated by semicolons) the names of the
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
164 merged features.
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
165
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
166 ::
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
167
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
168 $ cat A.bed
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
169 chr1 100 200 A1
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
170 chr1 150 300 A2
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
171 chr1 250 500 A3
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
172
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
173 $ bedtools merge -i A.bed -nms
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
174 chr1 100 500 A1,A2,A3
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
175
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
176
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
177 ===============================================================
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
178 *-scores* Reporting the scores of the features that were merged
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
179 ===============================================================
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
180 Similarly, we might like to know that scores of the features that were
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
181 merged into a new feature. Enter the ``-scores`` option. One can specify
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
182 how the scores from each overlapping interval should be reported.
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
183
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
184 ::
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
185
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
186 $ cat A.bed
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
187 chr1 100 200 A1 1
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
188 chr1 150 300 A2 2
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
189 chr1 250 500 A3 3
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
190
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
191 $ bedtools merge -i A.bed -scores mean
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
192 chr1 100 500 2
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
193
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
194 $ bedtools merge -i A.bed -scores max
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
195 chr1 100 500 3
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
196
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
197 $ bedtools merge -i A.bed -scores collapse
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
198 chr1 100 500 1,2,3
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
199
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
200
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
201 @REFERENCES@
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
202 </help>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
203 <expand macro="citations" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
204 </tool>