changeset 0:408ba52ceab3 draft default tip

planemo upload
author yating-l
date Wed, 17 May 2017 16:51:19 -0400
parents
children
files test-data/contigs.advanced.bw test-data/contigs.bigWigCat.bw test-data/contigs.clip.bw test-data/contigs.clip.wig test-data/contigs.fixedStep.bw test-data/contigs.fixedStep.wig test-data/contigs.variableStep.bw test-data/contigs.variableStep.wig test-data/contigs_chromInfo.tab tool_dependencies.xml ucsc_macros.xml wig_to_bigwig.xml
diffstat 12 files changed, 277 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
Binary file test-data/contigs.advanced.bw has changed
Binary file test-data/contigs.bigWigCat.bw has changed
Binary file test-data/contigs.clip.bw has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/contigs.clip.wig	Wed May 17 16:51:19 2017 -0400
@@ -0,0 +1,20 @@
+track name="variableStep" description="variableStep wiggle" 
+variableStep chrom=contig10 span=150
+1	10.5
+201	20.5
+401	30.5
+601	40.5
+801	50.5
+1001	60.5
+43000	70.5
+variableStep chrom=contig12 span=150
+1001	10.5
+1201	20.5
+1401	30.5
+1601	40.5
+1801	50.5
+2001	60.5
+variableStep chrom=contig12 span=150
+55000	100.5
+56000	200.5
+
Binary file test-data/contigs.fixedStep.bw has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/contigs.fixedStep.wig	Wed May 17 16:51:19 2017 -0400
@@ -0,0 +1,15 @@
+track name="fixedStep" description="fixedStep wiggle" 
+fixedStep chrom=contig10 start=1 step=200 span=150
+10.5
+20.5
+30.5
+40.5
+50.5
+60.5
+fixedStep chrom=contig12 start=1001 step=200 span=150
+10.5
+20.5
+30.5
+40.5
+50.5
+60.5
Binary file test-data/contigs.variableStep.bw has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/contigs.variableStep.wig	Wed May 17 16:51:19 2017 -0400
@@ -0,0 +1,15 @@
+track name="variableStep" description="variableStep wiggle" 
+variableStep chrom=contig10 span=150
+1	10.5
+201	20.5
+401	30.5
+601	40.5
+801	50.5
+1001	60.5
+variableStep chrom=contig12 span=150
+1001	10.5
+1201	20.5
+1401	30.5
+1601	40.5
+1801	50.5
+2001	60.5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/contigs_chromInfo.tab	Wed May 17 16:51:19 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:51:19 2017 -0400
@@ -0,0 +1,6 @@
+<?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>
+</tool_dependency>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ucsc_macros.xml	Wed May 17 16:51:19 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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wig_to_bigwig.xml	Wed May 17 16:51:19 2017 -0400
@@ -0,0 +1,175 @@
+<?xml version="1.0"?>
+<tool id="wig_to_bigwig" name="wigToBigWig" version="1.0">
+    <description>Converts a wiggle file to bigWig format</description>
+
+    <macros>
+        <import>ucsc_macros.xml</import>
+    </macros>
+
+    <requirements>
+        <requirement type="package" version="340">ucsc_bigwig</requirement>
+    </requirements>
+
+    <command detect_errors="exit_code">
+<![CDATA[
+    @OPTIONAL_PARAM_FUNC@
+
+    wigToBigWig
+        ${clip}
+        ${adv.fixed_summaries}
+        ${adv.keep_all_chromosomes}
+        $optional_param("-blockSize", $adv.block_size)
+        $optional_param("-itemsPerSlot", $adv.items_per_slot)
+        ${adv.no_compression}
+        "${wig_input}" "${chrominfo_input}" "${bw_output}"
+]]>
+    </command>
+    <inputs>
+        <param name="wig_input" type="data" format="wig" label="Wiggle input file" />
+
+        <param name="chrominfo_input" type="data" format="tabular"
+                label="Chromosomes sizes file" />
+
+        <param name="clip" type="boolean" checked="false"
+                truevalue="-clip" falsevalue=""
+                label="Clip items that extend beyond the scaffolds"
+                help="-clip" />
+
+        <section name="adv" title="Advanced options" expanded="false">
+            <param name="fixed_summaries" type="boolean" checked="false"
+                    truevalue="-fixedSummaries" falsevalue=""
+                    label="Use a pre-defined sequence of summary levels"
+                    help="Calculate summaries based on the zoom levels of the Ensembl genome browser (-fixedSummaries)" />
+
+            <param name="keep_all_chromosomes" type="boolean" checked="false"
+                    truevalue="-keepAllChromosomes" falsevalue=""
+                    label="Store all scaffolds in b-tree"
+                    help="-keepAllChromosomes" />
+
+            <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 wigToBigWig with variableStep wiggle -->
+            <param name="wig_input" value="contigs.variableStep.wig" ftype="wig" />
+            <param name="chrominfo_input" value="contigs_chromInfo.tab" ftype="tabular" />
+            <output name="bw_output" file="contigs.variableStep.bw" />
+        </test>
+        <test>
+            <!-- Test wigToBigWig with fixedStep wiggle -->
+            <param name="wig_input" value="contigs.fixedStep.wig" ftype="wig" />
+            <param name="chrominfo_input" value="contigs_chromInfo.tab" ftype="tabular" />
+            <output name="bw_output" file="contigs.fixedStep.bw" />
+        </test>
+        <test>
+            <!-- Test wigToBigWig with items that extend beyond the scaffold length -->
+            <param name="wig_input" value="contigs.clip.wig" ftype="wig" />
+            <param name="chrominfo_input" value="contigs_chromInfo.tab" ftype="tabular" />
+            <param name="clip" value="-clip" />
+            <output name="bw_output" file="contigs.clip.bw" />
+        </test>
+        <test>
+            <!-- Test wigToBigWig with advanced options -->
+            <param name="wig_input" value="contigs.variableStep.wig" ftype="wig" />
+            <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.advanced.bw" />
+        </test>
+        <test>
+            <!-- Test wigToBigWig with bigWigCat compatibility options -->
+            <param name="wig_input" value="contigs.variableStep.wig" ftype="wig" />
+            <param name="chrominfo_input" value="contigs_chromInfo.tab" ftype="tabular" />
+            <param name="fixed_summaries" value="-fixedSummaries" />
+            <param name="keep_all_chromosomes" value="-keepAllChromosomes" />
+            <output name="bw_output" file="contigs.bigWigCat.bw" />
+        </test>
+    </tests>
+    <help>
+<![CDATA[
+**What it does**
+
+wigToBigWig converts a file in either the variableStep or fixedStep
+`wiggle formats <https://genome.ucsc.edu/goldenpath/help/wiggle.html>`_
+to the `bigWig format <https://genome.ucsc.edu/goldenpath/help/bigWig.html>`_.
+
+----
+
+**Two types of wiggle files**
+
+A wiggle file is composed of declaration lines and data lines. There are two
+formatting options for wiggle files:
+
+1. **variableStep format**
+   ::
+
+      variableStep chrom=chrN [span=windowSize]
+      chromStartA dataValue1
+      chromStartA dataValue2
+
+2. **fixedStep format**
+   ::
+
+      fixedStep chrom=chrN start=position step=stepInterval [span=windowSize]
+      dataValue1
+      dataValue2
+
+----
+
+.. class:: infomark
+
+**Coordinate system for the wiggle format**
+
+Unlike the BED and bedGraph formats, the coordinate system used by the
+wiggle format are `1-based, fully-closed`_. The start position for the
+first nucleotide of a sequence is at position 1. The end position for
+the last nucleotide of a sequence with length N is N.
+
+----
+
+.. class:: warningmark
+
+**Compatibility with bigWigCat**
+
+In order to merge multiple bigWig files into a single file using ``bigWigCat``,
+the bigWig files should be created using the ``-fixedSummaries`` and
+``-keepAllChromosomes`` options (available under "Advanced options").
+See the UCSC Genome Browser `Google Groups discussions`_ for details.
+
+----
+
+.. 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.
+
+.. _1-based, fully-closed: http://genome.ucsc.edu/blog/the-ucsc-genome-browser-coordinate-counting-systems/
+.. _Google Groups discussions: https://groups.google.com/a/soe.ucsc.edu/forum/#!searchin/genome/fixedSummaries/genome/n3As-4DRyLY/khp7HjaWIh8J
+
+    ]]></help>
+
+    <expand macro="citations" />
+</tool>