Commit 2a67db54 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added version check for pipe jobs

parent 1f0fcf1a
......@@ -5,7 +5,7 @@
*/
package nl.lumc.sasc.biopet.extensions.gatk.broad
import nl.lumc.sasc.biopet.core.{Version, CommandLineResources, Reference, BiopetJavaCommandLineFunction}
import nl.lumc.sasc.biopet.core.{ Version, CommandLineResources, Reference, BiopetJavaCommandLineFunction }
import org.broadinstitute.gatk.engine.phonehome.GATKRunReport
import org.broadinstitute.gatk.queue.extensions.gatk.CommandLineGATK
......
......@@ -51,6 +51,9 @@ class BiopetFifoPipe(val root: Configurable,
deps :::= inputs.values.toList.flatten.filter(!fifoFiles.contains(_))
deps = deps.distinct
pipesJobs :::= commands
pipesJobs = pipesJobs.distinct
}
override def beforeCmd(): Unit = {
......
......@@ -71,23 +71,29 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config
val files = parseFiles(qscript.summaryFiles)
val settings = qscript.summarySettings
val executables: Map[String, Any] = {
(for (f <- qscript.functions if f.isInstanceOf[BiopetCommandLineFunction]) yield {
def fetchVersion(f: QFunction): Option[(String, Any)] = {
f match {
case f: BiopetJavaCommandLineFunction with Version =>
f.configName -> Map("version" -> f.getVersion.getOrElse(None),
Some(f.configName -> Map("version" -> f.getVersion.getOrElse(None),
"java_md5" -> BiopetCommandLineFunction.executableMd5Cache.getOrElse(f.executable, None),
"java_version" -> f.getJavaVersion,
"jar_path" -> f.jarFile)
"jar_path" -> f.jarFile))
case f: BiopetCommandLineFunction with Version =>
f.configName -> Map("version" -> f.getVersion.getOrElse(None),
Some(f.configName -> Map("version" -> f.getVersion.getOrElse(None),
"md5" -> BiopetCommandLineFunction.executableMd5Cache.getOrElse(f.executable, None),
"path" -> f.executable)
"path" -> f.executable))
case f: Configurable with Version =>
f.configName -> Map("version" -> f.getVersion.getOrElse(None))
case _ => throw new IllegalStateException("This should not be possible")
Some(f.configName -> Map("version" -> f.getVersion.getOrElse(None)))
case _ => None
}
}
}).toMap
(
qscript.functions.flatMap(fetchVersion(_)) ++
qscript.functions.flatMap { case f: BiopetCommandLineFunction => f.pipesJobs }
.flatMap(fetchVersion(_))
).toMap
}
val map = Map(qscript.summaryName -> ((if (settings.isEmpty) Map[String, Any]() else Map("settings" -> settings)) ++
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment