Commit 1e8b3c2f authored by Peter van 't Hof's avatar Peter van 't Hof Committed by GitHub

Merge pull request #163 from biopet/fix-BIOPET-753

Fixing summary in Basty
parents 5d3b5448 6bda10a5
......@@ -21,9 +21,10 @@ package nl.lumc.sasc.biopet.pipelines.basty
import java.io.File
import nl.lumc.sasc.biopet.core.report.ReportBuilderExtension
import nl.lumc.sasc.biopet.core.{MultiSampleQScript, PipelineCommand}
import nl.lumc.sasc.biopet.extensions.{Cat, Raxml, RunGubbins}
import nl.lumc.sasc.biopet.pipelines.shiva.Shiva
import nl.lumc.sasc.biopet.pipelines.shiva.{Shiva, ShivaReport}
import nl.lumc.sasc.biopet.extensions.tools.BastyGenerateFasta
import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.queue.QScript
......@@ -44,6 +45,8 @@ class Basty(val parent: Configurable) extends QScript with MultiSampleQScript {
val numBoot: Int = config("boot_runs", default = 100, namespace = "raxml").asInt
val executeGubbins: Boolean = config("execute_gubbins", default = true)
override def defaults = Map(
"ploidy" -> 1,
"variantcallers" -> variantcallers
......@@ -51,6 +54,13 @@ class Basty(val parent: Configurable) extends QScript with MultiSampleQScript {
lazy val shiva = new Shiva(qscript)
override def reportClass: Option[ReportBuilderExtension] = {
val shiva = new ShivaReport(this)
shiva.outputDir = new File(outputDir, "report")
shiva.summaryDbFile = summaryDbFile
Some(shiva)
}
def summaryFiles: Map[String, File] = Map()
def summarySettings: Map[String, Any] = Map("boot_runs" -> numBoot)
......@@ -87,17 +97,15 @@ class Basty(val parent: Configurable) extends QScript with MultiSampleQScript {
def init() {
shiva.outputDir = outputDir
shiva.init()
}
def biopetScript() {
shiva.biopetScript()
addAll(shiva.functions)
addSummaryQScript(shiva)
add(shiva)
inputFiles :::= shiva.inputFiles
addSamplesJobs()
addSummaryJobs()
}
def addMultiSampleJobs(): Unit = {
......@@ -186,11 +194,13 @@ class Basty(val parent: Configurable) extends QScript with MultiSampleQScript {
raxmlBi.w = dirSufixRaxml
add(raxmlBi)
val gubbins = new RunGubbins(this)
gubbins.fastafile = concensusVariants
gubbins.startingTree = raxmlBi.getBipartitionsFile
gubbins.outputDirectory = dirSufixGubbins
add(gubbins)
if (executeGubbins) {
val gubbins = new RunGubbins(this)
gubbins.fastafile = concensusVariants
gubbins.startingTree = raxmlBi.getBipartitionsFile
gubbins.outputDirectory = dirSufixGubbins
add(gubbins)
}
}
addTreeJobs(catVariantsSnps.output,
......
......@@ -207,15 +207,18 @@ trait SummaryQScript extends BiopetQScript { qscript: QScript =>
for (inputFile <- inputFiles) {
inputFile.md5 match {
case Some(checksum) =>
val checkMd5 = new CheckChecksum
checkMd5.inputFile = inputFile.file
if (!SummaryQScript.md5sumCache.contains(inputFile.file))
addChecksum(inputFile.file)
checkMd5.checksumFile = SummaryQScript.md5sumCache(inputFile.file)
checkMd5.checksum = checksum
checkMd5.jobOutputFile = new File(checkMd5.checksumFile.getParentFile,
checkMd5.checksumFile.getName + ".check.out")
add(checkMd5)
if (!SummaryQScript.checkChecksumCache.contains(inputFile.file)) {
val checkMd5 = new CheckChecksum
checkMd5.inputFile = inputFile.file
if (!SummaryQScript.md5sumCache.contains(inputFile.file))
addChecksum(inputFile.file)
checkMd5.checksumFile = SummaryQScript.md5sumCache(inputFile.file)
checkMd5.checksum = checksum
checkMd5.jobOutputFile = new File(checkMd5.checksumFile.getParentFile,
checkMd5.checksumFile.getName + ".check.out")
add(checkMd5)
SummaryQScript.checkChecksumCache.add(inputFile.file)
}
case _ =>
}
}
......@@ -238,4 +241,5 @@ object SummaryQScript {
/** Cache to have no duplicate jobs */
protected[summary] val md5sumCache: mutable.Map[File, File] = mutable.Map()
protected[summary] val checkChecksumCache: mutable.Set[File] = mutable.Set()
}
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