# HG changeset patch # User peterjc # Date 1348074511 14400 # Node ID 9d5beacae92b094c22b439cf0eb9e51edada34b9 # Parent 643338ac83c0f3de9541666861f77fef16bfe567 Uploaded v0.0.13 which uses the recently added error handling. No longer bundles the hide_stderr.py script which is now redundant. diff -r 643338ac83c0 -r 9d5beacae92b tools/ncbi_blast_plus/hide_stderr.py --- 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) diff -r 643338ac83c0 -r 9d5beacae92b tools/ncbi_blast_plus/ncbi_blast_plus.txt --- 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 diff -r 643338ac83c0 -r 9d5beacae92b tools/ncbi_blast_plus/ncbi_blastn_wrapper.xml --- 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 @@ - + Search nucleotide database with nucleotide query sequence(s) blastn -version - hide_stderr.py + ## 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 + + + + diff -r 643338ac83c0 -r 9d5beacae92b tools/ncbi_blast_plus/ncbi_blastp_wrapper.xml --- 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 @@ - + Search protein database with protein query sequence(s) blastp -version - hide_stderr.py + ## 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 + + + + diff -r 643338ac83c0 -r 9d5beacae92b tools/ncbi_blast_plus/ncbi_blastx_wrapper.xml --- 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 @@ - + Search protein database with translated nucleotide query sequence(s) blastx -version - hide_stderr.py + ## 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 + + + + diff -r 643338ac83c0 -r 9d5beacae92b tools/ncbi_blast_plus/ncbi_tblastn_wrapper.xml --- 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 @@ - + Search translated nucleotide database with protein query sequence(s) tblastn -version - hide_stderr.py + ## 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 + + + + diff -r 643338ac83c0 -r 9d5beacae92b tools/ncbi_blast_plus/ncbi_tblastx_wrapper.xml --- 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 @@ - + Search translated nucleotide database with translated nucleotide query sequence(s) tblastx -version - hide_stderr.py + ## 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 + + + +