|
0
|
1 <?xml version="1.0"?>
|
|
|
2 <tool id="bedgraph_to_bigwig" name="bedGraphToBigWig" version="1.0">
|
|
|
3 <description>Converts a bedGraph file to bigWig format</description>
|
|
|
4
|
|
|
5 <macros>
|
|
|
6 <import>ucsc_macros.xml</import>
|
|
|
7 </macros>
|
|
|
8
|
|
|
9 <requirements>
|
|
|
10 <requirement type="package" version="340">ucsc_bigwig</requirement>
|
|
|
11 <requirement type="package" version="340">ucsc_bigbed</requirement>
|
|
|
12 </requirements>
|
|
|
13
|
|
|
14 <command detect_errors="exit_code">
|
|
|
15 <![CDATA[
|
|
|
16 @OPTIONAL_PARAM_FUNC@
|
|
|
17
|
|
|
18 ## Allow UCSC track and browser lines in input file
|
|
|
19 awk '$0 !~ /^(track|browser) /' "${bedgraph_input}" |
|
|
|
20
|
|
|
21 #if str($bed_clip) == "bedClip":
|
|
|
22 bedClip -verbose=2
|
|
|
23 stdin "${chrominfo_input}" stdout |
|
|
|
24 #end if
|
|
|
25
|
|
|
26 sort -k 1,1 -k 2,2n > "${bedgraph_input}".sorted &&
|
|
|
27
|
|
|
28 bedGraphToBigWig
|
|
|
29 $optional_param("-blockSize", $adv.block_size)
|
|
|
30 $optional_param("-itemsPerSlot", $adv.items_per_slot)
|
|
|
31 ${adv.no_compression}
|
|
|
32 "${bedgraph_input}".sorted "${chrominfo_input}" "${bw_output}"
|
|
|
33 ]]>
|
|
|
34 </command>
|
|
|
35
|
|
|
36 <expand macro="environment_LC_COLLATE" />
|
|
|
37
|
|
|
38 <inputs>
|
|
|
39 <param name="bedgraph_input" type="data" format="bedgraph"
|
|
|
40 label="bedGraph input file" />
|
|
|
41
|
|
|
42 <param name="chrominfo_input" type="data" format="tabular"
|
|
|
43 label="Chromosomes sizes file" />
|
|
|
44
|
|
|
45 <param name="bed_clip" type="boolean" checked="false"
|
|
|
46 truevalue="bedClip" falsevalue=""
|
|
|
47 label="Remove BED items that extend beyond the scaffolds"
|
|
|
48 help="bedClip" />
|
|
|
49
|
|
|
50 <section name="adv" title="Advanced options" expanded="false">
|
|
|
51 <param name="block_size" type="integer" label="Block size"
|
|
|
52 min="1" optional="true"
|
|
|
53 help="Number of items to bundle in r-tree" />
|
|
|
54
|
|
|
55 <param name="items_per_slot" type="integer" label="Items per slot"
|
|
|
56 min="1" optional="true"
|
|
|
57 help="Number of data points bundled at the lowest level" />
|
|
|
58
|
|
|
59 <param name="no_compression" type="boolean" checked="false"
|
|
|
60 truevalue="-unc" falsevalue=""
|
|
|
61 label="Do not use compression"
|
|
|
62 help="-unc" />
|
|
|
63 </section>
|
|
|
64 </inputs>
|
|
|
65 <outputs>
|
|
|
66 <data name="bw_output" format="bigwig" />
|
|
|
67 </outputs>
|
|
|
68 <tests>
|
|
|
69 <test>
|
|
|
70 <!-- Test bedGraphToBigWig with default settings -->
|
|
|
71 <param name="bedgraph_input" value="contigs.bedgraph" ftype="bedgraph" />
|
|
|
72 <param name="chrominfo_input" value="contigs_chromInfo.tab" ftype="tabular" />
|
|
|
73 <output name="bw_output" file="contigs.bedgraph.bw" />
|
|
|
74 </test>
|
|
|
75 <test>
|
|
|
76 <!-- Test bedGraphToBigWig with advanced options -->
|
|
|
77 <param name="bedgraph_input" value="contigs.bedgraph" ftype="bedgraph" />
|
|
|
78 <param name="chrominfo_input" value="contigs_chromInfo.tab" ftype="tabular" />
|
|
|
79 <param name="block_size" value="200" />
|
|
|
80 <param name="items_per_slot" value="500" />
|
|
|
81 <param name="no_compression" value="-unc" />
|
|
|
82 <output name="bw_output" file="contigs.bedgraph_advanced.bw" />
|
|
|
83 </test>
|
|
|
84 <test>
|
|
|
85 <!-- Test bedGraphToBigWig with default settings -->
|
|
|
86 <param name="bedgraph_input" value="contigs.clip.bedGraph" ftype="bedgraph" />
|
|
|
87 <param name="chrominfo_input" value="contigs_chromInfo.tab" ftype="tabular" />
|
|
|
88 <param name="bed_clip" value="bedClip" />
|
|
|
89 <output name="bw_output" file="contigs.bedgraph_clip.bw" />
|
|
|
90 </test>
|
|
|
91 </tests>
|
|
|
92 <help>
|
|
|
93 <![CDATA[
|
|
|
94 **What it does**
|
|
|
95
|
|
|
96 bedGraphToBigWig converts a `bedGraph <https://genome.ucsc.edu/goldenpath/help/bedgraph.html>`_ file
|
|
|
97 to the `bigWig format <https://genome.ucsc.edu/goldenpath/help/bigWig.html>`_.
|
|
|
98
|
|
|
99 ----
|
|
|
100
|
|
|
101 **The bedGraph format**
|
|
|
102
|
|
|
103 The first three columns of the bedGraph file are the same as the
|
|
|
104 `BED format <https://genome.ucsc.edu/FAQ/FAQformat.html#format1>`_, and it uses
|
|
|
105 a `zero-start, half-open <http://genome.ucsc.edu/blog/the-ucsc-genome-browser-coordinate-counting-systems/>`_
|
|
|
106 coordinate system. The fourth column of the bedGraph file contains the data values::
|
|
|
107
|
|
|
108 chromA chromStartA chromEndA dataValueA
|
|
|
109 chromB chromStartB chromEndB dataValueB
|
|
|
110
|
|
|
111 ----
|
|
|
112
|
|
|
113 .. class:: infomark
|
|
|
114
|
|
|
115 **Chromosomes sizes file**
|
|
|
116
|
|
|
117 This tool requires a chromosomes sizes (``chrom.sizes``) file, which lists the size of
|
|
|
118 each scaffold within an assembly. For genome assemblies that are hosted by UCSC,
|
|
|
119 the ``chrom.sizes`` file is available through the
|
|
|
120 `Sequence and Annotation Downloads <http://hgdownload.cse.ucsc.edu/downloads.html>`_ page.
|
|
|
121 The `twoBitInfo <https://genome.ucsc.edu/goldenpath/help/twoBit.html>`_ tool
|
|
|
122 can be used to generate the ``chrom.sizes`` for the genome assemblies that are not hosted
|
|
|
123 by UCSC.
|
|
|
124
|
|
|
125 ]]></help>
|
|
|
126
|
|
|
127 <expand macro="citations" />
|
|
|
128 </tool>
|