Source code

Download source archive ↓

upstream-extended/iuc/tools/bedtools/unionBedGraphs.xml

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