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

Added wait step for executable

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