changeset 1:5da9a0e2fb2d draft

"planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/velvet commit 8301d37348be25a038b3c63b049b1178d05f5003"
author devteam
date Wed, 12 Feb 2020 11:16:32 -0500
parents 08256557922f
children 8d09f8be269e
files tool_dependencies.xml velvetg.xml velvetg_wrapper.py velveth.xml velveth_wrapper.py
diffstat 5 files changed, 185 insertions(+), 223 deletions(-) [+]
line wrap: on
line diff
--- a/tool_dependencies.xml	Tue Oct 13 16:38:28 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<tool_dependency>
-    <package name="velvet" version="1.2.10">
-      <repository changeset_revision="93d32326537b" name="package_velvet_1_2_10" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
-    </package>
-</tool_dependency>
--- a/velvetg.xml	Tue Oct 13 16:38:28 2015 -0400
+++ b/velvetg.xml	Wed Feb 12 11:16:32 2020 -0500
@@ -1,76 +1,79 @@
-<tool id="velvetg" name="velvetg" version="@WRAPPER_VERSION@.0">
+<tool id="velvetg" name="velvetg" version="@WRAPPER_VERSION@.1">
   <description>Velvet sequence assembler for very short reads</description>
-  <version_command>velvetg 2&gt;&amp;1 | grep "Version" | sed -e 's/Version //'</version_command>
   <macros>
     <import>macros.xml</import>
   </macros>
   <expand macro="requirements"/>
   <expand macro="stdio"/>
-  <command interpreter="python">
-    velvetg_wrapper.py
-           '$input.extra_files_path'
-           #if $generate_amos.afg  == "yes":
-               -amos_file $generate_amos.afg
-           #end if
-           #if $unused_reads.generate_unused  == "yes":
-               -unused_reads $unused_reads.generate_unused
-           #end if
-           $read_trkg
-           #if $coverage.cutoff == "auto":
-               -cov_cutoff auto
-           #elif $coverage.cutoff == "value":
-               -cov_cutoff $coverage.cov_cutoff
-           #end if
-           #if $expected.coverage == "auto":
-               -exp_cov auto
-           #elif $expected.coverage == "value":
-               -exp_cov $expected.exp_cov
-           #end if
-           #if $contig_lgth.use_contig_lgth == "yes":
-               -min_contig_lgth $contig_lgth.min_contig_lgth
-           #end if
-           #if $reads.paired == "yes":
-               #if int($reads.ins_length) > 0:
-                   -ins_length $reads.ins_length
-               #end if
-               #if $reads.options.advanced == "yes":
-                   #if int($reads.options.ins_length_sd) > 0:
-                       -ins_length_sd $reads.options.ins_length_sd
-                   #end if
-                   #if int($reads.options.ins_length2) > 0:
-                       -ins_length2 $reads.options.ins_length2
-                   #end if
-                   #if int($reads.options.ins_length2_sd) > 0:
-                       -ins_length2_sd $reads.options.ins_length2_sd
-                   #end if
-                   #if int($reads.options.ins_length_long) > 0:
-                       -ins_length_long $reads.options.ins_length_long
-                   #end if
-                   #if int($reads.options.ins_length_long_sd) > 0:
-                       -ins_length_long_sd $reads.options.ins_length_long_sd
-                   #end if
-                   #if int($reads.options.max_branch_length) > 0:
-                       -max_branch_length $reads.options.max_branch_length
-                   #end if
-                   #if int($reads.options.max_divergence) > 0:
-                       -max_divergence $reads.options.max_divergence
-                   #end if
-                   #if int($reads.options.max_gap_count) > 0:
-                       -max_gap_count $reads.options.max_gap_count
-                   #end if
-                   #if int($reads.options.min_pair_count) > 0:
-                       -min_pair_count $reads.options.min_pair_count
-                   #end if
-                   #if int($reads.options.max_coverage) > 0:
-                       -max_coverage $reads.options.max_coverage
-                   #end if
-                   #if int($reads.options.long_mult_cutoff) > 0:
-                       -long_mult_cutoff $reads.options.long_mult_cutoff
-                   #end if
-                   $reads.options.scaffolding
-               #end if
-           #end if
-  </command>
+  <version_command><![CDATA[
+    velvetg 2>&1 | grep "Version" | sed -e 's/Version //'
+  ]]></version_command>
+  <command><![CDATA[
+ln -s '$input.extra_files_path'/Roadmaps &&
+ln -s '$input.extra_files_path'/Sequences &&
+velvetg .
+#if $generate_amos.afg  == "yes":
+    -amos_file $generate_amos.afg
+#end if
+#if $unused_reads.generate_unused  == "yes":
+    -unused_reads $unused_reads.generate_unused
+#end if
+$read_trkg
+#if $coverage.cutoff == "auto":
+    -cov_cutoff auto
+#elif $coverage.cutoff == "value":
+    -cov_cutoff $coverage.cov_cutoff
+#end if
+#if $expected.coverage == "auto":
+    -exp_cov auto
+#elif $expected.coverage == "value":
+    -exp_cov $expected.exp_cov
+#end if
+#if $contig_lgth.use_contig_lgth == "yes":
+    -min_contig_lgth $contig_lgth.min_contig_lgth
+#end if
+#if $reads.paired == "yes":
+    #if int($reads.ins_length) > 0:
+        -ins_length $reads.ins_length
+    #end if
+    #if $reads.options.advanced == "yes":
+        #if int($reads.options.ins_length_sd) > 0:
+            -ins_length_sd $reads.options.ins_length_sd
+        #end if
+        #if int($reads.options.ins_length2) > 0:
+            -ins_length2 $reads.options.ins_length2
+        #end if
+        #if int($reads.options.ins_length2_sd) > 0:
+            -ins_length2_sd $reads.options.ins_length2_sd
+        #end if
+        #if int($reads.options.ins_length_long) > 0:
+            -ins_length_long $reads.options.ins_length_long
+        #end if
+        #if int($reads.options.ins_length_long_sd) > 0:
+            -ins_length_long_sd $reads.options.ins_length_long_sd
+        #end if
+        #if int($reads.options.max_branch_length) > 0:
+            -max_branch_length $reads.options.max_branch_length
+        #end if
+        #if int($reads.options.max_divergence) > 0:
+            -max_divergence $reads.options.max_divergence
+        #end if
+        #if int($reads.options.max_gap_count) > 0:
+            -max_gap_count $reads.options.max_gap_count
+        #end if
+        #if int($reads.options.min_pair_count) > 0:
+            -min_pair_count $reads.options.min_pair_count
+        #end if
+        #if int($reads.options.max_coverage) > 0:
+            -max_coverage $reads.options.max_coverage
+        #end if
+        #if int($reads.options.long_mult_cutoff) > 0:
+            -long_mult_cutoff $reads.options.long_mult_cutoff
+        #end if
+        $reads.options.scaffolding
+    #end if
+#end if
+  ]]></command>
   <inputs>
     <param name="input" type="data" format="velvet" label="Velvet Dataset" help="Prepared by velveth."/>
     <conditional name="generate_amos">
@@ -142,7 +145,7 @@
     <conditional name="reads">
       <param name="paired" type="select" label="Using Paired Reads">
         <option value="no">No</option>
-        <option value="yes" selected="${input.metadata.paired_end_reads}">Yes</option>
+        <option value="yes">Yes</option>
       </param>
       <when value="no"/>
       <when value="yes">
@@ -188,15 +191,12 @@
     <data format="tabular" name="stats" label="${tool.name} on ${on_string}: Stats" from_work_dir="stats.txt" />
     <data format="fasta" name="contigs" label="${tool.name} on ${on_string}: Contigs" from_work_dir="contigs.fa" />
   </outputs>
-  <requirements>
-    <requirement type="package">velvet</requirement>
-  </requirements>
   <tests>
     <test>
-      <param name="input" value="velveth_test1/output.html" ftype="velvet" >
-        <composite_data value='velveth_test1/Sequences' ftype="Sequences"/>
-        <composite_data value='velveth_test1/Roadmaps' ftype="Roadmaps"/>
-        <composite_data value='velveth_test1/Log'/>
+      <param name="input" value="velveth_test1/output.html" ftype="velvet">
+        <composite_data value="velveth_test1/Sequences" />
+        <composite_data value="velveth_test1/Roadmaps" />
+        <composite_data value="velveth_test1/Log"/>
       </param>
       <param name="afg" value="yes" />
       <param name="generate_unused" value="yes" />
@@ -207,15 +207,15 @@
       <param name="use_contig_lgth" value="no" />
       <param name="paired" value="no" />
       <!--
-      <output name="LastGraph" file="velvetg_test1/lastgraph.txt" compare="diff"/>
+      <output name="LastGraph" file="velvetg_test1/lastgraph.txt"/>
       -->
-      <output name="velvet_asm" file="velvetg_test1/amos.afg" compare="diff"/>
-      <output name="unused_reads_fasta" file="velvetg_test1/unusedreads.fa" compare="diff"/>
-      <output name="stats" file="velvetg_test1/stats.csv" compare="diff"/>
-      <output name="contigs" file="velvetg_test1/contigs.fa" compare="diff"/>
+      <output name="velvet_asm" file="velvetg_test1/amos.afg" />
+      <output name="unused_reads_fasta" file="velvetg_test1/unusedreads.fa" />
+      <output name="stats" file="velvetg_test1/stats.csv" />
+      <output name="contigs" file="velvetg_test1/contigs.fa" />
     </test>
   </tests>
-  <help>
+  <help><![CDATA[
 **What it does**
 
 Velvet_ is a de novo genomic assembler specially designed for short read sequencing technologies, such as Solexa or 454, developed by Daniel Zerbino and Ewan Birney at the European Bioinformatics Institute (EMBL-EBI), near Cambridge, in the United Kingdom.
@@ -302,6 +302,6 @@
         directory/LastGraph              : special formatted file with all the information on the final graph
         directory/velvet_asm.afg         : (if requested) AMOS compatible assembly file
 
-  </help>
+  ]]></help>
   <expand macro="citation"/>
 </tool>
--- a/velvetg_wrapper.py	Tue Oct 13 16:38:28 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-#!/usr/bin/env python
-
-"""
-Classes encapsulating decypher tool.
-James E Johnson - University of Minnesota
-"""
-import os
-import sys
-import subprocess
-
-assert sys.version_info[:2] >= ( 2, 4 )
-
-def stop_err( msg ):
-    sys.stderr.write( "%s\n" % msg )
-    sys.exit()
-
-
-def __main__():
-    #Parse Command Line
-    working_dir = sys.argv[1]
-    inputs = ' '.join(sys.argv[2:])
-    for _ in ('Roadmaps', 'Sequences'):
-        os.symlink(os.path.join(working_dir, _), _)
-    cmdline = 'velvetg . %s' % (inputs)
-    print "Command to be executed: %s" % cmdline
-    try:
-        proc = subprocess.Popen( args=cmdline, shell=True, stderr=subprocess.PIPE )
-        returncode = proc.wait()
-        # get stderr, allowing for case where it's very large
-        stderr = ''
-        buffsize = 1048576
-        try:
-            while True:
-                stderr += proc.stderr.read( buffsize )
-                if not stderr or len( stderr ) % buffsize != 0:
-                    break
-        except OverflowError:
-            pass
-        if returncode != 0:
-            raise Exception, stderr
-    except Exception, e:
-        stop_err( 'Error running velvetg ' + str( e ) )
-
-
-if __name__ == "__main__":
-    __main__()
--- a/velveth.xml	Tue Oct 13 16:38:28 2015 -0400
+++ b/velveth.xml	Wed Feb 12 11:16:32 2020 -0500
@@ -1,24 +1,27 @@
-<tool id="velveth" name="velveth" version="@WRAPPER_VERSION@.0">
+<tool id="velveth" name="velveth" version="@WRAPPER_VERSION@.1">
   <description>Prepare a dataset for the Velvet velvetg Assembler</description>
-  <version_command>velveth 2&gt;&amp;1 | grep "Version" | sed -e 's/Version //'</version_command>
   <macros>
     <import>macros.xml</import>
   </macros>
   <expand macro="requirements"/>
   <expand macro="stdio"/>
-  <command interpreter="python">
-    velveth_wrapper.py
-           '$out_file1' '$out_file1.extra_files_path'
-           $hash_length
-           $strand_specific
-           #for $i in $inputs
-                ${i.file_format}
-                ${i.read_type}
-                ${i.input}
-           #end for
-  </command>
+  <version_command><![CDATA[
+    velveth 2>&1 | grep "Version" | sed -e 's/Version //'
+  ]]></version_command>
+  <command><![CDATA[
+mkdir -p '${out_file1.extra_files_path}' &&
+velveth
+'${out_file1.extra_files_path}'
+$hash_length
+$strand_specific
+#for $i in $inputs
+    ${i.file_format}
+    ${i.read_type}
+    '${i.input}'
+#end for
+  ]]></command>
   <inputs>
-    <param label="Hash Length" name="hash_length" type="select" help="k-mer length in base pairs of the words being hashed.">
+    <param name="hash_length" type="select" label="Hash length" help="k-mer length in base pairs of the words being hashed">
       <option value="11">11</option>
       <option value="13">13</option>
       <option value="15">15</option>
@@ -29,6 +32,87 @@
       <option value="25">25</option>
       <option value="27">27</option>
       <option value="29">29</option>
+      <option value="31">31</option>
+      <option value="33">33</option>
+      <option value="35">35</option>
+      <option value="37">37</option>
+      <option value="39">39</option>
+      <option value="41">41</option>
+      <option value="43">43</option>
+      <option value="45">45</option>
+      <option value="47">47</option>
+      <option value="49">49</option>
+      <option value="51">51</option>
+      <option value="53">53</option>
+      <option value="55">55</option>
+      <option value="57">57</option>
+      <option value="59">59</option>
+      <option value="61">61</option>
+      <option value="63">63</option>
+      <option value="65">65</option>
+      <option value="67">67</option>
+      <option value="69">69</option>
+      <option value="71">71</option>
+      <option value="73">73</option>
+      <option value="75">75</option>
+      <option value="77">77</option>
+      <option value="79">79</option>
+      <option value="81">81</option>
+      <option value="83">83</option>
+      <option value="85">85</option>
+      <option value="87">87</option>
+      <option value="89">89</option>
+      <option value="91">91</option>
+      <option value="93">93</option>
+      <option value="95">95</option>
+      <option value="97">97</option>
+      <option value="99">99</option>
+      <option value="101">101</option>
+      <option value="103">103</option>
+      <option value="105">105</option>
+      <option value="107">107</option>
+      <option value="109">109</option>
+      <option value="111">111</option>
+      <option value="113">113</option>
+      <option value="115">115</option>
+      <option value="117">117</option>
+      <option value="119">119</option>
+      <option value="121">121</option>
+      <option value="123">123</option>
+      <option value="125">125</option>
+      <option value="127">127</option>
+      <option value="129">129</option>
+      <option value="131">131</option>
+      <option value="133">133</option>
+      <option value="135">135</option>
+      <option value="137">137</option>
+      <option value="139">139</option>
+      <option value="141">141</option>
+      <option value="143">143</option>
+      <option value="145">145</option>
+      <option value="147">147</option>
+      <option value="149">149</option>
+      <option value="151">151</option>
+      <option value="153">153</option>
+      <option value="155">155</option>
+      <option value="157">157</option>
+      <option value="159">159</option>
+      <option value="161">161</option>
+      <option value="163">163</option>
+      <option value="165">165</option>
+      <option value="167">167</option>
+      <option value="169">169</option>
+      <option value="171">171</option>
+      <option value="173">173</option>
+      <option value="175">175</option>
+      <option value="177">177</option>
+      <option value="179">179</option>
+      <option value="181">181</option>
+      <option value="183">183</option>
+      <option value="185">185</option>
+      <option value="187">187</option>
+      <option value="189">189</option>
+      <option value="191">191</option>
     </param>
     <param name="strand_specific" type="boolean" checked="false" truevalue="-strand_specific" falsevalue="" label="Use strand specific transcriptome sequencing" help="If you are using a strand specific transcriptome sequencing protocol, you may wish to use this option for better results."/>
     <repeat name="inputs" title="Input Files">
@@ -51,11 +135,8 @@
     </repeat>
   </inputs>
   <outputs>
-    <data format="velvet" name="out_file1" />
+    <data name="out_file1" format="velvet" />
   </outputs>
-  <requirements>
-    <requirement type="package">velvet</requirement>
-  </requirements>
   <tests>
     <test>
       <param name="hash_length" value="21" />
@@ -67,13 +148,12 @@
       <!-- </repeat> -->
       <param name="strand_specific" value="" />
       <output name="out_file1" file="velveth_test1/output.html" lines_diff="4">
-        <extra_files type="file" name='Sequences' value="velveth_test1/Sequences" compare="diff" />
-        <extra_files type="file" name='Roadmaps' value="velveth_test1/Roadmaps" compare="diff" />
+        <extra_files type="file" name="Sequences" value="velveth_test1/Sequences" />
+        <extra_files type="file" name="Roadmaps" value="velveth_test1/Roadmaps" />
       </output>
     </test>
   </tests>
-  <help>
-
+  <help><![CDATA[
 **What it does**
 
 Velvet_ is a de novo genomic assembler specially designed for short read sequencing technologies, such as Solexa or 454, developed by Daniel Zerbino and Ewan Birney at the European Bioinformatics Institute (EMBL-EBI), near Cambridge, in the United Kingdom.
@@ -130,7 +210,6 @@
   shortPaired2 (see above)
   long (for Sanger, 454 or even reference sequences)
   longPaired
-
-  </help>
+  ]]></help>
   <expand macro="citation"/>
 </tool>
--- a/velveth_wrapper.py	Tue Oct 13 16:38:28 2015 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-#!/usr/bin/env python
-
-"""
-Classes encapsulating decypher tool.
-James E Johnson - University of Minnesota
-"""
-import pkg_resources
-import logging, os, string, sys, tempfile, glob, shutil, types, urllib
-import shlex, subprocess
-from optparse import OptionParser, OptionGroup
-from stat import *
-
-
-log = logging.getLogger( __name__ )
-
-assert sys.version_info[:2] >= ( 2, 4 )
-
-def stop_err( msg ):
-    sys.stderr.write( "%s\n" % msg )
-    sys.exit()
-
-def __main__():
-    #Parse Command Line
-    s = 'velveth_wrapper.py:  argv = %s\n' % (sys.argv)
-    argcnt = len(sys.argv)
-    html_file = sys.argv[1]
-    working_dir = sys.argv[2]
-    try: # for test - needs this done
-        os.makedirs(working_dir)
-    except Exception, e:
-        stop_err( 'Error running velveth ' + str( e ) )
-    hash_length = sys.argv[3]
-    inputs = string.join(sys.argv[4:],' ')
-    cmdline = 'velveth %s %s %s > /dev/null' % (working_dir, hash_length, inputs)
-    try:
-        proc = subprocess.Popen( args=cmdline, shell=True, stderr=subprocess.PIPE )
-        returncode = proc.wait()
-        # get stderr, allowing for case where it's very large
-        stderr = ''
-        buffsize = 1048576
-        try:
-            while True:
-                stderr += proc.stderr.read( buffsize )
-                if not stderr or len( stderr ) % buffsize != 0:
-                    break
-        except OverflowError:
-            pass
-        if returncode != 0:
-            raise Exception, stderr
-    except Exception, e:
-        stop_err( 'Error running velveth ' + str( e ) )
-    sequences_path = os.path.join(working_dir,'Sequences')
-    roadmaps_path = os.path.join(working_dir,'Roadmaps')
-    rval = ['<html><head><title>Velvet Galaxy Composite Dataset </title></head><p/>']
-    rval.append('<div>%s<p/></div>' % (cmdline) )
-    rval.append('<div>This composite dataset is composed of the following files:<p/><ul>')
-    rval.append( '<li><a href="%s" type="text/plain">%s </a>%s</li>' % (sequences_path,'Sequences','Sequences' ) )
-    rval.append( '<li><a href="%s" type="text/plain">%s </a>%s</li>' % (roadmaps_path,'Roadmaps','Roadmaps' ) )
-    rval.append( '</ul></div></html>' )
-    f = file(html_file,'w')
-    f.write("\n".join( rval ))
-    f.write('\n')
-    f.close()
-
-if __name__ == "__main__": __main__()