10
|
1 <tool id="bedtools_mergebedgraph" name="Merge multiple BedGraph files" version="0.1.0">
|
|
2 <description></description>
|
11
|
3
|
|
4 <requirements>
|
|
5 <requirement type="binary">unionBedGraphs</requirement>
|
|
6 </requirements>
|
|
7
|
10
|
8 <command>unionBedGraphs
|
|
9 $header
|
|
10 -filler '$filler'
|
|
11 #if $zero.value == True:
|
|
12 -empty
|
|
13 -g ${chromInfo}
|
|
14 #end if
|
|
15
|
|
16 -i '$input1'
|
|
17 '$input2'
|
|
18 #for $q in $bedgraphs
|
|
19 '${q.input}'
|
|
20 #end for
|
|
21
|
|
22 -names
|
|
23 #if $name1.choice == "tag":
|
|
24 '${input1.name}'
|
|
25 #else
|
|
26 '${name1.custom_name}'
|
|
27 #end if
|
|
28
|
|
29 #if $name2.choice == "tag":
|
|
30 '${input2.name}'
|
|
31 #else
|
|
32 '${name2.custom_name}'
|
|
33 #end if
|
|
34
|
|
35 #for $q in $bedgraphs
|
|
36 #if $q.name.choice == "tag":
|
|
37 '${q.input.name}'
|
|
38 #else
|
|
39 '${q.input.custom_name}'
|
|
40 #end if
|
|
41 #end for
|
|
42 > '$output'
|
|
43 </command>
|
|
44
|
|
45 <inputs>
|
|
46 <!-- Make it easy for the user, first two input files are always shown -->
|
|
47 <!-- INPUT 1 -->
|
|
48 <param name="input1" format="bedgraph" type="data" label="First BedGraph file" />
|
|
49
|
|
50 <conditional name="name1">
|
|
51 <param name="choice" type="select" label="Sample name">
|
|
52 <option value="tag" selected="true">Use input's tag</option>
|
|
53 <option value="custom">Enter custom table name</option>
|
|
54 </param>
|
|
55 <when value="tag">
|
|
56 </when>
|
|
57 <when value="custom">
|
|
58 <param name="custom_name" type="text" area="false" label="Custom sample name"/>
|
|
59 </when>
|
|
60 </conditional>
|
|
61
|
|
62 <!-- INPUT 2 -->
|
|
63 <param name="input2" format="bedgraph" type="data" label="Second BedGraph file" />
|
|
64
|
|
65 <conditional name="name2">
|
|
66 <param name="choice" type="select" label="Sample name">
|
|
67 <option value="tag" selected="true">Use input's tag</option>
|
|
68 <option value="custom">Enter custom table name</option>
|
|
69 </param>
|
|
70 <when value="tag">
|
|
71 </when>
|
|
72 <when value="custom">
|
|
73 <param name="custom_name" type="text" area="false" label="Custom sample name"/>
|
|
74 </when>
|
|
75 </conditional>
|
|
76
|
|
77 <!-- Additional files, if the user needs more -->
|
|
78 <repeat name="bedgraphs" title="Add'l BedGraph files" >
|
|
79 <param name="input" format="bedgraph" type="data" label="BedGraph file" />
|
|
80
|
|
81 <conditional name="name">
|
|
82 <param name="choice" type="select" label="Sample name">
|
|
83 <option value="tag" selected="true">Use input's tag</option>
|
|
84 <option value="custom">Enter custom table name</option>
|
|
85 </param>
|
|
86 <when value="tag">
|
|
87 </when>
|
|
88 <when value="custom">
|
|
89 <param name="custom_name" type="text" area="false" label="Custom sample name"/>
|
|
90 </when>
|
|
91 </conditional>
|
|
92 </repeat>
|
|
93
|
|
94 <param name="header" type="boolean" checked="true" truevalue="-header" falsevalue="" label="Print header line" help="The first line will include the name of each sample." />
|
|
95
|
|
96 <param name="zero" type="boolean" checked="true" label="Report regions with zero coverage" help="If set, regions without any coverage will also be reported. Requires a valid organism key for all input datasets" />
|
|
97
|
|
98 <param name="filler" type="text" value="0" label="Text to use for no-coverage value" help="Can be 0.0, N/A, - or any other value." />
|
|
99 </inputs>
|
|
100
|
|
101 <outputs>
|
|
102 <data format="tabular" name="output" metadata_source="input1" label="Merged BedGraphs of ${input1.name}, ${input2.name} and so on." />
|
|
103 </outputs>
|
|
104 <help>
|
|
105
|
|
106 **What it does**
|
|
107
|
|
108 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.
|
|
109
|
|
110 .. image:: http://people.virginia.edu/~arq5x/files/bedtools-galaxy/ubg.png
|
|
111
|
|
112
|
|
113 .. class:: warningmark
|
|
114
|
|
115 This tool requires that each BedGraph file is reference-sorted (chrom, then start) and contains non-overlapping intervals (within a given file).
|
|
116
|
|
117 .. class:: warningmark
|
|
118
|
|
119 This tool requires that `bedtools`__ has been installed on your system.
|
|
120
|
|
121 ------
|
|
122
|
|
123 **Example input**::
|
|
124
|
|
125 # 1.bedgraph
|
|
126 chr1 1000 1500 10
|
|
127 chr1 2000 2100 20
|
|
128
|
|
129 # 2.bedgraph
|
|
130 chr1 900 1600 60
|
|
131 chr1 1700 2050 50
|
|
132
|
|
133 # 3.bedgraph
|
|
134 chr1 1980 2070 80
|
|
135 chr1 2090 2100 20
|
|
136
|
|
137
|
|
138 ------
|
|
139
|
|
140 **Examples using the Zero Coverage checkbox**
|
|
141
|
|
142 Output example (*without* checking "Report regions with zero coverage")::
|
|
143
|
|
144 chr1 900 1000 0 60 0
|
|
145 chr1 1000 1500 10 60 0
|
|
146 chr1 1500 1600 0 60 0
|
|
147 chr1 1700 1980 0 50 0
|
|
148 chr1 1980 2000 0 50 80
|
|
149 chr1 2000 2050 20 50 80
|
|
150 chr1 2050 2070 20 0 80
|
|
151 chr1 2070 2090 20 0 0
|
|
152 chr1 2090 2100 20 0 20
|
|
153
|
|
154
|
|
155 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).::
|
|
156
|
|
157 chr1 0 900 0 0 0 (*)
|
|
158 chr1 900 1000 0 60 0
|
|
159 chr1 1000 1500 10 60 0
|
|
160 chr1 1500 1600 0 60 0
|
|
161 chr1 1600 1700 0 0 0 (*)
|
|
162 chr1 1700 1980 0 50 0
|
|
163 chr1 1980 2000 0 50 80
|
|
164 chr1 2000 2050 20 50 80
|
|
165 chr1 2050 2070 20 0 80
|
|
166 chr1 2070 2090 20 0 0
|
|
167 chr1 2090 2100 20 0 20
|
|
168 chr1 2100 247249719 0 0 0 (*)
|
|
169
|
|
170
|
|
171 ------
|
|
172
|
|
173 **Examples adjusting the "Filler value" for no-covered intervals**
|
|
174
|
|
175 The default value is '0', but you can use any other value.
|
|
176
|
|
177 Output example with **filler = N/A**::
|
|
178
|
|
179 chr1 900 1000 N/A 60 N/A
|
|
180 chr1 1000 1500 10 60 N/A
|
|
181 chr1 1500 1600 N/A 60 N/A
|
|
182 chr1 1600 1700 N/A N/A N/A
|
|
183 chr1 1700 1980 N/A 50 N/A
|
|
184 chr1 1980 2000 N/A 50 80
|
|
185 chr1 2000 2050 20 50 80
|
|
186 chr1 2050 2070 20 N/A 80
|
|
187 chr1 2070 2090 20 N/A N/A
|
|
188 chr1 2090 2100 20 N/A 20
|
|
189
|
|
190
|
|
191 ------
|
|
192
|
|
193 **Examples using the "sample name" labels**::
|
|
194
|
|
195 chrom start end WT-1 WT-2 KO-1
|
|
196 chr1 900 1000 N/A 60 N/A
|
|
197 chr1 1000 1500 10 60 N/A
|
|
198 chr1 1500 1600 N/A 60 N/A
|
|
199 chr1 1600 1700 N/A N/A N/A
|
|
200 chr1 1700 1980 N/A 50 N/A
|
|
201 chr1 1980 2000 N/A 50 80
|
|
202 chr1 2000 2050 20 50 80
|
|
203 chr1 2050 2070 20 N/A 80
|
|
204 chr1 2070 2090 20 N/A N/A
|
|
205 chr1 2090 2100 20 N/A 20
|
|
206
|
|
207
|
|
208 ------
|
|
209
|
|
210 **Non-numeric values**
|
|
211
|
|
212 The input BedGraph files can contain any kind of value in the fourth column, not necessarily a numeric value.
|
|
213
|
|
214 Input Example::
|
|
215
|
|
216 File-1 File-2
|
|
217 chr1 200 300 Sample1 chr1 100 240 0.75
|
|
218 chr1 400 450 Sample1 chr1 250 700 0.43
|
|
219 chr1 530 600 Sample2
|
|
220
|
|
221 Output Example::
|
|
222
|
|
223 chr1 100 200 0 0.75
|
|
224 chr1 200 240 Sample1 0.75
|
|
225 chr1 240 250 Sample1 0
|
|
226 chr1 250 300 Sample1 0.43
|
|
227 chr1 300 400 0 0.43
|
|
228 chr1 400 450 Sample1 0.43
|
|
229 chr1 450 530 0 0.43
|
|
230 chr1 530 600 Sample2 0.43
|
|
231 chr1 600 700 0 0.43
|
|
232
|
|
233
|
|
234 -----
|
|
235
|
|
236 This tool is part of the `bedtools package`__ from the `Quinlan laboratory`__. If you use this tool, please cite `Quinlan AR, and Hall I.M. BEDTools: A flexible framework for comparing genomic features. Bioinformatics, 2010, 26, 6.`__
|
|
237
|
|
238 .. __: http://code.google.com/p/bedtools/
|
|
239 .. __: http://code.google.com/p/bedtools/
|
|
240 .. __: http://cphg.virginia.edu/quinlan/
|
|
241 .. __: http://bioinformatics.oxfordjournals.org/content/26/6/841.short
|
|
242
|
|
243
|
|
244
|
|
245
|
|
246 </help>
|
|
247 </tool>
|