changeset 0:a2f83a375bf2 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/wigtobigwig commit ab36a3ca5954067b66e6290b988a94919c111db0
author iuc
date Thu, 18 Jan 2024 19:45:00 +0000
parents
children 98704d357ede
files readme.rst test-data/1.bedgraph test-data/1.bigwig test-data/1.wig test-data/3.bigwig test-data/dbkeys.loc.test test-data/hg17.fa test-data/hg17.len test-data/merlin.bigwig test-data/merlin.len test-data/merlin.wig tool-data/dbkeys.loc.sample tool_data_table_conf.xml.sample tool_data_table_conf.xml.test wigtobigwig.xml
diffstat 14 files changed, 284 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/readme.rst	Thu Jan 18 19:45:00 2024 +0000
@@ -0,0 +1,33 @@
+wigtobigwig
+===========
+
+
+Derived from a built-in filter tool
+
+History
+=======
+
+- 1.1.2 Moved to IUC
+
+
+
+Wrapper License (MIT/BSD Style)
+===============================
+
+Permission to use, copy, modify, and distribute this software and its
+documentation with or without modifications and for any purpose and
+without fee is hereby granted, provided that any copyright notices
+appear in all copies and that both those copyright notices and this
+permission notice appear in supporting documentation, and that the names
+of the contributors or copyright holders not be used in advertising or
+publicity pertaining to distribution of the software without specific
+prior permission.
+
+THE CONTRIBUTORS AND COPYRIGHT HOLDERS OF THIS SOFTWARE DISCLAIM ALL
+WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE
+CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/1.bedgraph	Thu Jan 18 19:45:00 2024 +0000
@@ -0,0 +1,30 @@
+chr1	0	14361	0
+chr1	14361	14829	1
+chr1	14829	14969	0
+chr1	14969	15038	1
+chr1	15038	15795	0
+chr1	15795	15947	1
+chr1	15947	16606	0
+chr1	16606	16765	1
+chr1	16765	16857	0
+chr1	16857	17055	1
+chr1	17055	17232	0
+chr1	17232	17368	1
+chr1	17368	17605	0
+chr1	17605	17742	1
+chr1	17742	17914	0
+chr1	17914	18061	1
+chr1	18061	18267	0
+chr1	18267	18366	1
+chr1	18366	24737	0
+chr1	24737	24891	1
+chr1	24891	29320	0
+chr1	29320	29370	1
+chr1	29370	34610	0
+chr1	34610	35174	2
+chr1	35174	35276	0
+chr1	35276	35481	2
+chr1	35481	35720	0
+chr1	35720	36081	2
+chr1	36081	69090	0
+chr1	69090	69093	3
Binary file test-data/1.bigwig has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/1.wig	Thu Jan 18 19:45:00 2024 +0000
@@ -0,0 +1,3 @@
+track type=wiggle_0 name="tb_knownGene" description="table browser query on knownGene" visibility=3 url=
+chr7	127475	127491	1
+chr7	1274801	1294883	2
Binary file test-data/3.bigwig has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/dbkeys.loc.test	Thu Jan 18 19:45:00 2024 +0000
@@ -0,0 +1,3 @@
+#<dbkey>	<display_name>	<len_file_path>
+hg17	hg17	${__HERE__}/hg17.len
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/hg17.len	Thu Jan 18 19:45:00 2024 +0000
@@ -0,0 +1,25 @@
+dummy_chr	100000000
+super_1	100000000
+chr1	100000000
+chr7	200000000
+chrX	200000000
+phiX174	100000000
+random_phiX_region_1	100000000
+random_phiX_region_2	100000000
+random_phiX_region_3	100000000
+random_phiX_region_4	100000000
+random_phiX_region_5	100000000
+random_phiX_region_6	100000000
+random_phiX_region_7	100000000
+random_phiX_region_8	100000000
+random_phiX_region_9	100000000
+random_phiX_region_10	100000000
+random_phiX_region_11	100000000
+random_phiX_region_12	100000000
+random_phiX_region_13	100000000
+random_phiX_region_14	100000000
+random_phiX_region_15	100000000
+random_phiX_region_16	100000000
+random_phiX_region_17	100000000
+random_phiX_region_18	100000000
+random_phiX_region_19	100000000
Binary file test-data/merlin.bigwig has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/merlin.len	Thu Jan 18 19:45:00 2024 +0000
@@ -0,0 +1,1 @@
+Merlin	172788
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/merlin.wig	Thu Jan 18 19:45:00 2024 +0000
@@ -0,0 +1,2 @@
+Merlin	49	1452	1
+Merlin	1457	3630	1 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/dbkeys.loc.sample	Thu Jan 18 19:45:00 2024 +0000
@@ -0,0 +1,1 @@
+#<dbkey>		<display_name>	<len_file_path>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_data_table_conf.xml.sample	Thu Jan 18 19:45:00 2024 +0000
@@ -0,0 +1,7 @@
+<tables>
+    <!-- Locations of dbkeys and len files under genome directory -->
+    <table name="__dbkeys__" comment_char="#">
+        <columns>value, name, len_path</columns>
+        <file path="tool-data/dbkeys.loc" />
+    </table>
+</tables>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_data_table_conf.xml.test	Thu Jan 18 19:45:00 2024 +0000
@@ -0,0 +1,8 @@
+<tables>
+    <!-- Locations of dbkeys and len files under genome directory -->
+    <table name="__dbkeys__" comment_char="#" allow_duplicate_entries="False">
+        <columns>value, name, len_path</columns>
+        <file path="${__HERE__}/test-data/dbkeys.loc.test" />
+    </table>
+</tables>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wigtobigwig.xml	Thu Jan 18 19:45:00 2024 +0000
@@ -0,0 +1,171 @@
+<tool id="ucsc_wigtobigwig" name="wigtobigwig" version="@TOOL_VERSION@+galaxy0" profile="22.05">
+    <description>bedGraph or Wig to bigWig converter</description>
+    <macros>
+        <token name="@TOOL_VERSION@">447</token>
+    </macros>
+    <xrefs>
+        <xref type="bio.tools">UCSC_Genome_Browser_Utilities</xref>
+    </xrefs>
+    <requirements>
+        <requirement type="package" version="@TOOL_VERSION@">ucsc-wigtobigwig</requirement>
+    </requirements>
+    <stdio>
+        <!-- Anything other than zero is an error -->
+        <regex match="needLargeMem: trying to allocate 0 bytes" description="Your input file might be empty or wrongly formatted"/>
+        <regex match="^Error"/>
+    </stdio>
+    <command><![CDATA[
+        grep -v "^track" '$input1' > trackless &&
+        wigToBigWig trackless
+        #if $hist_or_builtin.genome_type_select == "indexed":
+            '$hist_or_builtin.index.fields.len_path'
+        #else
+            '$chromfile'
+        #end if
+        '$out_file1'
+        #if $settings.settingsType == "full":
+              -blockSize=${settings.blockSize}
+              -itemsPerSlot=${settings.itemsPerSlot}
+              ${settings.clip}
+              ${settings.unc}
+        #else:
+              -clip
+        #end if
+    ]]>
+    </command>
+    <inputs>
+        <conditional name="hist_or_builtin">
+            <param name="genome_type_select" type="select" label="Reference genome source" help="Was the Wig/bedgraph input constructed using a genome from your history, or a built-in genome?">
+                <option selected="True" value="indexed">Input data is for a built-in genome</option>
+                <option value="history">Input data is for a genome from the current history</option>
+            </param>
+            <when value="indexed">
+                <param name="input1" type="data" format="wig,bedgraph" label="Wig/Bedgraph to convert">
+                    <validator type="unspecified_build"/>
+                </param>
+                <param name="index" type="select" label="Source Genome Build">
+                    <options from_data_table="__dbkeys__">
+                        <filter type="data_meta" column="0" key="dbkey" ref="input1"/>
+                    </options>
+                    <validator type="no_options" message="The chosen genome build is not available."/>
+                </param>
+            </when>
+            <when value="history">
+                <param name="input1" type="data" format="wig,bedgraph" label="Wig/Bedgraph to convert"/>
+                <param name="chromfile" type="data" format="len,txt,tabular" label="Chromosome length file" help="A file of sequence lengths for the history reference is required to make a bigwig. Compute sequence length tool can make these from fasta files"/>
+            </when>
+        </conditional>
+        <conditional name="settings">
+            <param name="settingsType" type="select" label="Converter settings to use" help="Default settings should usually be used.">
+                <option value="preset">Default</option>
+                <option value="full">Full parameter list</option>
+            </param>
+            <when value="preset"/>
+            <when value="full">
+                <param argument="-blockSize" type="integer" value="256" label="Items to bundle in r-tree" />
+                <param argument="-itemsPerSlot" type="integer" value="1024" label="Data points bundled at lowest level"/>
+                <param argument="-clip" type="boolean" truevalue="-clip" falsevalue="" checked="True" label="Clip chromosome positions" help="Issue warning messages rather than dying if wig file contains items off end of chromosome."/>
+                <param argument="-unc" type="boolean" truevalue="-unc" falsevalue="" checked="False" label="Do not use compression"/>
+            </when>
+        </conditional>
+    </inputs>
+    <outputs>
+        <data name="out_file1" format="bigwig"/>
+    </outputs>
+    <tests>
+        <test expect_num_outputs="1">
+            <conditional name="hist_or_builtin">
+                <param name="genome_type_select" value="history"/>
+                <param name="input1" value="1.wig"/>
+                <param name="chromfile" value="hg17.len" ftype="len"/>
+            </conditional>
+            <conditional name="settings">
+                <param name="settingsType" value="full"/>
+                <param name="blockSize" value="256"/>
+                <param name="itemsPerSlot" value="1024"/>
+                <param name="clip" value="True"/>
+                <param name="unc" value="False"/>
+            </conditional>
+            <output name="out_file1" file="1.bigwig" compare="sim_size"/>
+        </test>
+        <!-- location file test -->
+        <test expect_num_outputs="1">
+            <conditional name="hist_or_builtin">
+                <param name="genome_type_select" value="indexed"/>
+                <param name="input1" value="1.wig" dbkey="hg17" />
+                <param name="index" value="hg17" />
+            </conditional>
+            <conditional name="settings">
+                <param name="settingsType" value="preset"/>
+            </conditional>
+            <output name="out_file1" file="1.bigwig" compare="sim_size"/>
+        </test>
+        <test expect_num_outputs="1">
+            <conditional name="hist_or_builtin">
+                <param name="input1" value="1.wig"/>
+                <param name="genome_type_select" value="history"/>
+                <param name="chromfile" value="hg17.len" ftype="len"/>
+            </conditional>
+            <conditional name="settings">
+                <param name="settingsType" value="preset"/>
+            </conditional>
+            <output name="out_file1" file="1.bigwig" compare="sim_size"/>
+        </test>
+        <test expect_num_outputs="1">
+            <conditional name="hist_or_builtin">
+                <param name="input1" value="1.bedgraph" ftype="bedgraph"/>
+                <param name="genome_type_select" value="history"/>
+                <param name="chromfile" value="hg17.len" ftype="len"/>
+            </conditional>
+            <conditional name="settings">
+                <param name="settingsType" value="preset"/>
+            </conditional>
+            <output name="out_file1" file="3.bigwig" compare="sim_size"/>
+        </test>
+        <test expect_num_outputs="1">
+            <conditional name="hist_or_builtin">
+                <param name="input1" value="merlin.wig" ftype="bedgraph"/>
+                <param name="genome_type_select" value="history"/>
+                <param name="chromfile" value="merlin.len" ftype="len"/>
+            </conditional>
+            <conditional name="settings">
+                <param name="settingsType" value="preset"/>
+            </conditional>
+            <output name="out_file1" file="merlin.bigwig" compare="sim_size"/>
+        </test>
+    </tests>
+    <help>
+**Purpose**
+
+This tool converts bedgraph or wiggle data into bigWig data for visualisation in browsers. The JBrowse tool can display these with other interesting tracks.
+
+**Technical format details**
+
+- **Wiggle format**: The .wig format is line-oriented. Wiggle data is preceded by a UCSC track definition line.  Following the track definition line is the track data, which can be entered in three different formats described below.
+
+  - **BED format** with no declaration line and four columns of data::
+
+      chromA  chromStartA  chromEndA  dataValueA
+      chromB  chromStartB  chromEndB  dataValueB
+
+  - **variableStep** two column data; started by a declaration line and followed with chromosome positions and data values::
+
+      variableStep  chrom=chrN  [span=windowSize]
+      chromStartA  dataValueA
+      chromStartB  dataValueB
+
+  - **fixedStep** single column data; started by a declaration line and followed with data values::
+
+      fixedStep  chrom=chrN  start=position  step=stepInterval  [span=windowSize]
+      dataValue1
+      dataValue2
+
+- The **BedGraph format** is described in detail at the `UCSC Bioinformatics website`_
+
+.. _UCSC Bioinformatics website: http://genome.ucsc.edu/goldenPath/help/bedgraph.html
+
+    </help>
+    <citations>
+        <citation type="doi">10.1093/bioinformatics/btq351</citation>
+    </citations>
+</tool>