From 9156f68c45fac30141f2245356b571c31be62b0f Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Mon, 26 Oct 2015 07:58:05 +0100
Subject: [PATCH] Fixed unknown executables

---
 .../sasc/biopet/extensions/gatk/broad/GatkGeneral.scala     | 2 +-
 .../lumc/sasc/biopet/core/BiopetCommandLineFunction.scala   | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/protected/biopet-gatk-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/broad/GatkGeneral.scala b/protected/biopet-gatk-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/broad/GatkGeneral.scala
index c0d8747dd..11b59f2fa 100644
--- a/protected/biopet-gatk-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/broad/GatkGeneral.scala
+++ b/protected/biopet-gatk-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/broad/GatkGeneral.scala
@@ -43,7 +43,7 @@ trait GatkGeneral extends CommandLineGATK with CommandLineResources with Referen
   def versionCommand = "java" + " -jar " + jarFile + " -version"
 
   override def getVersion = {
-    executable = BiopetCommandLineFunction.preProcessExecutable(executable).path
+    BiopetCommandLineFunction.preProcessExecutable(executable).path.foreach(executable = _)
     super.getVersion.collect { case v => "Gatk " + v }
   }
 }
diff --git a/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala b/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala
index d12675210..c0046d053 100644
--- a/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala
+++ b/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala
@@ -99,7 +99,7 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction =>
    */
   protected[core] def preProcessExecutable() {
     val exe = BiopetCommandLineFunction.preProcessExecutable(executable)
-    executable = exe.path
+    exe.path.foreach(executable = _)
     addJobReportBinding("md5sum_exe", exe.md5.getOrElse("N/A"))
   }
 
@@ -199,7 +199,7 @@ object BiopetCommandLineFunction extends Logging {
   private[core] val executableMd5Cache: mutable.Map[String, String] = mutable.Map()
   private[core] val executableCache: mutable.Map[String, String] = mutable.Map()
 
-  case class Executable(path: String, md5: Option[String])
+  case class Executable(path: Option[String], md5: Option[String])
   def preProcessExecutable(executable: String): Executable = {
     if (!BiopetCommandLineFunction.executableMd5Cache.contains(executable)) {
       if (executable != null) {
@@ -236,7 +236,7 @@ object BiopetCommandLineFunction extends Logging {
         }
       }
     }
-    Executable(BiopetCommandLineFunction.executableCache(executable),
+    Executable(BiopetCommandLineFunction.executableCache.get(executable),
       BiopetCommandLineFunction.executableMd5Cache.get(executable))
   }
 }
-- 
GitLab