Commit d6c031ab authored by Sander Bollen's avatar Sander Bollen

create gcc jobs in samples in stead of multisample jobs

parent 8b928f5c
......@@ -114,21 +114,15 @@ class Tarmac(val parent: Configurable) extends QScript with PedigreeQscript with
}
def createWisecondorReferenceJobs(referenceSamples: Set[Sample], outputDirectory: File): List[QFunction] = {
val gccs = referenceSamples.map { x =>
val gcc = new WisecondorGcCorrect(this)
x.outputWisecondorCountFile foreach { file => gcc.inputBed = file }
gcc.output = new File(outputDirectory, s"${x.sampleId}.gcc")
gcc
}
val gccs = referenceSamples.map(_.outputWisecondorGccFile).collect { case \/-(file) => file }.toList
val reference = new WisecondorNewRef(this)
reference.inputBeds = gccs.map(_.output).toList
reference.inputBeds = gccs
reference.output = new File(outputDirectory, "reference.bed")
reference.isIntermediate = true
val gzipRef = new Gzip(this)
gzipRef.input = List(reference.output)
gzipRef.output = new File(outputDirectory, "reference.bed.gz")
gccs.toList ::: reference :: gzipRef :: Nil
reference :: gzipRef :: Nil
}
class Sample(name: String) extends AbstractSample(name) {
......@@ -214,9 +208,26 @@ class Tarmac(val parent: Configurable) extends QScript with PedigreeQscript with
}
}
protected lazy val outputWisecondorGccJob: String \/ QFunction = {
val outFile = new File(sampleDir + File.separator + s"$name.wisecondor.gcc")
outputWisecondorCountFile map { bedFile =>
val gcc = new WisecondorGcCorrect(root)
gcc.inputBed = bedFile
gcc.output = outFile
gcc
}
}
lazy val outputWisecondorGccFile: String \/ File = {
outputWisecondorGccJob match {
case \/-(gcc: WisecondorGcCorrect) => \/-(gcc.output)
case -\/(error) => -\/(error)
}
}
/** Function to add sample jobs */
def addJobs(): Unit = {
(outputWisecondorCountJob :: outputXhmmCountJob :: Nil).foreach {
(outputWisecondorGccJob :: outputWisecondorCountJob :: outputXhmmCountJob :: Nil).foreach {
case -\/(error) => Logging.addError(error)
case \/-(function) => add(function)
}
......
......@@ -2,7 +2,7 @@ package nl.lumc.sasc.biopet.pipelines.tarmac
import nl.lumc.sasc.biopet.extensions.Ln
import nl.lumc.sasc.biopet.extensions.gatk.DepthOfCoverage
import nl.lumc.sasc.biopet.extensions.wisecondor.{ WisecondorCount, WisecondorNewRef }
import nl.lumc.sasc.biopet.extensions.wisecondor.{WisecondorCount, WisecondorGcCorrect, WisecondorNewRef}
import nl.lumc.sasc.biopet.extensions.xhmm.XhmmMergeGatkDepths
import nl.lumc.sasc.biopet.utils.ConfigUtils
import nl.lumc.sasc.biopet.utils.config.Config
......@@ -48,6 +48,7 @@ class TarmacTest extends TestNGSuite with Matchers {
script.samples.size shouldBe 7
script.functions.count(_.isInstanceOf[WisecondorCount]) shouldBe 7
script.functions.count(_.isInstanceOf[DepthOfCoverage]) shouldBe 7
script.functions.count(_.isInstanceOf[WisecondorGcCorrect]) shouldBe 7
val script2 = initPipeline(ConfigUtils.mergeMaps(samplesWithCount, settings))
script2.init()
......@@ -56,6 +57,7 @@ class TarmacTest extends TestNGSuite with Matchers {
script2.functions.count(_.isInstanceOf[WisecondorCount]) shouldBe 0
script2.functions.count(_.isInstanceOf[DepthOfCoverage]) shouldBe 0
script2.functions.count(_.isInstanceOf[Ln]) shouldBe 14
script2.functions.count(_.isInstanceOf[WisecondorGcCorrect]) shouldBe 7
}
@Test
......
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