From 5431faa6af0bf16c1bf68f6e5abcf5a4f324ab03 Mon Sep 17 00:00:00 2001
From: David Emms <david_emms@hotmail.com>
Date: Wed, 7 Sep 2016 09:55:50 +0100
Subject: [PATCH] Exit gracefully if orthologue dependencies not met

---
 orthofinder/scripts/get_orthologues.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/orthofinder/scripts/get_orthologues.py b/orthofinder/scripts/get_orthologues.py
index 82e32d7..3cf29a7 100755
--- a/orthofinder/scripts/get_orthologues.py
+++ b/orthofinder/scripts/get_orthologues.py
@@ -476,7 +476,7 @@ def CanRunDependencies(workingDir):
     if os.path.exists(outFN): os.remove(outFN)        
     if not util.CanRunCommand("fastme -i %s -o %s" % (testFN, outFN), qAllowStderr=False):
         print("ERROR: Cannot run fastme")
-        print("Please check FastME is installed and that the executables are in the system path\n")
+        print("Please check FastME is installed and that the executables are in the system path.\n")
         return False
     os.remove(testFN)
     os.remove(outFN)
@@ -485,7 +485,7 @@ def CanRunDependencies(workingDir):
     # DLCPar
     if not util.CanRunCommand("dlcpar_search --version", qAllowStderr=False):
         print("ERROR: Cannot run dlcpar_search")
-        print("Please check DLCpar is installed and that the executables are in the system path\n")
+        print("Please check DLCpar is installed and that the executables are in the system path.\n")
         return False
     return True    
         
@@ -535,7 +535,10 @@ def GetOrthologues(orthofinderWorkingDir, orthofinderResultsDir, clustersFilenam
 
     print("\n1. Checking required programs are installed")
     print(  "-------------------------------------------")
-    if not CanRunDependencies(orthofinderWorkingDir): util.Fail()   
+    if not CanRunDependencies(orthofinderWorkingDir): 
+        print("Orthogroups have been inferred but the dependencies for inferring gene trees and\northologues have not been met. Please review previous messages for more information.")
+        sys.exit()
+        
     
     print("\n2. Reading sequence similarity scores")
     print(  "-------------------------------------")
-- 
GitLab