# HG changeset patch # User peterjc # Date 1670344190 0 # Node ID 8664c4c947643c28e5cf816ef7374f0ae4449154 # Parent 887adf823bc01f93812e77f3c3c8b04277b495bd v0.0.11 - Assorted packaging updates (overdue upload) diff -r 887adf823bc0 -r 8664c4c94764 tools/blast2go/README.rst --- a/tools/blast2go/README.rst Tue Dec 06 16:26:16 2022 +0000 +++ b/tools/blast2go/README.rst Tue Dec 06 16:29:50 2022 +0000 @@ -1,7 +1,7 @@ Galaxy wrapper for Blast2GO for pipelines, b2g4pipe =================================================== -This wrapper is copyright 2011-2015 by Peter Cock, The James Hutton Institute +This wrapper is copyright 2011-2017 by Peter Cock, The James Hutton Institute (formerly SCRI, Scottish Crop Research Institute), UK. All rights reserved. See the licence text below (MIT licence). @@ -24,22 +24,22 @@ Peter Cock, Bjoern Gruening, Konrad Paszkiewicz and Leighton Pritchard (2013). Galaxy tools and workflows for sequence analysis with applications in molecular plant pathology. PeerJ 1:e167 -http://dx.doi.org/10.7717/peerj.167 +https://doi.org/10.7717/peerj.167 S. Geotz et al. (2008). High-throughput functional annotation and data mining with the Blast2GO suite. Nucleic Acids Res. 36(10):3420-3435. -http://dx.doi.org/10.1093/nar/gkn176 +https://doi.org/10.1093/nar/gkn176 A. Conesa and S. Geotz (2008). Blast2GO: A Comprehensive Suite for Functional Analysis in Plant Genomics. International Journal of Plant Genomics. 619832. -http://dx.doi.org/10.1155/2008/619832 +https://doi.org/10.1155/2008/619832 A. Conesa et al. (2005). Blast2GO: A universal tool for annotation, visualization and analysis in functional genomics research. Bioinformatics 21:3674-3676. -http://dx.doi.org/10.1093/bioinformatics/bti610 +https://doi.org/10.1093/bioinformatics/bti610 See also http://www.blast2go.com/ @@ -164,8 +164,16 @@ of the Blast2GO command line tool. For now b2g4pipe v2.5 is still available as a free download. - Tool definition now embeds citation information. -v0.0.10 - Reorder XML elements (internal change only). +v0.0.10 - Python 3 ready + - Reorder XML elements (internal change only). - Planemo for Tool Shed upload (``.shed.yml``, internal change only). +v0.0.11 - Fix parameter help text which was not being displayed. + - PEP8 style updates to the Python script (internal change only). + - Use ```` (internal change only). + - Single quote command line arguments (internal change only). + - Python 3 compatible syntax. + - Record ``b2g4pipe_v2.5.zip`` SHA256 checksum, and download this via + the Galaxy package cache. ======= ====================================================================== @@ -195,7 +203,7 @@ $ planemo shed_upload --tar_only ~/repositories/galaxy_blast/tools/blast2go/ ... - $ tar -tzf shed_upload.tar.gz + $ tar -tzf shed_upload.tar.gz test-data/blastp_sample.blast2go.tabular test-data/blastp_sample.xml tool-data/blast2go.loc.sample diff -r 887adf823bc0 -r 8664c4c94764 tools/blast2go/blast2go.py --- a/tools/blast2go/blast2go.py Tue Dec 06 16:26:16 2022 +0000 +++ b/tools/blast2go/blast2go.py Tue Dec 06 16:29:50 2022 +0000 @@ -26,9 +26,11 @@ This script is under version control here: https://github.com/peterjc/galaxy_blast/tree/master/blast2go """ -import sys +from __future__ import print_function + import os import subprocess +import sys # You may need to edit this to match your local setup, blast2go_dir = os.environ.get("B2G4PIPE", "/opt/b2g4pipe_v2.5/") @@ -41,7 +43,10 @@ sys.exit("Missing sister file massage_xml_for_blast2go.py") if len(sys.argv) != 4: - sys.exit("Require three arguments: XML filename, properties filename, output tabular filename") + sys.exit( + "Require three arguments: XML filename, " + "properties filename, output tabular filename" + ) xml_file, prop_file, tabular_file = sys.argv[1:] @@ -65,11 +70,14 @@ def run(cmd): + """Run the given command line string via subprocess.""" # Avoid using shell=True when we call subprocess to ensure if the Python # script is killed, so too is the child process. try: - child = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - except Exception, err: + child = subprocess.Popen( + cmd, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) + except Exception as err: sys.exit("Error invoking command:\n%s\n\n%s\n" % (" ".join(cmd), err)) stdout, stderr = child.communicate() return_code = child.returncode @@ -91,7 +99,7 @@ error_msg = "No sequences processed!" if error_msg: - print error_msg + print(error_msg) sys.exit(error_msg) @@ -105,14 +113,21 @@ # We will have write access wherever the output should be, # so we'll ask Blast2GO to use that as the stem for its output # (it will append .annot to the filename) -cmd = ["java", "-cp", blast2go_classpath, "es.blast2go.prog.B2GAnnotPipe", - "-in", tmp_xml_file, - "-prop", prop_file, - "-out", tabular_file, # Used as base name for output files - "-annot", # Generate *.annot tabular file - # NOTE: For v2.3.5 must use -a, for v2.5 must use -annot instead - # "-img", # Generate images, feature not in v2.3.5 - ] +cmd = [ + "java", + "-cp", + blast2go_classpath, + "es.blast2go.prog.B2GAnnotPipe", + "-in", + tmp_xml_file, + "-prop", + prop_file, + "-out", + tabular_file, # Used as base name for output files + "-annot", # Generate *.annot tabular file + # NOTE: For v2.3.5 must use -a, for v2.5 must use -annot instead + # "-img", # Generate images, feature not in v2.3.5 +] # print " ".join(cmd) run(cmd) @@ -126,4 +141,4 @@ # Move the output file where Galaxy expects it to be: os.rename(out_file, tabular_file) -print "Done" +print("Done") diff -r 887adf823bc0 -r 8664c4c94764 tools/blast2go/blast2go.xml --- a/tools/blast2go/blast2go.xml Tue Dec 06 16:26:16 2022 +0000 +++ b/tools/blast2go/blast2go.xml Tue Dec 06 16:29:50 2022 +0000 @@ -1,19 +1,15 @@ - + Maps BLAST results to GO annotation terms b2g4pipe + python - - - - - - - blast2go.py "${xml}" "${prop.fields.path}" "${tab}" + +python $__tool_directory__/blast2go.py '$xml' '${prop.fields.path}' '$tab' - - + + @@ -92,22 +88,22 @@ Peter Cock, Bjoern Gruening, Konrad Paszkiewicz and Leighton Pritchard (2013). Galaxy tools and workflows for sequence analysis with applications in molecular plant pathology. PeerJ 1:e167 -http://dx.doi.org/10.7717/peerj.167 +https://doi.org/10.7717/peerj.167 S. Götz et al. (2008). High-throughput functional annotation and data mining with the Blast2GO suite. Nucleic Acids Res. 36(10):3420–3435. -http://dx.doi.org/10.1093/nar/gkn176 +https://doi.org/10.1093/nar/gkn176 A. Conesa and S. Götz (2008). Blast2GO: A Comprehensive Suite for Functional Analysis in Plant Genomics. International Journal of Plant Genomics. 619832. -http://dx.doi.org/10.1155/2008/619832 +https://doi.org/10.1155/2008/619832 A. Conesa et al. (2005). Blast2GO: A universal tool for annotation, visualization and analysis in functional genomics research. Bioinformatics 21:3674-3676. -http://dx.doi.org/10.1093/bioinformatics/bti610 +https://doi.org/10.1093/bioinformatics/bti610 See also http://www.blast2go.com/ diff -r 887adf823bc0 -r 8664c4c94764 tools/blast2go/massage_xml_for_blast2go.py --- a/tools/blast2go/massage_xml_for_blast2go.py Tue Dec 06 16:26:16 2022 +0000 +++ b/tools/blast2go/massage_xml_for_blast2go.py Tue Dec 06 16:29:50 2022 +0000 @@ -19,8 +19,8 @@ This script is under version control here: https://github.com/peterjc/galaxy_blast/tree/master/blast2go """ +import os import sys -import os def prepare_xml(original_xml, mangled_xml): diff -r 887adf823bc0 -r 8664c4c94764 tools/blast2go/repository_dependencies.xml --- a/tools/blast2go/repository_dependencies.xml Tue Dec 06 16:26:16 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff -r 887adf823bc0 -r 8664c4c94764 tools/blast2go/tool_dependencies.xml --- a/tools/blast2go/tool_dependencies.xml Tue Dec 06 16:26:16 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ - - - - - - - - http://www.blast2go.com/data/blast2go/b2g4pipe_v2.5.zip - - -cp b2gPipe.properties Spain_2012_August.properties && -sed -i.bak "s/Dbacces.dbname=b2g_apr12/Dbacces.dbname=b2g_aug12/g" Spain_2012_August.properties && -sed -i.bak "s/Dbacces.dbhost=10.10.100.203/Dbacces.dbhost=publicdb.blast2go.com/g" Spain_2012_August.properties -rm Spain_2012_August.properties.bak - - -cp b2gPipe.properties Spain_2011_June.properties && -sed -i.bak "s/Dbacces.dbname=b2g_apr12/Dbacces.dbname=b2g_jun11/g" Spain_2011_June.properties && -sed -i.bak "s/Dbacces.dbhost=10.10.100.203/Dbacces.dbhost=publicdb.blast2go.com/g" Spain_2011_June.properties -rm Spain_2011_June.properties.bak - - .$INSTALL_DIR/ - - - $INSTALL_DIR - - - - -Downloads b2g4pipe v2.5 - - - -