From 1f620a44248da526c4c7a4fc1275b68923dd99ad Mon Sep 17 00:00:00 2001 From: Peter van 't Hof <p.j.van_t_hof@lumc.nl> Date: Tue, 17 Feb 2015 14:54:13 +0100 Subject: [PATCH] Make all module within one qscript --- .../sasc/biopet/core/summary/SummaryQScript.scala | 2 +- .../sasc/biopet/core/summary/WriteSummary.scala | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/summary/SummaryQScript.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/summary/SummaryQScript.scala index 46583bad8..3efd77ec3 100644 --- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/summary/SummaryQScript.scala +++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/summary/SummaryQScript.scala @@ -41,7 +41,7 @@ trait SummaryQScript extends BiopetQScript with Summarizable { def addSummaryJobs: Unit = { val writeSummary = new WriteSummary(this) - addSummarizable(this, summaryName) + addSummarizable(this, "pipeline") //Automatic checksums for ((_, summarizableList) <- summarizables; summarizable <- summarizableList; (_, file) <- summarizable.summaryFiles) { diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/summary/WriteSummary.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/summary/WriteSummary.scala index e7bcb9f3e..c686109ce 100644 --- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/summary/WriteSummary.scala +++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/summary/WriteSummary.scala @@ -19,20 +19,20 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config require(root.isInstanceOf[SummaryQScript], "root is not a SummaryQScript") - val summaryQScript = root.asInstanceOf[SummaryQScript] + val qscript = root.asInstanceOf[SummaryQScript] @Input(doc = "deps", required = false) var deps: List[File] = Nil @Output(doc = "Summary output", required = true) - var out: File = summaryQScript.summaryFile + var out: File = qscript.summaryFile var md5sum: Boolean = config("summary_md5", default = true) //TODO: add more checksums types override def freezeFieldValues(): Unit = { - for (q <- summaryQScript.summaryQScripts) deps :+= q.summaryFile - for ((_, l) <- summaryQScript.summarizables; s <- l) s match { + for (q <- qscript.summaryQScripts) deps :+= q.summaryFile + for ((_, l) <- qscript.summarizables; s <- l) s match { case f: QFunction => deps :+= f.firstOutput case _ => } @@ -44,10 +44,10 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config def run(): Unit = { val map = (for ( - ((name, sampleId, libraryId), summarizables) <- summaryQScript.summarizables; + ((name, sampleId, libraryId), summarizables) <- qscript.summarizables; summarizable <- summarizables ) yield { - val map = Map(name -> parseSummarizable(summarizable)) + val map = Map(qscript.summaryName ->Map(name -> parseSummarizable(summarizable))) (sampleId match { case Some(sampleId) => Map("samples" -> Map(sampleId -> (libraryId match { @@ -58,7 +58,7 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config }, (v1: Any, v2: Any, key: String) => summarizable.resolveSummaryConflict(v1, v2, key)) }).foldRight(Map[String, Any]())((a, b) => ConfigUtils.mergeMaps(a._1, b, a._2)) - val combinedMap = (for (qscript <- summaryQScript.summaryQScripts) yield { + val combinedMap = (for (qscript <- qscript.summaryQScripts) yield { ConfigUtils.fileToConfigMap(qscript.summaryFile) }).foldRight(map)((a, b) => ConfigUtils.mergeMaps(a, b)) -- GitLab