annotate bedgraph_to_bigwig.xml @ 0:3290b79cd9f3 draft default tip

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