changeset 4:9d5beacae92b draft

Uploaded v0.0.13 which uses the recently added error handling. No longer bundles the hide_stderr.py script which is now redundant.
author peterjc
date Wed, 19 Sep 2012 13:08:31 -0400
parents 643338ac83c0
children 393a7a35383c
files tools/ncbi_blast_plus/hide_stderr.py tools/ncbi_blast_plus/ncbi_blast_plus.txt tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml tools/ncbi_blast_plus/ncbi_tblastx_wrapper.xml
diffstat 7 files changed, 37 insertions(+), 63 deletions(-) [+]
line wrap: on
line diff
--- a/tools/ncbi_blast_plus/hide_stderr.py	Thu Aug 23 09:00:40 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-"""A simple script to redirect stderr to stdout when the return code is zero.
-
-See https://bitbucket.org/galaxy/galaxy-central/issue/325/
-
-Currently Galaxy ignores the return code from command line tools (even if it
-is non-zero which by convention indicates an error) and treats any output on
-stderr as an error (even though by convention stderr is used for errors or
-warnings).
-
-This script runs the given command line, capturing all stdout and stderr in
-memory, and gets the return code. For a zero return code, any stderr (which
-should be warnings only) is added to the stdout. That way Galaxy believes
-everything is fine. For a non-zero return code, we output stdout as is, and
-any stderr, plus the return code to ensure there is some output on stderr.
-That way Galaxy treats this as an error.
-
-Once issue 325 is fixed, this script will not be needed.
-"""
-import sys
-import subprocess
-
-#Avoid using shell=True when we call subprocess to ensure if the Python
-#script is killed, so too is the BLAST process.
-try:
-    words = []
-    for w in sys.argv[1:]:
-       if " " in w:
-           words.append('"%s"' % w)
-       else:
-           words.append(w)
-    cmd = " ".join(words)
-    child = subprocess.Popen(sys.argv[1:],
-                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-except Exception, err:
-    sys.stderr.write("Error invoking command:\n%s\n\n%s\n" % (cmd, err))
-    sys.exit(1)
-#Use .communicate as can get deadlocks with .wait(),
-stdout, stderr = child.communicate()
-return_code = child.returncode
-
-if return_code:
-    sys.stdout.write(stdout)
-    sys.stderr.write(stderr)
-    sys.stderr.write("Return error code %i from command:\n" % return_code)
-    sys.stderr.write("%s\n" % cmd)
-else:
-    sys.stdout.write(stdout)
-    sys.stdout.write(stderr)
--- a/tools/ncbi_blast_plus/ncbi_blast_plus.txt	Thu Aug 23 09:00:40 2012 -0400
+++ b/tools/ncbi_blast_plus/ncbi_blast_plus.txt	Wed Sep 19 13:08:31 2012 -0400
@@ -8,9 +8,10 @@
 Currently tested with NCBI BLAST 2.2.26+ (i.e. version 2.2.26 of BLAST+),
 and do not work with the NCBI 'legacy' BLAST suite (e.g. blastall).
 
-Note that these wrappers were originally distributed as part of the main
-Galaxy repository, but as of August 2012 moved to the Galaxy Tool Shed.
-My thanks to Dannon Baker from the Galaxy development team for this assistance
+Note that these wrappers (and the associated datetypes) were originally
+distributed as part of the main Galaxy repository, but as of August 2012
+moved to the Galaxy Tool Shed as 'ncbi_blast_plus' (and 'blast_datatypes').
+My thanks to Dannon Baker from the Galaxy development team for his assistance
 with this.
 
 
@@ -25,7 +26,7 @@
 files blastdb.loc (nucleotide databases like NT) and blastdb_p.loc (protein
 databases like NR).
 
-You will also need to install the 'blast_datatypes' from the Tool Shed. This
+You will also need to install 'blast_datatypes' from the Tool Shed. This
 defines the BLAST XML file format ('blastxml').
 
 
@@ -39,6 +40,8 @@
           very large sets of queries where BLAST+ can become memory hungry)
         - Include warning that BLAST+ with subject FASTA gives pairwise
           e-values
+v0.0.13 - Use the new error handling options in Galaxy (the previously
+          bundled hide_stderr.py script is no longer needed).
 
 
 Developers
--- a/tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml	Thu Aug 23 09:00:40 2012 -0400
+++ b/tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml	Wed Sep 19 13:08:31 2012 -0400
@@ -1,9 +1,9 @@
-<tool id="ncbi_blastn_wrapper" name="NCBI BLAST+ blastn" version="0.0.12">
+<tool id="ncbi_blastn_wrapper" name="NCBI BLAST+ blastn" version="0.0.13">
     <description>Search nucleotide database with nucleotide query sequence(s)</description>
     <!-- If job splitting is enabled, break up the query file into parts -->
     <parallelism method="multi" split_inputs="query" split_mode="to_size" split_size="1000" shared_inputs="subject" merge_outputs="output1"></parallelism>
     <version_command>blastn -version</version_command>
-    <command interpreter="python">hide_stderr.py
+    <command>
 ## The command is a Cheetah template which allows some Python based syntax.
 ## Lines starting hash hash are comments. Galaxy will turn newlines into spaces
 blastn
@@ -39,6 +39,10 @@
 ## End of advanced options:
 #end if
     </command>
+    <stdio>
+        <exit_code range="1:" />
+	<exit_code range="://0" />
+    </stdio>
     <inputs>
         <param name="query" type="data" format="fasta" label="Nucleotide query sequence(s)"/> 
         <conditional name="db_opts">
--- a/tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml	Thu Aug 23 09:00:40 2012 -0400
+++ b/tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml	Wed Sep 19 13:08:31 2012 -0400
@@ -1,9 +1,9 @@
-<tool id="ncbi_blastp_wrapper" name="NCBI BLAST+ blastp" version="0.0.12">
+<tool id="ncbi_blastp_wrapper" name="NCBI BLAST+ blastp" version="0.0.13">
     <description>Search protein database with protein query sequence(s)</description>
     <!-- If job splitting is enabled, break up the query file into parts -->
     <parallelism method="multi" split_inputs="query" split_mode="to_size" split_size="1000" shared_inputs="subject" merge_outputs="output1"></parallelism>
     <version_command>blastp -version</version_command>
-    <command interpreter="python">hide_stderr.py
+    <command>
 ## The command is a Cheetah template which allows some Python based syntax.
 ## Lines starting hash hash are comments. Galaxy will turn newlines into spaces
 blastp
@@ -40,6 +40,10 @@
 ## End of advanced options:
 #end if
     </command>
+    <stdio>
+        <exit_code range="1:" />
+	<exit_code range="://0" />
+    </stdio>
     <inputs>
         <param name="query" type="data" format="fasta" label="Protein query sequence(s)"/> 
         <conditional name="db_opts">
--- a/tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml	Thu Aug 23 09:00:40 2012 -0400
+++ b/tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml	Wed Sep 19 13:08:31 2012 -0400
@@ -1,9 +1,9 @@
-<tool id="ncbi_blastx_wrapper" name="NCBI BLAST+ blastx" version="0.0.12">
+<tool id="ncbi_blastx_wrapper" name="NCBI BLAST+ blastx" version="0.0.13">
     <description>Search protein database with translated nucleotide query sequence(s)</description>
     <!-- If job splitting is enabled, break up the query file into parts -->
     <parallelism method="multi" split_inputs="query" split_mode="to_size" split_size="1000" shared_inputs="subject" merge_outputs="output1"></parallelism>
     <version_command>blastx -version</version_command>
-    <command interpreter="python">hide_stderr.py
+    <command>
 ## The command is a Cheetah template which allows some Python based syntax.
 ## Lines starting hash hash are comments. Galaxy will turn newlines into spaces
 blastx
@@ -40,6 +40,10 @@
 ## End of advanced options:
 #end if
     </command>
+    <stdio>
+        <exit_code range="1:" />
+        <exit_code range="://0" />
+    </stdio>
     <inputs>
         <param name="query" type="data" format="fasta" label="Nucleotide query sequence(s)"/> 
         <conditional name="db_opts">
--- a/tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml	Thu Aug 23 09:00:40 2012 -0400
+++ b/tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml	Wed Sep 19 13:08:31 2012 -0400
@@ -1,9 +1,9 @@
-<tool id="ncbi_tblastn_wrapper" name="NCBI BLAST+ tblastn" version="0.0.12">
+<tool id="ncbi_tblastn_wrapper" name="NCBI BLAST+ tblastn" version="0.0.13">
     <description>Search translated nucleotide database with protein query sequence(s)</description>
     <!-- If job splitting is enabled, break up the query file into parts -->
     <parallelism method="multi" split_inputs="query" split_mode="to_size" split_size="1000" shared_inputs="subject" merge_outputs="output1"></parallelism>
     <version_command>tblastn -version</version_command>
-    <command interpreter="python">hide_stderr.py
+    <command>
 ## The command is a Cheetah template which allows some Python based syntax.
 ## Lines starting hash hash are comments. Galaxy will turn newlines into spaces
 tblastn
@@ -40,6 +40,10 @@
 ## End of advanced options:
 #end if
     </command>
+    <stdio>
+        <exit_code range="1:" />
+        <exit_code range="://0" />
+    </stdio>
     <inputs>
         <param name="query" type="data" format="fasta" label="Protein query sequence(s)"/> 
         <conditional name="db_opts">
--- a/tools/ncbi_blast_plus/ncbi_tblastx_wrapper.xml	Thu Aug 23 09:00:40 2012 -0400
+++ b/tools/ncbi_blast_plus/ncbi_tblastx_wrapper.xml	Wed Sep 19 13:08:31 2012 -0400
@@ -1,9 +1,9 @@
-<tool id="ncbi_tblastx_wrapper" name="NCBI BLAST+ tblastx" version="0.0.12">
+<tool id="ncbi_tblastx_wrapper" name="NCBI BLAST+ tblastx" version="0.0.13">
     <description>Search translated nucleotide database with translated nucleotide query sequence(s)</description>
     <!-- If job splitting is enabled, break up the query file into parts -->
     <parallelism method="multi" split_inputs="query" split_mode="to_size" split_size="1000" shared_inputs="subject" merge_outputs="output1"></parallelism>
     <version_command>tblastx -version</version_command>
-    <command interpreter="python">hide_stderr.py
+    <command>
 ## The command is a Cheetah template which allows some Python based syntax.
 ## Lines starting hash hash are comments. Galaxy will turn newlines into spaces
 tblastx
@@ -40,6 +40,10 @@
 ## End of advanced options:
 #end if
     </command>
+    <stdio>
+        <exit_code range="1:" />
+        <exit_code range="://0" />
+    </stdio>
     <inputs>
         <param name="query" type="data" format="fasta" label="Nucleotide query sequence(s)"/> 
         <conditional name="db_opts">