Mercurial > repos > yating-l > bedgraph_to_bigwig_340
changeset 0:3290b79cd9f3 draft default tip
planemo upload
author | yating-l |
---|---|
date | Wed, 17 May 2017 16:28:29 -0400 |
parents | |
children | |
files | bedgraph_to_bigwig.xml test-data/contigs.bedgraph test-data/contigs.bedgraph.bw test-data/contigs.bedgraph_advanced.bw test-data/contigs.bedgraph_clip.bw test-data/contigs.clip.bedgraph test-data/contigs_chromInfo.tab tool_dependencies.xml ucsc_macros.xml |
diffstat | 9 files changed, 287 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bedgraph_to_bigwig.xml Wed May 17 16:28:29 2017 -0400 @@ -0,0 +1,128 @@ +<?xml version="1.0"?> +<tool id="bedgraph_to_bigwig" name="bedGraphToBigWig" version="1.0"> + <description>Converts a bedGraph file to bigWig format</description> + + <macros> + <import>ucsc_macros.xml</import> + </macros> + + <requirements> + <requirement type="package" version="340">ucsc_bigwig</requirement> + <requirement type="package" version="340">ucsc_bigbed</requirement> + </requirements> + + <command detect_errors="exit_code"> +<![CDATA[ + @OPTIONAL_PARAM_FUNC@ + + ## Allow UCSC track and browser lines in input file + awk '$0 !~ /^(track|browser) /' "${bedgraph_input}" | + + #if str($bed_clip) == "bedClip": + bedClip -verbose=2 + stdin "${chrominfo_input}" stdout | + #end if + + sort -k 1,1 -k 2,2n > "${bedgraph_input}".sorted && + + bedGraphToBigWig + $optional_param("-blockSize", $adv.block_size) + $optional_param("-itemsPerSlot", $adv.items_per_slot) + ${adv.no_compression} + "${bedgraph_input}".sorted "${chrominfo_input}" "${bw_output}" +]]> + </command> + + <expand macro="environment_LC_COLLATE" /> + + <inputs> + <param name="bedgraph_input" type="data" format="bedgraph" + label="bedGraph input file" /> + + <param name="chrominfo_input" type="data" format="tabular" + label="Chromosomes sizes file" /> + + <param name="bed_clip" type="boolean" checked="false" + truevalue="bedClip" falsevalue="" + label="Remove BED items that extend beyond the scaffolds" + help="bedClip" /> + + <section name="adv" title="Advanced options" expanded="false"> + <param name="block_size" type="integer" label="Block size" + min="1" optional="true" + help="Number of items to bundle in r-tree" /> + + <param name="items_per_slot" type="integer" label="Items per slot" + min="1" optional="true" + help="Number of data points bundled at the lowest level" /> + + <param name="no_compression" type="boolean" checked="false" + truevalue="-unc" falsevalue="" + label="Do not use compression" + help="-unc" /> + </section> + </inputs> + <outputs> + <data name="bw_output" format="bigwig" /> + </outputs> + <tests> + <test> + <!-- Test bedGraphToBigWig with default settings --> + <param name="bedgraph_input" value="contigs.bedgraph" ftype="bedgraph" /> + <param name="chrominfo_input" value="contigs_chromInfo.tab" ftype="tabular" /> + <output name="bw_output" file="contigs.bedgraph.bw" /> + </test> + <test> + <!-- Test bedGraphToBigWig with advanced options --> + <param name="bedgraph_input" value="contigs.bedgraph" ftype="bedgraph" /> + <param name="chrominfo_input" value="contigs_chromInfo.tab" ftype="tabular" /> + <param name="block_size" value="200" /> + <param name="items_per_slot" value="500" /> + <param name="no_compression" value="-unc" /> + <output name="bw_output" file="contigs.bedgraph_advanced.bw" /> + </test> + <test> + <!-- Test bedGraphToBigWig with default settings --> + <param name="bedgraph_input" value="contigs.clip.bedGraph" ftype="bedgraph" /> + <param name="chrominfo_input" value="contigs_chromInfo.tab" ftype="tabular" /> + <param name="bed_clip" value="bedClip" /> + <output name="bw_output" file="contigs.bedgraph_clip.bw" /> + </test> + </tests> + <help> +<![CDATA[ +**What it does** + +bedGraphToBigWig converts a `bedGraph <https://genome.ucsc.edu/goldenpath/help/bedgraph.html>`_ file +to the `bigWig format <https://genome.ucsc.edu/goldenpath/help/bigWig.html>`_. + +---- + +**The bedGraph format** + +The first three columns of the bedGraph file are the same as the +`BED format <https://genome.ucsc.edu/FAQ/FAQformat.html#format1>`_, and it uses +a `zero-start, half-open <http://genome.ucsc.edu/blog/the-ucsc-genome-browser-coordinate-counting-systems/>`_ +coordinate system. The fourth column of the bedGraph file contains the data values:: + + chromA chromStartA chromEndA dataValueA + chromB chromStartB chromEndB dataValueB + +---- + +.. class:: infomark + +**Chromosomes sizes file** + +This tool requires a chromosomes sizes (``chrom.sizes``) file, which lists the size of +each scaffold within an assembly. For genome assemblies that are hosted by UCSC, +the ``chrom.sizes`` file is available through the +`Sequence and Annotation Downloads <http://hgdownload.cse.ucsc.edu/downloads.html>`_ page. +The `twoBitInfo <https://genome.ucsc.edu/goldenpath/help/twoBit.html>`_ tool +can be used to generate the ``chrom.sizes`` for the genome assemblies that are not hosted +by UCSC. + + ]]></help> + + <expand macro="citations" /> +</tool>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/contigs.bedgraph Wed May 17 16:28:29 2017 -0400 @@ -0,0 +1,51 @@ +track name="bedGraph" description="bedGraph" +contig10 0 173 0 +contig10 173 188 1 +contig10 188 206 2 +contig10 206 208 1 +contig10 208 221 2 +contig10 221 223 1 +contig10 223 248 2 +contig10 248 275 3 +contig10 275 279 2 +contig10 279 281 1 +contig10 281 286 2 +contig10 286 290 3 +contig10 290 350 2 +contig10 350 366 1 +contig10 1002 1008 8 +contig10 1008 1009 7 +contig10 1009 1010 8 +contig10 1010 1028 9 +contig10 1028 1032 10 +contig10 1032 1040 9 +contig10 1040 1041 7 +contig10 1041 1042 8 +contig10 1042 1059 10 +contig10 1059 1074 9 +contig10 1074 1075 4 +contig10 1075 1078 3 +contig10 1078 1082 2 +contig10 1082 1095 3 +contig10 1095 1102 2 +contig10 1102 1131 1 +contig10 4843 4846 4 +contig10 4846 4855 5 +contig10 4855 4856 6 +contig10 4856 4858 7 +contig10 4858 4863 8 +contig10 4863 4864 9 +contig12 40351 40352 149 +contig12 40352 40353 151 +contig12 40353 40354 153 +contig12 40354 40355 155 +contig12 40355 40356 156 +contig12 40356 40357 160 +contig12 40357 40358 163 +contig12 40358 40359 169 +contig12 40359 40360 175 +contig12 40360 40361 176 +contig12 54693 54694 8 +contig12 54694 54985 0 +contig12 54985 55008 1 +contig12 55008 55085 2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/contigs.clip.bedgraph Wed May 17 16:28:29 2017 -0400 @@ -0,0 +1,53 @@ +track name="bedGraph" description="bedGraph" +contig10 0 173 0 +contig10 173 188 1 +contig10 188 206 2 +contig10 206 208 1 +contig10 208 221 2 +contig10 221 223 1 +contig10 223 248 2 +contig10 248 275 3 +contig10 275 279 2 +contig10 279 281 1 +contig10 281 286 2 +contig10 286 290 3 +contig10 290 350 2 +contig10 350 366 1 +contig10 1002 1008 8 +contig10 1008 1009 7 +contig10 1009 1010 8 +contig10 1010 1028 9 +contig10 1028 1032 10 +contig10 1032 1040 9 +contig10 1040 1041 7 +contig10 1041 1042 8 +contig10 1042 1059 10 +contig10 1059 1074 9 +contig10 1074 1075 4 +contig10 1075 1078 3 +contig10 1078 1082 2 +contig10 1082 1095 3 +contig10 1095 1102 2 +contig10 1102 1131 1 +contig10 4843 4846 4 +contig10 4846 4855 5 +contig10 4855 4856 6 +contig10 4856 4858 7 +contig10 4858 4863 8 +contig10 4863 4864 9 +contig10 43000 43200 10 +contig12 40351 40352 149 +contig12 40352 40353 151 +contig12 40353 40354 153 +contig12 40354 40355 155 +contig12 40355 40356 156 +contig12 40356 40357 160 +contig12 40357 40358 163 +contig12 40358 40359 169 +contig12 40359 40360 175 +contig12 40360 40361 176 +contig12 54693 54694 8 +contig12 54694 54985 0 +contig12 54985 55008 1 +contig12 55008 55085 2 +contig12 56000 56100 2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/contigs_chromInfo.tab Wed May 17 16:28:29 2017 -0400 @@ -0,0 +1,2 @@ +contig10 43013 +contig12 56019
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_dependencies.xml Wed May 17 16:28:29 2017 -0400 @@ -0,0 +1,9 @@ +<?xml version="1.0"?> +<tool_dependency> + <package name="ucsc_bigwig" version="340"> + <repository changeset_revision="06411298fa7d" name="package_ucsc_bigwig_340" owner="yating-l" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + </package> + <package name="ucsc_bigbed" version="340"> + <repository changeset_revision="dd9b230c079d" name="package_ucsc_bigbed_340" owner="yating-l" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + </package> +</tool_dependency>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ucsc_macros.xml Wed May 17 16:28:29 2017 -0400 @@ -0,0 +1,44 @@ +<macros> + <xml name="requirements_twobit"> + <requirements> + <requirement type="package" version="340">ucsc_twobit</requirement> + <yield /> + </requirements> + </xml> + <xml name="environment_LC_COLLATE"> + <environment_variables> + <!-- Sort uppercase letters before lowercase (required by UCSC tools) --> + <environment_variable name="LC_COLLATE">C</environment_variable> + <yield /> + </environment_variables> + </xml> + <xml name="citations"> + <citations> + <citation type="bibtex"> + @article{Kent01062002, +author = {Kent, W. James and Sugnet, Charles W. and Furey, Terrence S. and Roskin, Krishna M. and Pringle, Tom H. and Zahler, Alan M. and Haussler, and David}, +title = {The Human Genome Browser at UCSC}, +volume = {12}, +number = {6}, +pages = {996-1006}, +year = {2002}, +doi = {10.1101/gr.229102}, +URL = {http://genome.cshlp.org/content/12/6/996.abstract}, +eprint = {http://genome.cshlp.org/content/12/6/996.full.pdf+html}, +journal = {Genome Research} +} + </citation> + <yield /> + </citations> + </xml> + + <token name="@OPTIONAL_PARAM_FUNC@"> +<![CDATA[ + #def optional_param($_flag, $_flag_value, $_sep="=") + #if str($_flag_value) and str($_flag_value).strip(): + ${_flag}${_sep}${_flag_value} + #end if + #end def +]]> + </token> +</macros>