changeset 35:259891fce7fd draft

planemo upload for repository https://github.com/peterjc/galaxy_mira/tree/master/tools/mira4_0 commit e4c56df75150c82d3e9c4ac487c4209108e52412
author peterjc
date Wed, 09 Aug 2017 13:32:11 -0400
parents 0785a6537f3e
children 46d73b942b43
files tools/mira4_0/README.rst tools/mira4_0/mira4.py tools/mira4_0/mira4_bait.py tools/mira4_0/mira4_bait.xml tools/mira4_0/mira4_convert.py tools/mira4_0/mira4_de_novo.xml tools/mira4_0/mira4_make_bam.py tools/mira4_0/mira4_mapping.xml tools/mira4_0/repository_dependencies.xml
diffstat 9 files changed, 42 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/tools/mira4_0/README.rst	Wed Jun 07 12:33:39 2017 -0400
+++ b/tools/mira4_0/README.rst	Wed Aug 09 13:32:11 2017 -0400
@@ -111,6 +111,8 @@
 v0.0.10 - Python 3 compatible syntax (internal change only).
         - Use ``<command detect_errors="aggressive">`` (internal change only).
         - Single quote command line arguments (internal change only).
+v0.0.11 - For compatibility with MIRA installed from the BioConda package,
+          if ``MIRA4$`` is not set, assume binaries are on the ``$PATH``.
 ======= ======================================================================
 
 
--- a/tools/mira4_0/mira4.py	Wed Jun 07 12:33:39 2017 -0400
+++ b/tools/mira4_0/mira4.py	Wed Aug 09 13:32:11 2017 -0400
@@ -16,7 +16,7 @@
 # Do we need any PYTHONPATH magic?
 from mira4_make_bam import make_bam
 
-WRAPPER_VER = "0.0.10"  # Keep in sync with the XML file
+WRAPPER_VER = "0.0.11"  # Keep in sync with the XML file
 
 
 def get_version(mira_binary):
@@ -69,18 +69,21 @@
 out_fasta = options.fasta
 out_log = options.log
 
-try:
+if "MIRA4" in os.environ:
     mira_path = os.environ["MIRA4"]
-except KeyError:
-    sys.exit("Environment variable $MIRA4 not set")
-mira_binary = os.path.join(mira_path, "mira")
-if not os.path.isfile(mira_binary):
-    sys.exit("Missing mira under $MIRA4, %r\nFolder contained: %s"
-             % (mira_binary, ", ".join(os.listdir(mira_path))))
-mira_convert = os.path.join(mira_path, "miraconvert")
-if not os.path.isfile(mira_convert):
-    sys.exit("Missing miraconvert under $MIRA4, %r\nFolder contained: %s"
-             % (mira_convert, ", ".join(os.listdir(mira_path))))
+    mira_binary = os.path.join(mira_path, "mira")
+    if not os.path.isfile(mira_binary):
+        sys.exit("Missing mira under $MIRA4, %r\nFolder contained: %s"
+                 % (mira_binary, ", ".join(os.listdir(mira_path))))
+    mira_convert = os.path.join(mira_path, "miraconvert")
+    if not os.path.isfile(mira_convert):
+        sys.exit("Missing miraconvert under $MIRA4, %r\nFolder contained: %s"
+                 % (mira_convert, ", ".join(os.listdir(mira_path))))
+else:
+    sys.stderr.write("DEBUG: Since $MIRA4 is not set, assuming mira binaries are on $PATH.\n")
+    mira_path = None
+    mira_binary = "mira"
+    mira_convert = "miraconvert"
 
 mira_ver = get_version(mira_binary)
 if not mira_ver.strip().startswith("4.0"):
--- a/tools/mira4_0/mira4_bait.py	Wed Jun 07 12:33:39 2017 -0400
+++ b/tools/mira4_0/mira4_bait.py	Wed Aug 09 13:32:11 2017 -0400
@@ -10,7 +10,7 @@
 import sys
 import time
 
-WRAPPER_VER = "0.0.10"  # Keep in sync with the XML file
+WRAPPER_VER = "0.0.11"  # Keep in sync with the XML file
 
 
 def get_version(mira_binary):
@@ -37,14 +37,17 @@
     return ver.split("\n", 1)[0]
 
 
-try:
+if "MIRA4" in os.environ:
     mira_path = os.environ["MIRA4"]
-except KeyError:
-    sys.exit("Environment variable $MIRA4 not set")
-mira_binary = os.path.join(mira_path, "mirabait")
-if not os.path.isfile(mira_binary):
-    sys.exit("Missing mirabait under $MIRA4, %r\nFolder contained: %s"
-             % (mira_binary, ", ".join(os.listdir(mira_path))))
+    mira_binary = os.path.join(mira_path, "mirabait")
+    if not os.path.isfile(mira_binary):
+        sys.exit("Missing mirabait under $MIRA4, %r\nFolder contained: %s"
+                 % (mira_binary, ", ".join(os.listdir(mira_path))))
+else:
+    sys.stderr.write("DEBUG: Since $MIRA4 is not set, assuming mira binaries are on $PATH.\n")
+    mira_path = None
+    mira_binary = "mirabait"
+
 mira_ver = get_version(mira_binary)
 if not mira_ver.strip().startswith("4.0"):
     sys.exit("This wrapper is for MIRA V4.0, not:\n%s" % mira_ver)
--- a/tools/mira4_0/mira4_bait.xml	Wed Jun 07 12:33:39 2017 -0400
+++ b/tools/mira4_0/mira4_bait.xml	Wed Aug 09 13:32:11 2017 -0400
@@ -1,4 +1,4 @@
-<tool id="mira_4_0_bait" name="MIRA v4.0 mirabait" version="0.0.10">
+<tool id="mira_4_0_bait" name="MIRA v4.0 mirabait" version="0.0.11">
     <description>Filter reads using kmer matches</description>
     <requirements>
         <requirement type="package" version="4.0.2">MIRA</requirement>
--- a/tools/mira4_0/mira4_convert.py	Wed Jun 07 12:33:39 2017 -0400
+++ b/tools/mira4_0/mira4_convert.py	Wed Aug 09 13:32:11 2017 -0400
@@ -22,7 +22,7 @@
 # Do we need any PYTHONPATH magic?
 from mira4_make_bam import depad
 
-WRAPPER_VER = "0.0.10"  # Keep in sync with the XML file
+WRAPPER_VER = "0.0.11"  # Keep in sync with the XML file
 
 
 def run(cmd):
@@ -110,14 +110,16 @@
 out_ace = options.ace
 out_cstats = options.cstats
 
-try:
+if "MIRA4" in os.environ:
     mira_path = os.environ["MIRA4"]
-except KeyError:
-    sys.exit("Environment variable $MIRA4 not set")
-mira_convert = os.path.join(mira_path, "miraconvert")
-if not os.path.isfile(mira_convert):
-    sys.exit("Missing miraconvert under $MIRA4, %r\nFolder contained: %s"
-             % (mira_convert, ", ".join(os.listdir(mira_path))))
+    mira_convert = os.path.join(mira_path, "miraconvert")
+    if not os.path.isfile(mira_convert):
+        sys.exit("Missing miraconvert under $MIRA4, %r\nFolder contained: %s"
+                 % (mira_convert, ", ".join(os.listdir(mira_path))))
+else:
+    sys.stderr.write("DEBUG: Since $MIRA4 is not set, assuming mira binaries are on $PATH.\n")
+    mira_path = None
+    mira_convert = "miraconvert"
 
 mira_convert_ver = get_version(mira_convert)
 if not mira_convert_ver.strip().startswith("4.0"):
--- a/tools/mira4_0/mira4_de_novo.xml	Wed Jun 07 12:33:39 2017 -0400
+++ b/tools/mira4_0/mira4_de_novo.xml	Wed Aug 09 13:32:11 2017 -0400
@@ -1,4 +1,4 @@
-<tool id="mira_4_0_de_novo" name="MIRA v4.0 de novo assember" version="0.0.10">
+<tool id="mira_4_0_de_novo" name="MIRA v4.0 de novo assember" version="0.0.11">
     <description>Takes Sanger, Roche 454, Solexa/Illumina, Ion Torrent and PacBio reads</description>
     <requirements>
         <requirement type="package" version="4.0.2">MIRA</requirement>
--- a/tools/mira4_0/mira4_make_bam.py	Wed Jun 07 12:33:39 2017 -0400
+++ b/tools/mira4_0/mira4_make_bam.py	Wed Aug 09 13:32:11 2017 -0400
@@ -56,8 +56,6 @@
 
 
 def make_bam(mira_convert, maf_file, fasta_file, bam_file, log_handle):
-    if not os.path.isfile(mira_convert):
-        return "Missing binary %r" % mira_convert
     if not os.path.isfile(maf_file):
         return "Missing input MIRA file: %r" % maf_file
     if not os.path.isfile(fasta_file):
--- a/tools/mira4_0/mira4_mapping.xml	Wed Jun 07 12:33:39 2017 -0400
+++ b/tools/mira4_0/mira4_mapping.xml	Wed Aug 09 13:32:11 2017 -0400
@@ -1,4 +1,4 @@
-<tool id="mira_4_0_mapping" name="MIRA v4.0 mapping" version="0.0.10">
+<tool id="mira_4_0_mapping" name="MIRA v4.0 mapping" version="0.0.11">
     <description>Maps Sanger, Roche 454, Solexa/Illumina, Ion Torrent and PacBio reads</description>
     <requirements>
         <requirement type="package" version="4.0.2">MIRA</requirement>
--- a/tools/mira4_0/repository_dependencies.xml	Wed Jun 07 12:33:39 2017 -0400
+++ b/tools/mira4_0/repository_dependencies.xml	Wed Aug 09 13:32:11 2017 -0400
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
 <repositories description="This requires the MIRA datatype definitions (e.g. the MIRA Assembly Format).">
-    <repository changeset_revision="3fc6ff47a3b1" name="mira_datatypes" owner="peterjc" toolshed="https://testtoolshed.g2.bx.psu.edu" />
+    <repository changeset_revision="f4d34bd3c633" name="mira_datatypes" owner="peterjc" toolshed="https://testtoolshed.g2.bx.psu.edu" />
 </repositories>