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

Fix multiple bugs

parent 7f15bd0b
......@@ -4,6 +4,7 @@ import java.io.File
import nl.lumc.sasc.biopet.core.{ PipelineCommand, SampleLibraryTag }
import nl.lumc.sasc.biopet.core.summary.SummaryQScript
import nl.lumc.sasc.biopet.extensions.gatk.CombineVariants
import nl.lumc.sasc.biopet.tools.{ VcfFilter, MpileupToVcf }
import nl.lumc.sasc.biopet.utils.ConfigUtils
import org.broadinstitute.gatk.utils.commandline.Input
......@@ -19,30 +20,45 @@ trait ShivaVariantcallingTrait extends SummaryQScript with SampleLibraryTag {
@Input(doc = "Bam files (should be deduped bams)", shortName = "BAM", required = true)
var inputBams: List[File] = Nil
def init: Unit = {
var namePrefix: String = ""
def init: Unit = {
if (!namePrefix.isEmpty && !namePrefix.endsWith(".")) namePrefix += "."
}
def biopetScript: Unit = {
val cv = new CombineVariants(qscript)
cv.outputFile = new File(outputDir, namePrefix + ".final.vcf.gz")
for (caller <- callers) {
caller.addJobs()
cv.addInput(caller.outputFile, caller.name)
}
add(cv)
addSummaryJobs
}
def callers = List(new RawVcf).filter(_.use)
trait Variantcaller {
val name: String
def outputDir = new File(qscript.outputDir, name)
val defaultUse: Boolean
val use: Boolean = config("use_" + name, default = defaultUse)
val defaultPrio: Int
val prio: Int = config("prio_" + name, default = defaultPrio)
def addJobs(): File
protected val defaultUse: Boolean
lazy val use: Boolean = config("use_" + name, default = defaultUse)
protected val defaultPrio: Int
lazy val prio: Int = config("prio_" + name, default = defaultPrio)
def addJobs()
def outputFile: File
}
class RawVcf extends Variantcaller {
val name = "raw"
val defaultPrio = 999
val defaultUse = true
protected val defaultPrio = 999
protected val defaultUse = true
def outputFile = new File(outputDir, namePrefix + "raw.vcf.gz")
def addJobs(): File = {
def addJobs() {
val rawFiles = inputBams.map(bamFile => {
val m2v = new MpileupToVcf(qscript)
m2v.inputBam = bamFile
......@@ -63,8 +79,10 @@ trait ShivaVariantcallingTrait extends SummaryQScript with SampleLibraryTag {
vcfFilter.outputVcf
})
//TODO: Combine variants
null
val cv = new CombineVariants(qscript)
cv.inputFiles = rawFiles
cv.outputFile = outputFile
add(cv)
}
}
......
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