Commit 5f8a8375 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Implemented addMultisampleJobs method

parent a9f86490
......@@ -41,7 +41,7 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
var outputSnps: FastaOutput = _
protected def addJobs(): Unit = {
addLibsJobs()
addPerLibJobs()
output = addGenerateFasta(sampleId, sampleDir)
outputSnps = addGenerateFasta(sampleId, sampleDir, snpsOnly = true)
}
......@@ -56,11 +56,13 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
gatkPipeline.biopetScript
addAll(gatkPipeline.functions)
addPerSampleJobs()
}
def addMultiSampleJobs(): Unit = {
val refVariants = addGenerateFasta(null, outputDir + "reference/", outputName = "reference")
val refVariantSnps = addGenerateFasta(null, outputDir + "reference/", outputName = "reference", snpsOnly = true)
addSamplesJobs()
val catVariants = Cat(this, refVariants.variants :: samples.map(_._2.output.variants).toList, outputDir + "fastas/variant.fasta")
add(catVariants)
val catVariantsSnps = Cat(this, refVariantSnps.variants :: samples.map(_._2.outputSnps.variants).toList, outputDir + "fastas/variant.snps_only.fasta")
......@@ -129,6 +131,7 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
addTreeJobs(catVariantsSnps.output, catConsensusVariantsSnps.output, outputDir + "trees" + File.separator + "snps_only", "snps_only")
addTreeJobs(catVariants.output, catConsensusVariants.output, outputDir + "trees" + File.separator + "snps_indels", "snps_indels")
}
def addGenerateFasta(sampleName: String, outputDir: String, outputName: String = null,
......
......@@ -127,7 +127,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
gatkVariantcalling.outputDir = sampleDir + "/variantcalling/"
protected def addJobs(): Unit = {
addLibsJobs()
addPerLibJobs()
gatkVariantcalling.inputBams = libraries.map(_._2.mapping.finalBamFile).toList
gatkVariantcalling.preProcesBams = false
if (!singleSampleCalling) {
......@@ -150,10 +150,11 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
override def configPath: List[String] = super.configPath ::: "multisample" :: Nil
}
def biopetScript() {
addSamplesJobs
def biopetScript(): Unit = {
addPerSampleJobs
}
//SampleWide jobs
def addMultiSampleJobs(): Unit = {
val gvcfFiles: List[File] = if (mergeGvcfs && externalGvcfs.size + samples.size > 1) {
val newFile = outputDir + "merged.gvcf.vcf.gz"
add(CombineGVCFs(this, externalGvcfs ++ samples.map(_._2.gatkVariantcalling.scriptOutput.gvcfFile), newFile))
......
......@@ -37,6 +37,9 @@ class MultisamplePipelineTemplate(val root: Configurable) extends QScript with M
}
}
def addMultiSampleJobs(): Unit = {
}
def init(): Unit = {
}
......
......@@ -67,7 +67,7 @@ class Carp(val root: Configurable) extends QScript with MultiSampleQScript {
val controls: List[String] = config("control", default = Nil)
def addJobs(): Unit = {
addLibsJobs()
addPerLibJobs()
val bamFiles = libraries.map(_._2.mapping.finalBamFile).toList
if (bamFiles.length == 1) {
add(Ln(qscript, bamFiles.head, bamFile))
......@@ -102,8 +102,10 @@ class Carp(val root: Configurable) extends QScript with MultiSampleQScript {
// Third step is calling peaks on the bam files produced with the mapping pipeline, this will be done with MACS2
logger.info("Starting CArP pipeline")
addSamplesJobs
addPerSampleJobs
}
def addMultiSampleJobs(): Unit = {
for ((sampleId, sample) <- samples) {
for (controlId <- sample.controls) {
if (!samples.contains(controlId))
......
......@@ -103,7 +103,7 @@ class Sage(val root: Configurable) extends QScript with MultiSampleQScript {
}
protected def addJobs(): Unit = {
addLibsJobs()
addPerLibJobs()
val libraryBamfiles = libraries.map(_._2.mapping.finalBamFile).toList
val libraryFastqFiles = libraries.map(_._2.prefixFastq).toList
......@@ -151,7 +151,10 @@ class Sage(val root: Configurable) extends QScript with MultiSampleQScript {
tagsLibrary = cdl.output
}
addSamplesJobs
addPerSampleJobs
}
def addMultiSampleJobs(): Unit = {
}
def addBedtoolsCounts(bamFile: File, outputPrefix: String, outputDir: String) {
......
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