2
|
1 <tool id="bedtools_mergebed" name="Merge BED files" version="@WRAPPER_VERSION@.1">
|
0
|
2 <description>(mergeBed)</description>
|
|
3 <macros>
|
|
4 <import>macros.xml</import>
|
|
5 </macros>
|
|
6 <expand macro="requirements" />
|
|
7 <expand macro="stdio" />
|
|
8 <command>
|
1
|
9 <![CDATA[
|
|
10 mergeBed
|
|
11 -i "${input}"
|
|
12 $strand
|
0
|
13 -d $distance
|
1
|
14 $header
|
2
|
15 @C_AND_O_ARGUMENT@
|
1
|
16 > "${output}"
|
|
17 ]]>
|
0
|
18 </command>
|
|
19 <inputs>
|
1
|
20 <param name="input" format="bam,bed,gff,vcf" type="data" label="Sort the following BAM/BED/VCF/GFF file"/>
|
|
21 <param name="strand" type="select" label="Calculation based on strandedness?">
|
|
22 <option value="" selected="True">Overlaps on either strand</option>
|
|
23 <option value="-s">Force strandedness. That is, only merge features that are the same strand.</option>
|
|
24 <option value="-S +">Force merge for forward strand only.</option>
|
|
25 <option value="-S -">Force merge for reverse strand only.</option>
|
|
26 </param>
|
|
27 <param name="distance" type="integer" value="0"
|
|
28 label="Maximum distance between features allowed for features to be merged"
|
|
29 help="That is, overlapping and/or book-ended features are merged. (-d)"/>
|
|
30 <expand macro="print_header" />
|
3
|
31 <expand macro="c_and_o_argument">
|
|
32 <param name="col" type="data_column" data_ref="input" label="Specify the column(s) that should be summarized" help="(-c)" />
|
|
33 </expand>
|
0
|
34 </inputs>
|
|
35 <outputs>
|
|
36 <data format="bed" name="output" metadata_source="input" label="Merged ${input.name}"/>
|
|
37 </outputs>
|
|
38 <tests>
|
|
39 <test>
|
1
|
40 <param name="input" value="mergedBed1.bed" ftype="bed" />
|
|
41 <output name="output" file="mergedBed_result1.bed" ftype="bed" />
|
0
|
42 </test>
|
|
43 <test>
|
1
|
44 <param name="input" value="mergedBed2.bed" ftype="bed" />
|
0
|
45 <param name="strandedness" value="-s" />
|
1
|
46 <output name="output" file="mergedBed_result2.bed" ftype="bed" />
|
0
|
47 </test>
|
|
48 <test>
|
1
|
49 <param name="input" value="mergedBed3.bed" ftype="bed" />
|
0
|
50 <param name="report_number" value="-n" />
|
1
|
51 <output name="output" file="mergedBed_result3.bed" ftype="bed" />
|
0
|
52 </test>
|
|
53 <test>
|
1
|
54 <param name="input" value="mergedBed4.bed" ftype="bed" />
|
0
|
55 <param name="distance" value="1000" />
|
1
|
56 <output name="output" file="mergedBed_result4.bed" ftype="bed" />
|
0
|
57 </test>
|
2
|
58 <test>
|
|
59 <param name="input" value="mergedBed4.bed" ftype="bed" />
|
|
60 <param name="distance" value="1000" />
|
|
61 <repeat name="c_and_o_argument_repeat">
|
|
62 <param name="col" value="1"/>
|
|
63 <param name="operation" value="count"/>
|
|
64 </repeat>
|
|
65 <output name="output" file="mergedBed_result5.bed" ftype="bed" />
|
|
66 </test>
|
0
|
67 </tests>
|
|
68 <help>
|
1
|
69 <![CDATA[
|
0
|
70 **What it does**
|
|
71
|
|
72 bedtools merge combines overlapping or "book-ended" features in an interval file into a single feature which spans all of the combined features.
|
|
73
|
|
74
|
|
75 .. image:: $PATH_TO_IMAGES/merge-glyph.png
|
|
76
|
|
77
|
|
78 .. class:: warningmark
|
|
79
|
|
80 bedtools merge requires that you presort your data by chromosome and then by start position.
|
|
81
|
|
82
|
|
83 ==========================================================================
|
|
84 Default behavior
|
|
85 ==========================================================================
|
|
86 By default, ``bedtools merge`` combines overlapping (by at least 1 bp) and/or
|
|
87 bookended intervals into a single, "flattened" or "merged" interval.
|
|
88
|
|
89 ::
|
|
90
|
|
91 $ cat A.bed
|
|
92 chr1 100 200
|
|
93 chr1 180 250
|
|
94 chr1 250 500
|
|
95 chr1 501 1000
|
|
96
|
|
97 $ bedtools merge -i A.bed
|
|
98 chr1 100 500
|
|
99 chr1 501 1000
|
|
100
|
|
101
|
|
102 ==========================================================================
|
2
|
103 *-s* Enforcing "strandedness"
|
0
|
104 ==========================================================================
|
|
105 The ``-s`` option will only merge intervals that are overlapping/bookended
|
|
106 *and* are on the same strand.
|
|
107
|
|
108 ::
|
|
109
|
|
110 $ cat A.bed
|
|
111 chr1 100 200 a1 1 +
|
|
112 chr1 180 250 a2 2 +
|
|
113 chr1 250 500 a3 3 -
|
|
114 chr1 501 1000 a4 4 +
|
|
115
|
|
116 $ bedtools merge -i A.bed -s
|
|
117 chr1 100 250 +
|
|
118 chr1 501 1000 +
|
|
119 chr1 250 500 -
|
|
120
|
|
121
|
|
122 ==========================================================================
|
|
123 *-d* Controlling how close two features must be in order to merge
|
|
124 ==========================================================================
|
|
125 By default, only overlapping or book-ended features are combined into a new
|
|
126 feature. However, one can force ``merge`` to combine more distant features
|
|
127 with the ``-d`` option. For example, were one to set ``-d`` to 1000, any
|
|
128 features that overlap or are within 1000 base pairs of one another will be
|
|
129 combined.
|
|
130
|
|
131 ::
|
|
132
|
|
133 $ cat A.bed
|
|
134 chr1 100 200
|
|
135 chr1 501 1000
|
|
136
|
|
137 $ bedtools merge -i A.bed
|
|
138 chr1 100 200
|
|
139 chr1 501 1000
|
|
140
|
|
141 $ bedtools merge -i A.bed -d 1000
|
|
142 chr1 100 200 1000
|
|
143
|
|
144
|
|
145 @REFERENCES@
|
1
|
146 ]]>
|
0
|
147 </help>
|
|
148 <expand macro="citations" />
|
|
149 </tool>
|