changeset 18:877d53e2d963 draft

planemo upload for repository https://github.com/pjbriggs/Amplicon_analysis-galaxy commit af3afa7bd2c2441074879938cd93d9965908bbc7-dirty
author pjbriggs
date Tue, 03 Jul 2018 08:22:44 -0400
parents e1ba19551395
children 52052235644b
files amplicon_analysis_pipeline.py
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/amplicon_analysis_pipeline.py	Tue Jul 03 07:20:12 2018 -0400
+++ b/amplicon_analysis_pipeline.py	Tue Jul 03 08:22:44 2018 -0400
@@ -197,8 +197,10 @@
     # Qiime 1.8.0 wants 'RDP_JAR_PATH' env var to point to
     # the rdp_classifier.jar file
     # biconda provides this in the 'share/rdp_classifier/' dir
+    # which is a link to the 'share/rdp_classifier-<VERSION>/' dir
     rdp_classifier = find_executable("rdp_classifier")
     if rdp_classifier:
+        # Generate expected path to JAR file
         rdp_classifier = os.path.normpath(
             os.path.join(os.path.dirname(rdp_classifier),
                          "..",
@@ -206,7 +208,20 @@
                          "rdp_classifier",
                          "rdp_classifier.jar"))
     if rdp_classifier and os.path.exists(rdp_classifier):
-        os.environ["RDP_JAR_PATH"] = rdp_classifier
+        # Get real directory (which contains version)
+        rdp_classifier_dir = os.readlink(
+            os.path.dirname(rdp_classifier))
+        # Extract the version
+        rdp_version = '-'.join(os.path.basename(
+            rdp_classifier_dir).split('-')[1:])
+        # Make a symlink to JAR file with version in the name
+        rdp_jar_path = os.path.join(os.path.abspath("bin"),
+                                    "rdp_classifier-%s.jar" %
+                                    rdp_version)
+        os.symlink(rdp_classifier,rdp_jar_path)
+        print "-- made symlink to %s" % rdp_classifier
+        # Set the RDP_JAR_PATH env var
+        os.environ["RDP_JAR_PATH"] = rdp_jar_path
         print "-- set RDP_JAR_PATH: %s" % os.environ["RDP_JAR_PATH"]
     else:
         sys.stderr.write("Missing 'rdp_classifier.jar'\n")