# HG changeset patch # User peterjc # Date 1494940637 14400 # Node ID 512530020360eab5e53c1402e33ad00dc26ae9f8 # Parent 60a9b3f760cc4ee0e241f61f6e7b1922ab92618a v0.0.18 Internal changes to command line handling diff -r 60a9b3f760cc -r 512530020360 tools/effectiveT3/README.rst --- a/tools/effectiveT3/README.rst Wed Feb 01 09:22:21 2017 -0500 +++ b/tools/effectiveT3/README.rst Tue May 16 09:17:17 2017 -0400 @@ -96,6 +96,8 @@ - Catch java exception, e.g. if Java too old for ``TTSS-STD-2.0.1.jar`` v0.0.17 - Update tool dependency definition to use cached URL. - Minor internal changes to Python script for error reporting & style. +v0.0.18 - Use ```` (internal change only). + - Single quote command line arguments (internal change only). ======= ====================================================================== @@ -112,17 +114,17 @@ Planemo commands (which requires you have set your Tool Shed access details in ``~/.planemo.yml`` and that you have access rights on the Tool Shed):: - $ planemo shed_update -t testtoolshed --check_diff ~/repositories/pico_galaxy/tools/effectiveT3/ + $ planemo shed_update -t testtoolshed --check_diff tools/effectiveT3/ ... or:: - $ planemo shed_update -t toolshed --check_diff ~/repositories/pico_galaxy/tools/effectiveT3/ + $ planemo shed_update -t toolshed --check_diff tools/effectiveT3/ ... To just build and check the tar ball, use:: - $ planemo shed_upload --tar_only ~/repositories/pico_galaxy/tools/effectiveT3/ + $ planemo shed_upload --tar_only tools/effectiveT3/ ... $ tar -tzf shed_upload.tar.gz tool-data/effectiveT3.loc.sample diff -r 60a9b3f760cc -r 512530020360 tools/effectiveT3/effectiveT3.py --- a/tools/effectiveT3/effectiveT3.py Wed Feb 01 09:22:21 2017 -0500 +++ b/tools/effectiveT3/effectiveT3.py Tue May 16 09:17:17 2017 -0400 @@ -11,9 +11,9 @@ webservice), and reformats the semi-colon separated output into tab separated output for use in Galaxy. """ -import sys import os import subprocess +import sys # The Galaxy auto-install via tool_dependencies.xml will set this environment variable effective_t3_dir = os.environ.get("EFFECTIVET3", "/opt/EffectiveT3/") @@ -32,8 +32,7 @@ if not os.path.isfile(fasta_file): sys.exit("Input FASTA file not found: %s" % fasta_file) -if threshold not in ["selective", "sensitive"] \ - and not threshold.startswith("cutoff="): +if threshold not in ["selective", "sensitive"] and not threshold.startswith("cutoff="): sys.exit("Threshold should be selective, sensitive, or cutoff=..., not %r" % threshold) @@ -43,8 +42,7 @@ positive = 0 errors = 0 for line in raw_handle: - if not line or line.startswith("#") \ - or line.startswith("Id; Description; Score;"): + if not line or line.startswith("#") or line.startswith("Id; Description; Score;"): continue assert line.count(";") >= 3, repr(line) # Normally there will just be three semi-colons, however the @@ -71,6 +69,7 @@ def run(cmd): + """Run the 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: diff -r 60a9b3f760cc -r 512530020360 tools/effectiveT3/effectiveT3.xml --- a/tools/effectiveT3/effectiveT3.xml Wed Feb 01 09:22:21 2017 -0500 +++ b/tools/effectiveT3/effectiveT3.xml Tue May 16 09:17:17 2017 -0400 @@ -1,22 +1,20 @@ - + Find bacterial effectors in protein sequences effectiveT3 - - - - - - effectiveT3.py --version - -effectiveT3.py $module.fields.path + +python $__tool_directory__/effectiveT3.py --version + + +python $__tool_directory__/effectiveT3.py '$module.fields.path' #if $restrict.type=="cutoff": - cutoff=$restrict.cutoff + 'cutoff=$restrict.cutoff' #else: - $restrict.type + '$restrict.type' #end if -$fasta_file $tabular_file +'$fasta_file' '$tabular_file' +