Commit 73435d56 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Rename data to settings

parent eb8aef93
......@@ -45,7 +45,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
def summaryFiles = Map()
def summaryData = Map()
def summarySettings = Map()
def makeSample(id: String) = new Sample(id)
class Sample(sampleId: String) extends AbstractSample(sampleId) {
......
......@@ -49,7 +49,7 @@ class BamMetrics(val root: Configurable) extends QScript with SummaryQScript wit
def summaryFiles = Map("input_bam" -> inputBam)
def summaryData = Map()
def summarySettings = Map()
def init() {
if (config.contains("target_bed")) {
......
......@@ -2,13 +2,15 @@ package nl.lumc.sasc.biopet.core.summary
import java.io.File
import nl.lumc.sasc.biopet.core.{ SampleLibraryTag, BiopetQScript }
import nl.lumc.sasc.biopet.core.{ BiopetCommandLineFunctionTrait, BiopetCommandLineFunction, SampleLibraryTag, BiopetQScript }
import nl.lumc.sasc.biopet.extensions.Md5sum
import scala.collection.mutable
/**
* Created by pjvan_thof on 2/14/15.
*/
trait SummaryQScript extends BiopetQScript with Summarizable {
trait SummaryQScript extends BiopetQScript {
/** Key is sample/library, None is sample or library is not applicable */
private[summary] var summarizables: Map[(String, Option[String], Option[String]), List[Summarizable]] = Map()
......@@ -16,6 +18,10 @@ trait SummaryQScript extends BiopetQScript with Summarizable {
var summaryName = configName
def summarySettings: Map[String, Any]
def summaryFiles: Map[String, File]
def summaryFile: File
def addSummarizable(summarizable: Summarizable, name: String): Unit = {
......@@ -41,10 +47,7 @@ trait SummaryQScript extends BiopetQScript with Summarizable {
def addSummaryJobs: Unit = {
val writeSummary = new WriteSummary(this)
addSummarizable(this, "pipeline")
//Automatic checksums
for ((_, summarizableList) <- summarizables; summarizable <- summarizableList; (_, file) <- summarizable.summaryFiles) {
def addChecksum(file: File): Unit = {
if (writeSummary.md5sum && !SummaryQScript.md5sumCache.contains(file)) {
val md5sum = Md5sum(this, file)
writeSummary.deps :+= md5sum.output
......@@ -54,8 +57,28 @@ trait SummaryQScript extends BiopetQScript with Summarizable {
//TODO: add more checksums types
}
//Automatic checksums
for ((_, summarizableList) <- summarizables; summarizable <- summarizableList; (_, file) <- summarizable.summaryFiles)
addChecksum(file)
for ((_, sl) <- summarizables) {
for (s <- sl) {
s match {
case c: BiopetCommandLineFunctionTrait => {
executables += c.configName -> (new File(c.executable), c.getVersion)
}
case _ =>
}
}
}
for ((_, file) <- this.summaryFiles)
addChecksum(file)
add(writeSummary)
}
protected[summary] val executables: mutable.Map[String, (File, String)] = mutable.Map()
}
object SummaryQScript {
......
......@@ -47,7 +47,7 @@ class Carp(val root: Configurable) extends QScript with MultiSampleQScript with
def summaryFiles = Map()
def summaryData = Map()
def summarySettings = Map()
def makeSample(id: String) = new Sample(id)
class Sample(sampleId: String) extends AbstractSample(sampleId) {
......
......@@ -48,7 +48,7 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
(if (paired) Map("input_R2" -> input_R2.get, "output_R2" -> outputFiles("output_R2_gzip")) else Map())
}
def summaryData = Map("skip_trim" -> skipTrim, "skip_clip" -> skipClip, "paired" -> paired)
def summarySettings = Map("skip_trim" -> skipTrim, "skip_clip" -> skipClip, "paired" -> paired)
var paired: Boolean = input_R2.isDefined
var R1_ext: String = _
......@@ -136,6 +136,7 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
val seqtkSeq_R1 = SeqtkSeq(this, R1, swapExt(outDir, R1, R1_ext, ".sanger" + R1_ext), fastqc_R1)
seqtkSeq_R1.isIntermediate = true
add(seqtkSeq_R1)
addSummarizable(seqtkSeq_R1, "seqtkSeq_R1")
R1 = seqtkSeq_R1.output
deps ::= R1
......@@ -143,6 +144,7 @@ class Flexiprep(val root: Configurable) extends QScript with SummaryQScript with
val seqtkSeq_R2 = SeqtkSeq(this, R2, swapExt(outDir, R2, R2_ext, ".sanger" + R2_ext), fastqc_R2)
seqtkSeq_R2.isIntermediate = true
add(seqtkSeq_R2)
addSummarizable(seqtkSeq_R2, "seqtkSeq_R2")
R2 = seqtkSeq_R2.output
deps ::= R2
}
......
......@@ -96,7 +96,7 @@ class Mapping(val root: Configurable) extends QScript with SummaryQScript with S
def summaryFiles = Map()
def summaryData = Map()
def summarySettings = Map()
def init() {
require(outputDir != null, "Missing output directory on mapping module")
......
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