Commit 6075c248 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added qscripts to final output file

parent ebe2bb5f
package nl.lumc.sasc.biopet.core.summary
import java.io.{FileInputStream, PrintWriter, File}
import java.io.{ FileInputStream, PrintWriter, File }
import java.security.MessageDigest
import nl.lumc.sasc.biopet.core.config.Configurable
......@@ -40,10 +40,10 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config
}
def run(): Unit = {
val writer = new PrintWriter(out)
val bla = for (((name, sampleId, libraryId), summarizables) <- summaryQScript.summarizables;
summarizable <- summarizables) yield {
val map = (for (
((name, sampleId, libraryId), summarizables) <- summaryQScript.summarizables;
summarizable <- summarizables
) yield {
val map = Map(name -> parseSummarizable(summarizable))
(sampleId match {
......@@ -52,12 +52,15 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config
case _ => map
})))
case _ => map
}, (v1:Any, v2:Any, key:String) => summarizable.resolveSummaryConflict(v1, v2, key))
}
bla.foldRight(Map[String, Any]())((a, b) => ConfigUtils.mergeMaps(a._1, b, a._2))
}, (v1: Any, v2: Any, key: String) => summarizable.resolveSummaryConflict(v1, v2, key))
}).foldRight(Map[String, Any]())((a, b) => ConfigUtils.mergeMaps(a._1, b, a._2))
//TODO: QScript merging
val combinedMap = (for (qscript <- summaryQScript.summaryQScripts) yield {
ConfigUtils.fileToConfigMap(qscript.summaryFile)
}).foldRight(map)((a, b) => ConfigUtils.mergeMaps(a, b))
val writer = new PrintWriter(out)
writer.println(ConfigUtils.mapToJson(combinedMap).spaces2)
writer.close()
}
......
Supports Markdown
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