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