# HG changeset patch
# User peterjc
# Date 1416922104 18000
# Node ID 1ea715da18795829af956df875fd580b2ffb48ce
# Parent f7ce32e13bc610d0749f97441423370caeeb60e5
Uploaded v0.0.13, embed citation, relax test for floating point differences
diff -r f7ce32e13bc6 -r 1ea715da1879 tools/effectiveT3/README.rst
--- a/tools/effectiveT3/README.rst Wed Sep 18 06:11:36 2013 -0400
+++ b/tools/effectiveT3/README.rst Tue Nov 25 08:28:24 2014 -0500
@@ -33,7 +33,7 @@
Manual Installation
===================
-You can change the path by setting the environment variable EFFECTIVET3 to the
+You can change the path by setting the environment variable ``$EFFECTIVET3`` to the
relevant folder, but by default it expects the following files to be installed
at these locations::
@@ -45,23 +45,23 @@
To install the wrapper copy or move the following files under the Galaxy tools
folder, e.g. in a tools/effectiveT3 folder:
-* effectiveT3.xml (the Galaxy tool definition)
-* effectiveT3.py (the Python wrapper script)
-* README.rst (this file)
+* ``effectiveT3.xml`` (the Galaxy tool definition)
+* ``effectiveT3.py`` (the Python wrapper script)
+* ``README.rst`` (this file)
-Also copy effectiveT3.loc.sample to effectiveT3.loc in the tool-data folder
-(and edit if appropriate, e.g. to add or remove a model).
+Also copy ``effectiveT3.loc.sample`` to ``effectiveT3.loc`` in the ``tool-data``
+folder (and edit if appropriate, e.g. to add or remove a model).
-You will also need to modify the tools_conf.xml file to tell Galaxy to offer the
+You will also need to modify the ``tools_conf.xml`` file to tell Galaxy to offer the
tool. If you are using other protein analysis tools like TMHMM or SignalP, put
it next to them. Just add the line::
-If you wish to run the unit tests, also add this to tools_conf.xml.sample
-and move/copy the test-data files under Galaxy's test-data folder. Then::
+If you wish to run the unit tests, also move/copy the ``test-data/`` files
+under Galaxy's ``test-data/`` folder. Then::
- $ ./run_functional_tests.sh -id effectiveT3
+ $ ./run_tests.sh -id effectiveT3
That's it.
@@ -84,6 +84,9 @@
- Use reStructuredText for this README file.
- Updated citation information (Cock et al. 2013).
- Development moved to GitHub, https://github.com/peterjc/pico_galaxy
+v0.0.13 - Relax unit test to allow for small floating point score difference.
+ - Tool definition now embeds citation information.
+ - Fixed error handling in ``effectiveT3.py``.
======= ======================================================================
diff -r f7ce32e13bc6 -r 1ea715da1879 tools/effectiveT3/effectiveT3.py
--- a/tools/effectiveT3/effectiveT3.py Wed Sep 18 06:11:36 2013 -0400
+++ b/tools/effectiveT3/effectiveT3.py Tue Nov 25 08:28:24 2014 -0500
@@ -15,13 +15,13 @@
import os
import subprocess
-#The Galaxy auto-install via tool_dependencies.xml will set this environment variable
+# The Galaxy auto-install via tool_dependencies.xml will set this environment variable
effectiveT3_dir = os.environ.get("EFFECTIVET3", "/opt/EffectiveT3/")
effectiveT3_jar = os.path.join(effectiveT3_dir, "TTSS_GUI-1.0.1.jar")
if "-v" in sys.argv or "--version" in sys.argv:
- #TODO - Get version of the JAR file dynamically?
- print "Wrapper v0.0.11, TTSS_GUI-1.0.1.jar"
+ # TODO - Get version of the JAR file dynamically?
+ print("Wrapper v0.0.13, TTSS_GUI-1.0.1.jar")
sys.exit(0)
def stop_err(msg, error_level=1):
@@ -51,12 +51,12 @@
or line.startswith("Id; Description; Score;"):
continue
assert line.count(";") >= 3, repr(line)
- #Normally there will just be three semi-colons, however the
- #original FASTA file's ID or description might have had
- #semi-colons in it as well, hence the following hackery:
+ # Normally there will just be three semi-colons, however the
+ # original FASTA file's ID or description might have had
+ # semi-colons in it as well, hence the following hackery:
try:
id_descr, score, effective = line.rstrip("\r\n").rsplit(";",2)
- #Cope when there was no FASTA description
+ # Cope when there was no FASTA description
if "; " not in id_descr and id_descr.endswith(";"):
id = id_descr[:-1]
descr = ""
@@ -74,20 +74,21 @@
return count, positive, errors
def run(cmd):
- #Avoid using shell=True when we call subprocess to ensure if the Python
- #script is killed, so too is the child process.
+ # 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:
stop_err("Error invoking command:\n%s\n\n%s\n" % (" ".join(cmd), err))
- #Use .communicate as can get deadlocks with .wait(),
+ # Use .communicate as can get deadlocks with .wait(),
stdout, stderr = child.communicate()
return_code = child.returncode
if return_code:
+ cmd_str= " ".join(cmd) # doesn't quote spaces etc
if stderr and stdout:
- stop_err("Return code %i from command:\n%s\n\n%s\n\n%s" % (return_code, err, stdout, stderr))
+ stop_err("Return code %i from command:\n%s\n\n%s\n\n%s" % (return_code, cmd_str, stdout, stderr))
else:
- stop_err("Return code %i from command:\n%s\n%s" % (return_code, err, stderr))
+ stop_err("Return code %i from command:\n%s\n%s" % (return_code, cmd_str, stderr))
if not os.path.isdir(effectiveT3_dir):
stop_err("Effective T3 folder not found: %r" % effectiveT3_dir)
@@ -106,10 +107,10 @@
sys.stderr.write("Main JAR was found: %r\n" % effectiveT3_jar)
stop_err("Effective T3 model JAR file not found: %r" % effectiveT3_model)
-#We will have write access whereever the output should be,
+# We will have write access whereever the output should be,
temp_file = os.path.abspath(tabular_file + ".tmp")
-#Use absolute paths since will change current directory...
+# Use absolute paths since will change current directory...
tabular_file = os.path.abspath(tabular_file)
fasta_file = os.path.abspath(fasta_file)
@@ -121,7 +122,7 @@
"-q"]
try:
- #Must run from directory above the module subfolder:
+ # Must run from directory above the module subfolder:
os.chdir(effectiveT3_dir)
except:
stop_err("Could not change to Effective T3 folder: %s" % effectiveT3_dir)
@@ -141,11 +142,11 @@
os.remove(temp_file)
if errors:
- print "%i sequences, %i positive, %i errors" \
- % (count, positive, errors)
+ print("%i sequences, %i positive, %i errors"
+ % (count, positive, errors))
else:
- print "%i/%i sequences positive" % (positive, count)
+ print("%i/%i sequences positive" % (positive, count))
if count and count==errors:
- #Galaxy will still allow them to see the output file
+ # Galaxy will still allow them to see the output file
stop_err("All your sequences gave an error code")
diff -r f7ce32e13bc6 -r 1ea715da1879 tools/effectiveT3/effectiveT3.xml
--- a/tools/effectiveT3/effectiveT3.xml Wed Sep 18 06:11:36 2013 -0400
+++ b/tools/effectiveT3/effectiveT3.xml Tue Nov 25 08:28:24 2014 -0500
@@ -1,4 +1,4 @@
-
+Find bacterial effectors in protein sequenceseffectiveT3
@@ -47,12 +47,12 @@
-
+
-
+
@@ -99,4 +99,9 @@
This wrapper is available to install into other Galaxy Instances via the Galaxy
Tool Shed at http://toolshed.g2.bx.psu.edu/view/peterjc/effectivet3
+
+ 10.7717/peerj.167
+ 10.1093/nar/gkq1154
+ 10.1371/journal.ppat.1000376
+
diff -r f7ce32e13bc6 -r 1ea715da1879 tools/effectiveT3/tool_dependencies.xml
--- a/tools/effectiveT3/tool_dependencies.xml Wed Sep 18 06:11:36 2013 -0400
+++ b/tools/effectiveT3/tool_dependencies.xml Tue Nov 25 08:28:24 2014 -0500
@@ -9,13 +9,13 @@
wget http://effectors.org/download/version/TTSS_GUI-1.0.1.jar
-
+ -->
$INSTALL_DIR/modulewget http://effectors.org/download/module/TTSS_ANIMAL-1.0.1.jar
- $INSTALL_DIR/module/
+ $INSTALL_DIR/module/wget http://effectors.org/download/module/TTSS_PLANT-1.0.1.jar$INSTALL_DIR/module/wget http://effectors.org/download/module/TTSS_STD-1.0.1.jar