Commit 134e9302 authored by Peter van 't Hof's avatar Peter van 't Hof

Added wait step for executable

parent f96791cb
......@@ -121,8 +121,8 @@ trait SummaryQScript extends BiopetQScript { qscript: QScript =>
private def createRun(): Int = {
val db = SummaryDb.openSqliteSummary(summaryDbFile)
val dir = root match {
case q:BiopetQScript => q.outputDir
case _ => throw new IllegalStateException("Root should be a BiopetQscript")
case q: BiopetQScript => q.outputDir
case _ => throw new IllegalStateException("Root should be a BiopetQscript")
}
val id = Await.result(db.createRun(summaryName, dir.getAbsolutePath), Duration.Inf)
runIdFile.getParentFile.mkdir()
......
......@@ -164,23 +164,16 @@ class WriteSummary(val parent: SummaryQScript) extends InProcessFunction with Co
db.createOrUpdateSetting(qscript.summaryRunId, pipelineId, None, None, None, ConfigUtils.mapToJson(q.summarySettings).nospaces)
}
for (
(name, f) <- qscript.functions.flatMap(_ match {
case c: Configurable with Version => Some(c)
case _ => None
}).groupBy(_.configNamespace)
) yield {
f match {
case f: BiopetJavaCommandLineFunction with Version =>
db.createOrUpdateExecutable(qscript.summaryRunId, name, f.getVersion, f.getJavaVersion, javaMd5 = BiopetCommandLineFunction.executableMd5Cache.get(f.executable), jarPath = Some(f.jarFile.getAbsolutePath))
case f: BiopetCommandLineFunction with Version =>
db.createOrUpdateExecutable(qscript.summaryRunId, name, f.getVersion, Option(f.executable))
case f: Configurable with Version =>
db.createOrUpdateExecutable(qscript.summaryRunId, name, f.getVersion)
case _ => None
}
}
(for (f <- qscript.functions.par) yield f match {
case f: BiopetJavaCommandLineFunction with Version =>
Some(db.createOrUpdateExecutable(qscript.summaryRunId, f.configNamespace, f.getVersion, f.getJavaVersion,
javaMd5 = BiopetCommandLineFunction.executableMd5Cache.get(f.executable), jarPath = Some(f.jarFile.getAbsolutePath)))
case f: BiopetCommandLineFunction with Version =>
Some(db.createOrUpdateExecutable(qscript.summaryRunId, f.configNamespace, f.getVersion, Option(f.executable)))
case f: Configurable with Version =>
Some(db.createOrUpdateExecutable(qscript.summaryRunId, f.configNamespace, f.getVersion))
case _ => None
}).flatten.foreach(Await.ready(_, Duration.Inf))
///////////////// OLD //////////////////
for (((name, sampleId, libraryId), summarizables) <- qscript.summarizables; summarizable <- summarizables) {
......
......@@ -215,7 +215,7 @@ class SummaryDb(db: Database) extends Closeable {
/** This return a [[Query]] for [[Settings]] */
private def settingsFilter(runId: Option[Int] = None, pipelineId: Option[Int] = None, moduleId: Option[Option[Int]] = None,
sampleId: Option[Option[Int]] = None, libId: Option[Option[Int]] = None) = {
sampleId: Option[Option[Int]] = None, libId: Option[Option[Int]] = None) = {
var f: Query[Settings, Settings#TableElementType, Seq] = settings
runId.foreach(r => f = f.filter(_.runId === r))
pipelineId.foreach(r => f = f.filter(_.pipelineId === r))
......@@ -249,8 +249,8 @@ class SummaryDb(db: Database) extends Closeable {
/** Return a [[Query]] for [[Files]] */
private def filesFilter(runId: Option[Int] = None, pipelineId: Option[Int] = None, moduleId: Option[Option[Int]],
sampleId: Option[Option[Int]] = None, libId: Option[Option[Int]] = None,
key: Option[String] = None) = {
sampleId: Option[Option[Int]] = None, libId: Option[Option[Int]] = None,
key: Option[String] = None) = {
var f: Query[Files, Files#TableElementType, Seq] = files
runId.foreach(r => f = f.filter(_.runId === r))
pipelineId.foreach(r => f = f.filter(_.pipelineId === r))
......
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