Skip to content
Snippets Groups Projects
Commit 7e1495dc authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Implemented sample specific settings in the summary

parent 59e750bf
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,9 @@ trait MultiSampleQScript extends SummaryQScript {
/** Overrules config of qscript with default sample */
val config = new ConfigFunctions(defaultSample = sampleId)
/** Sample specific settings */
def summarySettings: Map[String, Any] = Map()
/** Library class with basic functions build in */
abstract class AbstractLibrary(val libId: String) extends Summarizable {
/** Overrules config of qscript with default sample and default library */
......@@ -45,6 +48,9 @@ trait MultiSampleQScript extends SummaryQScript {
qscript.addSummarizable(summarizable, name, Some(sampleId), Some(libId))
}
/** Library specific settings */
def summarySettings: Map[String, Any] = Map()
/** Adds the library jobs */
final def addAndTrackJobs(): Unit = {
if (nameRegex.findFirstIn(libId) == None)
......
......@@ -18,7 +18,7 @@ package nl.lumc.sasc.biopet.core.summary
import java.io.{ File, PrintWriter }
import nl.lumc.sasc.biopet.utils.config.Configurable
import nl.lumc.sasc.biopet.core.{ Version, BiopetCommandLineFunction, BiopetJavaCommandLineFunction, SampleLibraryTag }
import nl.lumc.sasc.biopet.core._
import nl.lumc.sasc.biopet.utils.ConfigUtils
import nl.lumc.sasc.biopet.{ LastCommitHash, Version }
import org.broadinstitute.gatk.queue.function.{ InProcessFunction, QFunction }
......@@ -99,12 +99,26 @@ class WriteSummary(val root: Configurable) extends InProcessFunction with Config
).toMap
}
val map = Map(qscript.summaryName -> ((if (settings.isEmpty) Map[String, Any]() else Map("settings" -> settings)) ++
(if (files.isEmpty) Map[String, Any]() else Map("files" -> Map("pipeline" -> files))) ++
(if (executables.isEmpty) Map[String, Any]() else Map("executables" -> executables.toMap))))
val map = Map(qscript.summaryName -> (Map(
"settings" -> settings,
"files" -> Map("pipeline" -> files),
"executables" -> executables.toMap))
)
qscript match {
case tag: SampleLibraryTag => prefixSampleLibrary(map, tag.sampleId, tag.libId)
case q:MultiSampleQScript => {
q.samples.map { case (sampleName,sample) =>
sampleName -> Map(
qscript.summaryName -> Map("settings" -> sample.summarySettings),
"libraries" -> sample.libraries.map { case (libName, lib) =>
sampleName -> Map(
qscript.summaryName -> Map("settings" -> lib)
)
}
)
} ++ map
}
case _ => map
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment