changeset 18:039c45c01b47 draft

Uploaded
author petr-novak
date Tue, 24 Sep 2019 07:27:56 -0400
parents 1a766f9f623d
children b34483adf8f0
files dante.py dante_gff_to_dna.xml
diffstat 2 files changed, 30 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/dante.py	Mon Sep 16 03:54:45 2019 -0400
+++ b/dante.py	Tue Sep 24 07:27:56 2019 -0400
@@ -414,34 +414,35 @@
 
 def get_version(path, LAST_DB):
     '''Return version is run from git repository '''
-    try:
-        branch = subprocess.check_output("git rev-parse --abbrev-ref HEAD",
-                                         shell=True,
-                                         cwd=path).decode('ascii').strip()
-        shorthash = subprocess.check_output("git log --pretty=format:'%h' -n 1  ",
-                                            shell=True,
-                                            cwd=path).decode('ascii').strip()
-        revcount = len(subprocess.check_output("git log --oneline",
-                                               shell=True,
-                                               cwd=path).decode('ascii').split())
-        version_string = (
-            "##-----------------------------------------------\n"
-            "##PIPELINE VERSION         : "
-            "{branch}-rv-{revcount}({shorthash})\n"
-            "##PROTEIN DATABASE VERSION : {PD}\n"
-            "##-----------------------------------------------\n").format(
-                branch=branch,
-                shorthash=shorthash,
-                revcount=revcount,
-                PD=os.path.basename(LAST_DB))
-    except:
-        version_string = (
-            "##-----------------------------------------------\n"
-            "##PROTEIN DATABASE VERSION : {PD}\n"
-            "##-----------------------------------------------\n").format(
-                PD=os.path.basename(LAST_DB)
-            )
-
+    version_string = (
+        "##-----------------------------------------------\n"
+        "##PROTEIN DATABASE VERSION : {PD}\n"
+        "##-----------------------------------------------\n").format(
+            PD=os.path.basename(LAST_DB)
+        )
+    if os.path.exists(".git"):
+        try:
+            branch = subprocess.check_output("git rev-parse --abbrev-ref HEAD",
+                                             shell=True,
+                                             cwd=path).decode('ascii').strip()
+            shorthash = subprocess.check_output("git log --pretty=format:'%h' -n 1  ",
+                                                shell=True,
+                                                cwd=path).decode('ascii').strip()
+            revcount = len(subprocess.check_output("git log --oneline",
+                                                   shell=True,
+                                                   cwd=path).decode('ascii').split())
+            version_string = (
+                "##-----------------------------------------------\n"
+                "##PIPELINE VERSION         : "
+                "{branch}-rv-{revcount}({shorthash})\n"
+                "##PROTEIN DATABASE VERSION : {PD}\n"
+                "##-----------------------------------------------\n").format(
+                    branch=branch,
+                    shorthash=shorthash,
+                    revcount=revcount,
+                    PD=os.path.basename(LAST_DB))
+        except:
+            pass
     return version_string
 
 
--- a/dante_gff_to_dna.xml	Mon Sep 16 03:54:45 2019 -0400
+++ b/dante_gff_to_dna.xml	Tue Sep 24 07:27:56 2019 -0400
@@ -22,7 +22,7 @@
 	  <param format="fasta" type="data" name="input_dna" label="Input DNA" help="Choose input DNA sequence(s) to extract the domains from" />
 	  <param format="gff" type="data" name="domains_gff" label="Protein domains GFF" help="Choose filtered protein domains GFF3 (DANTE's output)" />
 	  <param name="db_type" type="select" label="Select taxon and protein domain database version (REXdb)" help="">
-      <options from_file="rexdb_versions.txt">
+      <options from_file="rexdb_versions.loc">
         <column name="name" index="0"/>
         <column name="value" index="1"/>
       </options>