changeset 3:ae44396108f5 draft default tip

v0.0.8 internal changes
author peterjc
date Wed, 05 Aug 2015 12:25:47 -0400
parents 9f2088ca5f6a
children
files tools/predictnls/README.rst tools/predictnls/predictnls.py tools/predictnls/predictnls.xml
diffstat 3 files changed, 42 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/tools/predictnls/README.rst	Fri Nov 21 07:00:43 2014 -0500
+++ b/tools/predictnls/README.rst	Wed Aug 05 12:25:47 2015 -0400
@@ -1,12 +1,12 @@
 Python re-implementation of predictNLS with Galaxy wrapper
 ==========================================================
 
-This Galaxy tool is copyright 2011-2013 by Peter Cock, The James Hutton Institute
+This Galaxy tool is copyright 2011-2015 by Peter Cock, The James Hutton Institute
 (formerly SCRI, Scottish Crop Research Institute), UK. All rights reserved.
 See the licence text below.
 
-The tool consists of a Galaxy interface definition (predictnls.xml), and a Python
-script (predictnls.py) which re-implements the command line tool predictNLS. This
+The tool consists of a Galaxy interface definition (``predictnls.xml``), and a Python
+script (``predictnls.py``) which re-implements the command line tool predictNLS. This
 should match the behaviour of predictNLS v1.0.20 (July 2011), the current latest
 release from the Rost Lab, see http://rostlab.org and their paper:
 
@@ -30,12 +30,12 @@
 ===================
 
 There are just four files which should be moved under the Galaxy tools folder,
-e.g. in a tools/protein_analysis filter:
+e.g. in a ``tools/protein_analysis`` filter:
 
-* predictlns.xml (the Galaxy tool definition)
-* predictlns.py (the Python script)
-* predictlns.txt (this README file)
-* My_NLS_list (the default set of NLS motifs from the Rost Lab)
+* ``predictlns.xml`` (the Galaxy tool definition)
+* ``predictlns.py`` (the Python script)
+* ``predictlns.txt`` (this README file)
+* ``My_NLS_list`` (the default set of NLS motifs from the Rost Lab)
 
 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
@@ -64,6 +64,8 @@
         - Updated citation information (Cock et al. 2013).
         - Development moved to GitHub, https://github.com/peterjc/pico_galaxy
 v0.0.7  - Tool definition now embeds citation information.
+v0.0.8  - Reorder XML elements (internal change only).
+        - Planemo for Tool Shed upload (``.shed.yml``, internal change only).
 ======= ======================================================================
 
 
@@ -73,20 +75,29 @@
 This script and related tools were initially developed on the following hg branch:
 http://bitbucket.org/peterjc/galaxy-central/src/tools
 
-For making the "Galaxy Tool Shed" http://toolshed.g2.bx.psu.edu/ tarball use
-the following command from the Galaxy root folder::
+For pushing a release to the test or main "Galaxy Tool Shed", use the following
+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)::
 
-    $ tar -czf predictnls.tar.gz tools/predictnls/README.rst tools/predictnls/predictnls.xml tools/predictnls/predictnls.py tools/predictnls/My_NLS_list test-data/four_human_proteins.fasta test-data/four_human_proteins.predictnls.tabular
+    $ planemo shed_update --shed_target testtoolshed --check_diff ~/repositories/pico_galaxy/tools/predictnls/
+    ...
+
+or::
 
-Check this worked::
+    $ planemo shed_update --shed_target toolshed --check_diff ~/repositories/pico_galaxy/tools/predictnls/
+    ...
 
-    $ tar -tzf predictnls.tar.gz
-    tools/predictnls/README.rst
-    tools/predictnls/predictnls.xml
-    tools/predictnls/predictnls.py
-    tools/predictnls/My_NLS_list
+To just build and check the tar ball, use::
+
+    $ planemo shed_upload --tar_only  ~/repositories/pico_galaxy/tools/predictnls/
+    ...
+    $ tar -tzf shed_upload.tar.gz 
     test-data/four_human_proteins.fasta
     test-data/four_human_proteins.predictnls.tabular
+    tools/predictnls/My_NLS_list
+    tools/predictnls/README.rst
+    tools/predictnls/predictnls.py
+    tools/predictnls/predictnls.xml
 
 
 Licence (GPL)
@@ -99,7 +110,7 @@
 the Rost Lab, which was released under the GPL v3. Therefore, as I consider
 this to be a derivative work, this too is released under the GPL v3.
 
-Please note that the My_NLS_list should be an exact copy of the file of the
-same name included with predictnls-1.0.7.tar.gz to predictnls-1.0.20.tar.gz
+Please note that the ``My_NLS_list`` file should be an exact copy of the file of the
+same name included with ``predictnls-1.0.7.tar.gz`` to ``predictnls-1.0.20.tar.gz``
 inclusive (the list was extended in v1.0.7 in August 2010, see the change log
 included in those tar-balls), available from ftp://rostlab.org/predictnls/
--- a/tools/predictnls/predictnls.py	Fri Nov 21 07:00:43 2014 -0500
+++ b/tools/predictnls/predictnls.py	Wed Aug 05 12:25:47 2015 -0400
@@ -53,7 +53,7 @@
 import sys
 import re
 
-def stop_err(msg, return_code=1):
+def sys_exit(msg, return_code=1):
     sys.stderr.write(msg.rstrip() + "\n")
     sys.exit(return_code)
 
@@ -70,13 +70,13 @@
         re_filename = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
                                                    "My_NLS_list")
 else:
-    stop_err("Expect 2 or 3 arguments: input FASTA file, output tabular file, and NLS motif file")
+    sys_exit("Expect 2 or 3 arguments: input FASTA file, output tabular file, and NLS motif file")
 
 if not os.path.isfile(fasta_filename):
-    stop_err("Could not find FASTA input file: %s" % fasta_filename)
+    sys_exit("Could not find FASTA input file: %s" % fasta_filename)
 
 if not os.path.isfile(re_filename):
-    stop_err("Could not find NLS motif file: %s" % re_filename)
+    sys_exit("Could not find NLS motif file: %s" % re_filename)
 
 def load_re(filename):
     """Parse the 5+ column tabular NLS motif file."""
@@ -92,7 +92,7 @@
             regex = re.compile(regex)
             p_count = int(p_count)
         except ValueError:
-            stop_err("Bad data in line: %s" % line)
+            sys_exit("Bad data in line: %s" % line)
         if 6 <= len(parts):
             proteins = parts[5]
             assert p_count == len(proteins.split(",")), line
--- a/tools/predictnls/predictnls.xml	Fri Nov 21 07:00:43 2014 -0500
+++ b/tools/predictnls/predictnls.xml	Wed Aug 05 12:25:47 2015 -0400
@@ -1,13 +1,16 @@
-<tool id="predictnls" name="PredictNLS" version="0.0.7">
+<tool id="predictnls" name="PredictNLS" version="0.0.8">
     <description>Find nuclear localization signals (NLSs) in protein sequences</description>
-    <command interpreter="python">
-      predictnls.py $fasta_file $tabular_file
-    </command>
+    <requirements>
+        <requirement type="binary">predictnls</requirement>
+    </requirements>
     <stdio>
         <!-- Assume anything other than zero is an error -->
         <exit_code range="1:" />
         <exit_code range=":-1" />
     </stdio>
+    <command interpreter="python">
+      predictnls.py $fasta_file $tabular_file
+    </command>
     <inputs>
         <param name="fasta_file" type="data" format="fasta" label="FASTA file of protein sequences"/> 
     </inputs>
@@ -20,9 +23,6 @@
              <output name="tabular_file" file="four_human_proteins.predictnls.tabular"/>
         </test>
     </tests>
-    <requirements>
-        <requirement type="binary">predictnls</requirement>
-    </requirements>
     <help>
     
 **What it does**