changeset 1:ec202446408a draft

Uploaded v0.0.4, fixed an error message.
author peterjc
date Wed, 04 Jun 2014 08:42:23 -0400
parents 0c24e4e2177d
children 9fbf29a8c12b
files tools/align_back_trans/README.rst tools/align_back_trans/align_back_trans.py tools/align_back_trans/align_back_trans.xml
diffstat 3 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/tools/align_back_trans/README.rst	Thu Mar 06 08:58:13 2014 -0500
+++ b/tools/align_back_trans/README.rst	Wed Jun 04 08:42:23 2014 -0400
@@ -14,6 +14,10 @@
 
 * http://toolshed.g2.bx.psu.edu/view/peterjc/align_back_trans
 
+The underlying Python script can also be used outside of Galaxy, for
+details run::
+
+    $ python align_back_trans.py
 
 Automated Installation
 ======================
@@ -56,6 +60,9 @@
 ------- ----------------------------------------------------------------------
 v0.0.1  - Initial version, based on a previously written Python script
 v0.0.2  - Optionally check the translation is consistent
+v0.0.3  - First official release
+v0.0.4  - Simplified XML to apply input format to output data.
+        - Fixed error message when sequence length not a multiple of three.
 ======= ======================================================================
 
 
--- a/tools/align_back_trans/align_back_trans.py	Thu Mar 06 08:58:13 2014 -0500
+++ b/tools/align_back_trans/align_back_trans.py	Wed Jun 04 08:42:23 2014 -0400
@@ -28,7 +28,7 @@
 from Bio.Data.CodonTable import ambiguous_generic_by_id
 
 if "-v" in sys.argv or "--version" in sys.argv:
-    print "v0.0.3"
+    print "v0.0.4"
     sys.exit(0)
 
 def stop_err(msg, error_level=1):
@@ -40,7 +40,7 @@
     """Returns nucleotide sequence if works (can remove trailing stop)"""
     if len(nuc) % 3:
         stop_err("Nucleotide sequence for %s is length %i (not a multiple of three)"
-                 % (identifier, nuc))
+                 % (identifier, len(nuc)))
 
     p = str(prot).upper().replace("*", "X")
     t = str(nuc.translate(table)).upper().replace("*", "X")
--- a/tools/align_back_trans/align_back_trans.xml	Thu Mar 06 08:58:13 2014 -0500
+++ b/tools/align_back_trans/align_back_trans.xml	Wed Jun 04 08:42:23 2014 -0400
@@ -1,4 +1,4 @@
-<tool id="align_back_trans" name="Thread nucleotides onto a protein alignment (back-translation)" version="0.0.3">
+<tool id="align_back_trans" name="Thread nucleotides onto a protein alignment (back-translation)" version="0.0.4">
     <description>Gives a codon aware alignment</description>
     <requirements>
         <requirement type="package" version="1.63">biopython</requirement>
@@ -38,13 +38,7 @@
         <param name="nuc_file" type="data" format="fasta" label="Unaligned nucleotide sequences" help="FASTA format, using same identifiers as your protein alignment" />
     </inputs>
     <outputs>
-        <data name="out_nuc_align" format="fasta" label="${prot_align.name} (back-translated)">
-            <!-- TODO - Replace this with format="input:prot_align" if/when that works -->
-            <change_format>
-                <when input_dataset="prot_align" attribute="extension" value="clustal" format="clustal" />
-                <when input_dataset="prot_align" attribute="extension" value="phylip" format="phylip" />
-            </change_format>
-        </data>
+        <data name="out_nuc_align" format="input" metadata_source="prot_align" label="${prot_align.name} (back-translated)"/>
     </outputs>
     <tests>
         <test>