1
|
1 <tool id="bedtools_unionbedgraph" name="Merge BedGraph files" version="@WRAPPER_VERSION@.0">
|
0
|
2 <description></description>
|
|
3 <macros>
|
|
4 <import>macros.xml</import>
|
|
5 </macros>
|
|
6 <expand macro="requirements" />
|
|
7 <expand macro="stdio" />
|
1
|
8 <command>
|
|
9 <![CDATA[
|
|
10 unionBedGraphs
|
0
|
11 $header
|
1
|
12 -filler "${filler}"
|
0
|
13 #if $zero.value == True:
|
|
14 -empty
|
1
|
15 -g $genome
|
0
|
16 #end if
|
|
17
|
1
|
18 #if str($tag.tag_select) == "tag":
|
|
19 #set files = '" "'.join( [ str( $file ) for $file in $tag.inputs ] )
|
|
20 -i "${files}"
|
|
21 #else:
|
|
22 -i
|
|
23 #for $bg in $tag.bedgraphs:
|
|
24 "${bg.input}"
|
|
25 #end for
|
|
26 -names
|
|
27 #for $bg in $tag.bedgraphs:
|
|
28 "${bg.custom_name}"
|
|
29 #end for
|
0
|
30 #end if
|
1
|
31 > "${output}"
|
|
32 ]]>
|
0
|
33 </command>
|
|
34 <inputs>
|
1
|
35 <conditional name="tag">
|
|
36 <param name="tag_select" type="select" label="Sample name">
|
0
|
37 <option value="tag" selected="true">Use input's tag</option>
|
1
|
38 <option value="custom">Enter custom name per file</option>
|
0
|
39 </param>
|
|
40 <when value="tag">
|
1
|
41 <param name="inputs" format="bedgraph" type="data" multiple="True" label="BedGraph files" />
|
0
|
42 </when>
|
|
43 <when value="custom">
|
1
|
44 <repeat name="bedgraphs" title="Add BedGraph files" min="2" >
|
|
45 <param name="input" format="bedgraph" type="data" multiple="True" label="BedGraph file" />
|
|
46 <param name="custom_name" type="text" area="false" label="Custom sample name"/>
|
|
47 </repeat>
|
0
|
48 </when>
|
|
49 </conditional>
|
1
|
50 <expand macro="genome" />
|
|
51 <param name="zero" type="boolean" checked="true"
|
|
52 label="Report regions with zero coverage"
|
|
53 help="If set, regions without any coverage will also be reported. Requires a valid organism key for all input datasets" />
|
|
54 <param name="filler" type="text" value="N/A"
|
|
55 label="Text to use for no-coverage value"
|
|
56 help="Can be 0.0, N/A, - or any other value. (-filler)" />
|
|
57 <expand macro="print_header" />
|
0
|
58 </inputs>
|
|
59 <outputs>
|
1
|
60 <data name="output" format="bedgraph" />
|
0
|
61 </outputs>
|
1
|
62 <tests>
|
|
63 <test>
|
|
64 <param name="tag_select" value="tag"/>
|
|
65 <param name="inputs" value="unionBedGraphs1.bg,unionBedGraphs2.bg,unionBedGraphs3.bg" ftype="bedgraph" />
|
|
66 <param name="zero" value="False"/>
|
|
67 <output name="output" file="unionBedGraphs_result1.bg" ftype="bedgraph" />
|
|
68 </test>
|
|
69 <test>
|
|
70 <param name="tag_select" value="tag"/>
|
|
71 <param name="inputs" value="unionBedGraphs1.bg,unionBedGraphs2.bg,unionBedGraphs3.bg" ftype="bedgraph" />
|
|
72 <param name="header" value="True"/>
|
|
73 <param name="zero" value="False"/>
|
|
74 <output name="output" file="unionBedGraphs_result2.bg" ftype="bedgraph" />
|
|
75 </test>
|
|
76 <test>
|
|
77 <param name="tag_select" value="tag"/>
|
|
78 <param name="inputs" value="unionBedGraphs1.bg,unionBedGraphs2.bg,unionBedGraphs3.bg" ftype="bedgraph" />
|
|
79 <param name="zero" value="True"/>
|
|
80 <param name="genome" value="unionBedGraphs1.len"/>
|
|
81 <output name="output" file="unionBedGraphs_result3.bg" ftype="bedgraph" />
|
|
82 </test>
|
|
83 <test>
|
|
84 <param name="tag_select" value="custom"/>
|
|
85 <repeat name="bedgraphs">
|
|
86 <param name="input" value="unionBedGraphs1.bg" />
|
|
87 <param name="custom_name" value="first" />
|
|
88 </repeat>
|
|
89 <repeat name="bedgraphs">
|
|
90 <param name="input" value="unionBedGraphs2.bg" />
|
|
91 <param name="custom_name" value="second" />
|
|
92 </repeat>
|
|
93 <repeat name="bedgraphs">
|
|
94 <param name="input" value="unionBedGraphs3.bg" />
|
|
95 <param name="custom_name" value="third" />
|
|
96 </repeat>
|
|
97 <param name="zero" value="True"/>
|
|
98 <param name="genome" value="unionBedGraphs1.len"/>
|
|
99 <output name="output" file="unionBedGraphs_result4.bg" ftype="bedgraph" />
|
|
100 </test>
|
|
101 </tests>
|
0
|
102 <help>
|
1
|
103 <![CDATA[
|
0
|
104 **What it does**
|
|
105
|
|
106 This tool merges multiple BedGraph files, allowing direct and fine-scale coverage comparisons among many samples/files. The BedGraph files need not represent the same intervals; the tool will identify both common and file-specific intervals. In addition, the BedGraph values need not be numeric: one can use any text as the BedGraph value and the tool will compare the values from multiple files.
|
|
107
|
|
108 .. image:: http://people.virginia.edu/~arq5x/files/bedtools-galaxy/ubg.png
|
|
109
|
|
110
|
|
111 .. class:: warningmark
|
|
112
|
|
113 This tool requires that each BedGraph file is reference-sorted (chrom, then start) and contains non-overlapping intervals (within a given file).
|
|
114
|
|
115
|
|
116 ------
|
|
117
|
|
118 **Example input**::
|
|
119
|
|
120 # 1.bedgraph
|
|
121 chr1 1000 1500 10
|
|
122 chr1 2000 2100 20
|
|
123
|
|
124 # 2.bedgraph
|
|
125 chr1 900 1600 60
|
|
126 chr1 1700 2050 50
|
|
127
|
|
128 # 3.bedgraph
|
|
129 chr1 1980 2070 80
|
|
130 chr1 2090 2100 20
|
|
131
|
|
132
|
|
133 ------
|
|
134
|
|
135 **Examples using the Zero Coverage checkbox**
|
|
136
|
|
137 Output example (*without* checking "Report regions with zero coverage")::
|
|
138
|
|
139 chr1 900 1000 0 60 0
|
|
140 chr1 1000 1500 10 60 0
|
|
141 chr1 1500 1600 0 60 0
|
|
142 chr1 1700 1980 0 50 0
|
|
143 chr1 1980 2000 0 50 80
|
|
144 chr1 2000 2050 20 50 80
|
|
145 chr1 2050 2070 20 0 80
|
|
146 chr1 2070 2090 20 0 0
|
|
147 chr1 2090 2100 20 0 20
|
|
148
|
|
149
|
|
150 Output example (*with* checking "Report regions with zero coverage"). The lines marked with (*) are not covered in any input file, but are still reported (The asterisk marking does not appear in the file).::
|
|
151
|
|
152 chr1 0 900 0 0 0 (*)
|
|
153 chr1 900 1000 0 60 0
|
|
154 chr1 1000 1500 10 60 0
|
|
155 chr1 1500 1600 0 60 0
|
|
156 chr1 1600 1700 0 0 0 (*)
|
|
157 chr1 1700 1980 0 50 0
|
|
158 chr1 1980 2000 0 50 80
|
|
159 chr1 2000 2050 20 50 80
|
|
160 chr1 2050 2070 20 0 80
|
|
161 chr1 2070 2090 20 0 0
|
|
162 chr1 2090 2100 20 0 20
|
|
163 chr1 2100 247249719 0 0 0 (*)
|
|
164
|
|
165
|
|
166 ------
|
|
167
|
|
168 **Examples adjusting the "Filler value" for no-covered intervals**
|
|
169
|
|
170 The default value is '0', but you can use any other value.
|
|
171
|
|
172 Output example with **filler = N/A**::
|
|
173
|
|
174 chr1 900 1000 N/A 60 N/A
|
|
175 chr1 1000 1500 10 60 N/A
|
|
176 chr1 1500 1600 N/A 60 N/A
|
|
177 chr1 1600 1700 N/A N/A N/A
|
|
178 chr1 1700 1980 N/A 50 N/A
|
|
179 chr1 1980 2000 N/A 50 80
|
|
180 chr1 2000 2050 20 50 80
|
|
181 chr1 2050 2070 20 N/A 80
|
|
182 chr1 2070 2090 20 N/A N/A
|
|
183 chr1 2090 2100 20 N/A 20
|
|
184
|
|
185
|
|
186 ------
|
|
187
|
|
188 **Examples using the "sample name" labels**::
|
|
189
|
|
190 chrom start end WT-1 WT-2 KO-1
|
|
191 chr1 900 1000 N/A 60 N/A
|
|
192 chr1 1000 1500 10 60 N/A
|
|
193 chr1 1500 1600 N/A 60 N/A
|
|
194 chr1 1600 1700 N/A N/A N/A
|
|
195 chr1 1700 1980 N/A 50 N/A
|
|
196 chr1 1980 2000 N/A 50 80
|
|
197 chr1 2000 2050 20 50 80
|
|
198 chr1 2050 2070 20 N/A 80
|
|
199 chr1 2070 2090 20 N/A N/A
|
|
200 chr1 2090 2100 20 N/A 20
|
|
201
|
|
202
|
|
203 ------
|
|
204
|
|
205 **Non-numeric values**
|
|
206
|
|
207 The input BedGraph files can contain any kind of value in the fourth column, not necessarily a numeric value.
|
|
208
|
|
209 Input Example::
|
|
210
|
|
211 File-1 File-2
|
|
212 chr1 200 300 Sample1 chr1 100 240 0.75
|
|
213 chr1 400 450 Sample1 chr1 250 700 0.43
|
|
214 chr1 530 600 Sample2
|
|
215
|
|
216 Output Example::
|
|
217
|
|
218 chr1 100 200 0 0.75
|
|
219 chr1 200 240 Sample1 0.75
|
|
220 chr1 240 250 Sample1 0
|
|
221 chr1 250 300 Sample1 0.43
|
|
222 chr1 300 400 0 0.43
|
|
223 chr1 400 450 Sample1 0.43
|
|
224 chr1 450 530 0 0.43
|
|
225 chr1 530 600 Sample2 0.43
|
|
226 chr1 600 700 0 0.43
|
|
227
|
|
228 @REFERENCES@
|
1
|
229 ]]>
|
0
|
230 </help>
|
|
231 <expand macro="citations" />
|
|
232 </tool>
|