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" />
|
2
|
31 <expand macro="c_and_o_argument" />
|
0
|
32 </inputs>
|
|
33 <outputs>
|
|
34 <data format="bed" name="output" metadata_source="input" label="Merged ${input.name}"/>
|
|
35 </outputs>
|
|
36 <tests>
|
|
37 <test>
|
1
|
38 <param name="input" value="mergedBed1.bed" ftype="bed" />
|
|
39 <output name="output" file="mergedBed_result1.bed" ftype="bed" />
|
0
|
40 </test>
|
|
41 <test>
|
1
|
42 <param name="input" value="mergedBed2.bed" ftype="bed" />
|
0
|
43 <param name="strandedness" value="-s" />
|
1
|
44 <output name="output" file="mergedBed_result2.bed" ftype="bed" />
|
0
|
45 </test>
|
|
46 <test>
|
1
|
47 <param name="input" value="mergedBed3.bed" ftype="bed" />
|
0
|
48 <param name="report_number" value="-n" />
|
1
|
49 <output name="output" file="mergedBed_result3.bed" ftype="bed" />
|
0
|
50 </test>
|
|
51 <test>
|
1
|
52 <param name="input" value="mergedBed4.bed" ftype="bed" />
|
0
|
53 <param name="distance" value="1000" />
|
1
|
54 <output name="output" file="mergedBed_result4.bed" ftype="bed" />
|
0
|
55 </test>
|
2
|
56 <test>
|
|
57 <param name="input" value="mergedBed4.bed" ftype="bed" />
|
|
58 <param name="distance" value="1000" />
|
|
59 <repeat name="c_and_o_argument_repeat">
|
|
60 <param name="col" value="1"/>
|
|
61 <param name="operation" value="count"/>
|
|
62 </repeat>
|
|
63 <output name="output" file="mergedBed_result5.bed" ftype="bed" />
|
|
64 </test>
|
0
|
65 </tests>
|
|
66 <help>
|
1
|
67 <![CDATA[
|
0
|
68 **What it does**
|
|
69
|
|
70 bedtools merge combines overlapping or "book-ended" features in an interval file into a single feature which spans all of the combined features.
|
|
71
|
|
72
|
|
73 .. image:: $PATH_TO_IMAGES/merge-glyph.png
|
|
74
|
|
75
|
|
76 .. class:: warningmark
|
|
77
|
|
78 bedtools merge requires that you presort your data by chromosome and then by start position.
|
|
79
|
|
80
|
|
81 ==========================================================================
|
|
82 Default behavior
|
|
83 ==========================================================================
|
|
84 By default, ``bedtools merge`` combines overlapping (by at least 1 bp) and/or
|
|
85 bookended intervals into a single, "flattened" or "merged" interval.
|
|
86
|
|
87 ::
|
|
88
|
|
89 $ cat A.bed
|
|
90 chr1 100 200
|
|
91 chr1 180 250
|
|
92 chr1 250 500
|
|
93 chr1 501 1000
|
|
94
|
|
95 $ bedtools merge -i A.bed
|
|
96 chr1 100 500
|
|
97 chr1 501 1000
|
|
98
|
|
99
|
|
100 ==========================================================================
|
2
|
101 *-s* Enforcing "strandedness"
|
0
|
102 ==========================================================================
|
|
103 The ``-s`` option will only merge intervals that are overlapping/bookended
|
|
104 *and* are on the same strand.
|
|
105
|
|
106 ::
|
|
107
|
|
108 $ cat A.bed
|
|
109 chr1 100 200 a1 1 +
|
|
110 chr1 180 250 a2 2 +
|
|
111 chr1 250 500 a3 3 -
|
|
112 chr1 501 1000 a4 4 +
|
|
113
|
|
114 $ bedtools merge -i A.bed -s
|
|
115 chr1 100 250 +
|
|
116 chr1 501 1000 +
|
|
117 chr1 250 500 -
|
|
118
|
|
119
|
|
120 ==========================================================================
|
|
121 *-d* Controlling how close two features must be in order to merge
|
|
122 ==========================================================================
|
|
123 By default, only overlapping or book-ended features are combined into a new
|
|
124 feature. However, one can force ``merge`` to combine more distant features
|
|
125 with the ``-d`` option. For example, were one to set ``-d`` to 1000, any
|
|
126 features that overlap or are within 1000 base pairs of one another will be
|
|
127 combined.
|
|
128
|
|
129 ::
|
|
130
|
|
131 $ cat A.bed
|
|
132 chr1 100 200
|
|
133 chr1 501 1000
|
|
134
|
|
135 $ bedtools merge -i A.bed
|
|
136 chr1 100 200
|
|
137 chr1 501 1000
|
|
138
|
|
139 $ bedtools merge -i A.bed -d 1000
|
|
140 chr1 100 200 1000
|
|
141
|
|
142
|
|
143 @REFERENCES@
|
1
|
144 ]]>
|
0
|
145 </help>
|
|
146 <expand macro="citations" />
|
|
147 </tool>
|