Commit 0e5a2fad authored by bow's avatar bow
Browse files

Add meta information in root of summary

parent 1f77b7e4
...@@ -22,11 +22,11 @@ import scala.io.Source ...@@ -22,11 +22,11 @@ import scala.io.Source
import org.broadinstitute.gatk.queue.function.{ QFunction, InProcessFunction } import org.broadinstitute.gatk.queue.function.{ QFunction, InProcessFunction }
import org.broadinstitute.gatk.utils.commandline.{ Output, Input } import org.broadinstitute.gatk.utils.commandline.{ Output, Input }
import nl.lumc.sasc.biopet.{ LastCommitHash, Version }
import nl.lumc.sasc.biopet.core.{ BiopetJavaCommandLineFunction, BiopetCommandLineFunction, BiopetCommandLineFunctionTrait, SampleLibraryTag } import nl.lumc.sasc.biopet.core.{ BiopetJavaCommandLineFunction, BiopetCommandLineFunction, BiopetCommandLineFunctionTrait, SampleLibraryTag }
import nl.lumc.sasc.biopet.core.config.Configurable import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.utils.ConfigUtils import nl.lumc.sasc.biopet.utils.ConfigUtils
/** /**
* Created by pjvan_thof on 2/14/15. * Created by pjvan_thof on 2/14/15.
*/ */
...@@ -106,9 +106,13 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config ...@@ -106,9 +106,13 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config
(v1: Any, v2: Any, key: String) => summarizable.resolveSummaryConflict(v1, v2, key)) (v1: Any, v2: Any, key: String) => summarizable.resolveSummaryConflict(v1, v2, key))
}).foldRight(pipelineMap)((a, b) => ConfigUtils.mergeMaps(a._1, b, a._2)) }).foldRight(pipelineMap)((a, b) => ConfigUtils.mergeMaps(a._1, b, a._2))
val combinedMap = (for (qscript <- qscript.summaryQScripts) yield { val combinedMap = Map("meta" -> Map(
ConfigUtils.fileToConfigMap(qscript.summaryFile) "last_commit_hash" -> LastCommitHash,
}).foldRight(jobsMap)((a, b) => ConfigUtils.mergeMaps(a, b)) "pipeline_version" -> Version
)) ++
(for (qscript <- qscript.summaryQScripts) yield {
ConfigUtils.fileToConfigMap(qscript.summaryFile)
}).foldRight(jobsMap)((a, b) => ConfigUtils.mergeMaps(a, b))
val writer = new PrintWriter(out) val writer = new PrintWriter(out)
writer.println(ConfigUtils.mapToJson(combinedMap).spaces4) writer.println(ConfigUtils.mapToJson(combinedMap).spaces4)
......
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