Skip to content
Snippets Groups Projects
Commit bec375ba authored by bow's avatar bow
Browse files

Merge branch 'feature-unittest_core' into 'develop'

Flexiprep unit test + fix for small bugs

See subject

See merge request !94
parents faa0baaf d04c7f03
No related branches found
No related tags found
No related merge requests found
Showing
with 248 additions and 75 deletions
#
# Biopet is built on top of GATK Queue for building bioinformatic
# pipelines. It is mainly intended to support LUMC SHARK cluster which is running
# SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
# should also be able to execute Biopet tools and pipelines.
#
# Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
#
# Contact us at: sasc@lumc.nl
#
# A dual licensing mode is applied. The source code within this project that are
# not part of GATK Queue is freely available for non-commercial use under an AGPL
# license; For commercial users or users who do not want to follow the AGPL
# license, please contact us to obtain a separate license.
#
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=ERROR, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p [%d] [%C{1}] - %m%n
\ No newline at end of file
......@@ -60,28 +60,34 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
}
def addMultiSampleJobs(): Unit = {
val refVariants = addGenerateFasta(null, outputDir + "reference/", outputName = "reference")
val refVariantSnps = addGenerateFasta(null, outputDir + "reference/", outputName = "reference", snpsOnly = true)
val refVariants = addGenerateFasta(null, new File(outputDir, "reference"), outputName = "reference")
val refVariantSnps = addGenerateFasta(null, new File(outputDir, "reference"), outputName = "reference", snpsOnly = true)
val catVariants = Cat(this, refVariants.variants :: samples.map(_._2.output.variants).toList, outputDir + "fastas/variant.fasta")
val catVariants = Cat(this, refVariants.variants :: samples.map(_._2.output.variants).toList,
new File(outputDir, "fastas" + File.separator + "variant.fasta"))
add(catVariants)
val catVariantsSnps = Cat(this, refVariantSnps.variants :: samples.map(_._2.outputSnps.variants).toList, outputDir + "fastas/variant.snps_only.fasta")
val catVariantsSnps = Cat(this, refVariantSnps.variants :: samples.map(_._2.outputSnps.variants).toList,
new File(outputDir, "fastas" + File.separator + "variant.snps_only.fasta"))
add(catVariantsSnps)
val catConsensus = Cat(this, refVariants.consensus :: samples.map(_._2.output.consensus).toList, outputDir + "fastas/consensus.fasta")
val catConsensus = Cat(this, refVariants.consensus :: samples.map(_._2.output.consensus).toList,
new File(outputDir, "fastas" + File.separator + "consensus.fasta"))
add(catConsensus)
val catConsensusSnps = Cat(this, refVariantSnps.consensus :: samples.map(_._2.outputSnps.consensus).toList, outputDir + "fastas/consensus.snps_only.fasta")
val catConsensusSnps = Cat(this, refVariantSnps.consensus :: samples.map(_._2.outputSnps.consensus).toList,
new File(outputDir, "fastas" + File.separator + "consensus.snps_only.fasta"))
add(catConsensusSnps)
val catConsensusVariants = Cat(this, refVariants.consensusVariants :: samples.map(_._2.output.consensusVariants).toList, outputDir + "fastas/consensus.variant.fasta")
val catConsensusVariants = Cat(this, refVariants.consensusVariants :: samples.map(_._2.output.consensusVariants).toList,
new File(outputDir, "fastas" + File.separator + "consensus.variant.fasta"))
add(catConsensusVariants)
val catConsensusVariantsSnps = Cat(this, refVariantSnps.consensusVariants :: samples.map(_._2.outputSnps.consensusVariants).toList, outputDir + "fastas/consensus.variant.snps_only.fasta")
val catConsensusVariantsSnps = Cat(this, refVariantSnps.consensusVariants :: samples.map(_._2.outputSnps.consensusVariants).toList,
new File(outputDir, "fastas" + File.separator + "consensus.variant.snps_only.fasta"))
add(catConsensusVariantsSnps)
val seed: Int = config("seed", default = 12345)
def addTreeJobs(variants: File, concensusVariants: File, outputDir: String, outputName: String) {
val dirSufixRaxml = if (outputDir.endsWith(File.separator)) "raxml" else File.separator + "raxml"
val dirSufixGubbins = if (outputDir.endsWith(File.separator)) "gubbins" else File.separator + "gubbins"
def addTreeJobs(variants: File, concensusVariants: File, outputDir: File, outputName: String) {
val dirSufixRaxml = new File(outputDir, "raxml")
val dirSufixGubbins = new File(outputDir, "gubbins")
val raxmlMl = new Raxml(this)
raxmlMl.input = variants
......@@ -101,7 +107,7 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
raxmlBoot.m = config("raxml_ml_model", default = "GTRGAMMAX")
raxmlBoot.p = seed
raxmlBoot.b = math.abs(r.nextInt)
raxmlBoot.w = outputDir + dirSufixRaxml
raxmlBoot.w = dirSufixRaxml
raxmlBoot.N = 1
raxmlBoot.n = outputName + "_boot_" + t
add(raxmlBoot)
......@@ -125,16 +131,18 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
val gubbins = new RunGubbins(this)
gubbins.fastafile = concensusVariants
gubbins.startingTree = Some(raxmlBi.getBipartitionsFile)
gubbins.outputDirectory = outputDir + dirSufixGubbins
gubbins.outputDirectory = dirSufixGubbins
add(gubbins)
}
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")
addTreeJobs(catVariantsSnps.output, catConsensusVariantsSnps.output,
new File(outputDir, "trees" + File.separator + "snps_only"), "snps_only")
addTreeJobs(catVariants.output, catConsensusVariants.output,
new File(outputDir, "trees" + File.separator + "snps_indels"), "snps_indels")
}
def addGenerateFasta(sampleName: String, outputDir: String, outputName: String = null,
def addGenerateFasta(sampleName: String, outputDir: File, outputName: String = null,
snpsOnly: Boolean = false): FastaOutput = {
val bastyGenerateFasta = new BastyGenerateFasta(this)
bastyGenerateFasta.outputName = if (outputName != null) outputName else sampleName
......
#
# Biopet is built on top of GATK Queue for building bioinformatic
# pipelines. It is mainly intended to support LUMC SHARK cluster which is running
# SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
# should also be able to execute Biopet tools and pipelines.
#
# Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
#
# Contact us at: sasc@lumc.nl
#
# A dual licensing mode is applied. The source code within this project that are
# not part of GATK Queue is freely available for non-commercial use under an AGPL
# license; For commercial users or users who do not want to follow the AGPL
# license, please contact us to obtain a separate license.
#
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=ERROR, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p [%d] [%C{1}] - %m%n
\ No newline at end of file
......@@ -11,8 +11,8 @@ import nl.lumc.sasc.biopet.core.config.Configurable
class ApplyRecalibration(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.ApplyRecalibration with GatkGeneral {
scatterCount = config("scattercount", default = 0)
override def afterGraph {
super.afterGraph
override def beforeGraph {
super.beforeGraph
nt = Option(getThreads(3))
memoryLimit = Option(nt.getOrElse(1) * 2)
......
......@@ -22,7 +22,7 @@ object BaseRecalibrator {
val br = new BaseRecalibrator(root)
br.input_file :+= input
br.out = output
br.afterGraph
br.beforeGraph
return br
}
}
\ No newline at end of file
......@@ -35,13 +35,13 @@ class HaplotypeCaller(val root: Configurable) extends org.broadinstitute.gatk.qu
stand_emit_conf = config("stand_emit_conf", default = 0)
}
override def afterGraph {
super.afterGraph
override def beforeGraph {
super.beforeGraph
if (bamOutput != null && nct.getOrElse(1) > 1) {
threads = 1
logger.warn("BamOutput is on, nct/threads is forced to set on 1, this option is only for debug")
}
nct = Some(threads)
nct = Some(getThreads(1))
memoryLimit = Option(memoryLimit.getOrElse(2.0) * nct.getOrElse(1))
}
......
......@@ -13,7 +13,7 @@ class IndelRealigner(val root: Configurable) extends org.broadinstitute.gatk.que
}
object IndelRealigner {
def apply(root: Configurable, input: File, targetIntervals: File, outputDir: String): IndelRealigner = {
def apply(root: Configurable, input: File, targetIntervals: File, outputDir: File): IndelRealigner = {
val ir = new IndelRealigner(root)
ir.input_file :+= input
ir.targetIntervals = targetIntervals
......
......@@ -18,7 +18,7 @@ class RealignerTargetCreator(val root: Configurable) extends org.broadinstitute.
}
object RealignerTargetCreator {
def apply(root: Configurable, input: File, outputDir: String): RealignerTargetCreator = {
def apply(root: Configurable, input: File, outputDir: File): RealignerTargetCreator = {
val re = new RealignerTargetCreator(root)
re.input_file :+= input
re.out = new File(outputDir, input.getName.stripSuffix(".bam") + ".realign.intervals")
......
......@@ -8,14 +8,14 @@ package nl.lumc.sasc.biopet.extensions.gatk
import nl.lumc.sasc.biopet.core.config.Configurable
class UnifiedGenotyper(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.UnifiedGenotyper with GatkGeneral {
override def afterGraph {
super.afterGraph
override def beforeGraph {
super.beforeGraph
genotype_likelihoods_model = org.broadinstitute.gatk.tools.walkers.genotyper.GenotypeLikelihoodsCalculationModel.Model.BOTH
if (config.contains("scattercount")) scatterCount = config("scattercount")
if (config.contains("dbsnp")) this.dbsnp = config("dbsnp")
this.sample_ploidy = config("ploidy")
nct = config("threads", default = 1)
nct = Some(getThreads(1))
memoryLimit = Option(nct.getOrElse(1) * 2)
if (config.contains("allSitePLs")) this.allSitePLs = config("allSitePLs")
if (config.contains("output_mode")) {
......
......@@ -9,8 +9,8 @@ import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
class VariantEval(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.VariantEval with GatkGeneral {
override def afterGraph {
super.afterGraph
override def beforeGraph {
super.beforeGraph
}
}
......@@ -21,7 +21,7 @@ object VariantEval {
vareval.eval = Seq(sample)
vareval.comp = Seq(compareWith)
vareval.out = output
vareval.afterGraph
vareval.beforeGraph
return vareval
}
......@@ -35,7 +35,7 @@ object VariantEval {
vareval.ST = ST
vareval.noEV = true
vareval.EV = EV
vareval.afterGraph
vareval.beforeGraph
return vareval
}
......
#
# Biopet is built on top of GATK Queue for building bioinformatic
# pipelines. It is mainly intended to support LUMC SHARK cluster which is running
# SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
# should also be able to execute Biopet tools and pipelines.
#
# Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
#
# Contact us at: sasc@lumc.nl
#
# A dual licensing mode is applied. The source code within this project that are
# not part of GATK Queue is freely available for non-commercial use under an AGPL
# license; For commercial users or users who do not want to follow the AGPL
# license, please contact us to obtain a separate license.
#
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=ERROR, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p [%d] [%C{1}] - %m%n
\ No newline at end of file
......@@ -29,11 +29,8 @@ class GatkBenchmarkGenotyping(val root: Configurable) extends QScript with Biope
var dbsnp: File = config("dbsnp")
def init() {
if (config.contains("gvcffiles")) for (file <- config("gvcffiles").asList) {
if (config.contains("gvcffiles")) for (file <- config("gvcffiles").asList)
gvcfFiles ::= file.toString
}
if (outputDir == null) throw new IllegalStateException("Missing Output directory on gatk module")
else if (!outputDir.endsWith("/")) outputDir += "/"
}
def biopetScript() {
......@@ -53,7 +50,7 @@ class GatkBenchmarkGenotyping(val root: Configurable) extends QScript with Biope
val gatkGenotyping = new GatkGenotyping(this)
gatkGenotyping.inputGvcfs = sampleGvcf :: gvcfPool
gatkGenotyping.samples :+= sampleName
gatkGenotyping.outputDir = outputDir + "samples_" + gvcfPool.size + "/"
gatkGenotyping.outputDir = new File(outputDir, "samples_" + gvcfPool.size)
gatkGenotyping.init
gatkGenotyping.biopetScript
addAll(gatkGenotyping.functions)
......
......@@ -33,16 +33,15 @@ class GatkGenotyping(val root: Configurable) extends QScript with BiopetQScript
var samples: List[String] = Nil
def init() {
if (outputFile == null) outputFile = outputDir + outputName + ".vcf.gz"
if (outputDir == null) throw new IllegalStateException("Missing Output directory on gatk module")
else if (!outputDir.endsWith("/")) outputDir += "/"
require(outputName != null, "Outputname is null")
if (outputFile == null) outputFile = new File(outputDir, outputName + ".vcf.gz")
}
def biopetScript() {
addGenotypeGVCFs(inputGvcfs, outputFile)
if (!samples.isEmpty) {
if (samples.size > 1) addSelectVariants(outputFile, samples, outputDir + "samples/", "all")
for (sample <- samples) addSelectVariants(outputFile, List(sample), outputDir + "samples/", sample)
if (samples.size > 1) addSelectVariants(outputFile, samples, new File(outputDir, "samples/"), "all")
for (sample <- samples) addSelectVariants(outputFile, List(sample), new File(outputDir, "samples/"), sample)
}
}
......@@ -52,8 +51,8 @@ class GatkGenotyping(val root: Configurable) extends QScript with BiopetQScript
return genotypeGVCFs.out
}
def addSelectVariants(inputFile: File, samples: List[String], outputDir: String, name: String) {
val selectVariants = SelectVariants(this, inputFile, outputDir + name + ".vcf.gz")
def addSelectVariants(inputFile: File, samples: List[String], outputDir: File, name: String) {
val selectVariants = SelectVariants(this, inputFile, new File(outputDir, name + ".vcf.gz"))
selectVariants.excludeNonVariants = true
for (sample <- samples) selectVariants.sample_name :+= sample
add(selectVariants)
......
......@@ -47,13 +47,13 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
val mapping = new Mapping(qscript)
mapping.sampleId = sampleId
mapping.libId = libId
mapping.outputDir = libDir + "/variantcalling/"
mapping.outputDir = libDir
/** Library variantcalling */
val gatkVariantcalling = new GatkVariantcalling(qscript)
gatkVariantcalling.doublePreProces = false
gatkVariantcalling.sampleID = sampleId
gatkVariantcalling.outputDir = libDir
gatkVariantcalling.outputDir = new File(libDir, "variantcalling")
protected def addJobs(): Unit = {
val bamFile: Option[File] = if (config.contains("R1")) {
......@@ -124,7 +124,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
/** sample variantcalling */
val gatkVariantcalling = new GatkVariantcalling(qscript)
gatkVariantcalling.sampleID = sampleId
gatkVariantcalling.outputDir = sampleDir + "/variantcalling/"
gatkVariantcalling.outputDir = new File(sampleDir, "variantcalling/")
protected def addJobs(): Unit = {
addPerLibJobs()
......@@ -143,8 +143,6 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
}
def init() {
if (outputDir == null) throw new IllegalStateException("Missing Output directory on gatk module")
else if (!outputDir.endsWith("/")) outputDir += "/"
}
val multisampleVariantcalling = new GatkVariantcalling(this) {
......@@ -158,7 +156,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
def addMultiSampleJobs(): Unit = {
val gvcfFiles: List[File] = if (mergeGvcfs && externalGvcfs.size + samples.size > 1) {
val newFile = outputDir + "merged.gvcf.vcf.gz"
val newFile = new File(outputDir, "merged.gvcf.vcf.gz")
add(CombineGVCFs(this, externalGvcfs ++ samples.map(_._2.gatkVariantcalling.scriptOutput.gvcfFile), newFile))
List(newFile)
} else externalGvcfs ++ samples.map(_._2.gatkVariantcalling.scriptOutput.gvcfFile)
......@@ -167,7 +165,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
if (jointGenotyping) {
val gatkGenotyping = new GatkGenotyping(this)
gatkGenotyping.inputGvcfs = gvcfFiles
gatkGenotyping.outputDir = outputDir + "genotyping/"
gatkGenotyping.outputDir = new File(outputDir, "genotyping")
gatkGenotyping.init
gatkGenotyping.biopetScript
addAll(gatkGenotyping.functions)
......@@ -185,7 +183,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
}
if (gatkVariantcalling.useMpileup) {
val cvRaw = CombineVariants(this, allRawVcfFiles.toList, outputDir + "variantcalling/multisample.raw.vcf.gz")
val cvRaw = CombineVariants(this, allRawVcfFiles.toList, new File(outputDir, "variantcalling/multisample.raw.vcf.gz"))
add(cvRaw)
gatkVariantcalling.rawVcfInput = cvRaw.out
}
......@@ -193,7 +191,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
multisampleVariantcalling.preProcesBams = false
multisampleVariantcalling.doublePreProces = false
multisampleVariantcalling.inputBams = allBamfiles.toList
multisampleVariantcalling.outputDir = outputDir + "variantcalling"
multisampleVariantcalling.outputDir = new File(outputDir, "variantcalling")
multisampleVariantcalling.outputName = "multisample"
multisampleVariantcalling.init
multisampleVariantcalling.biopetScript
......@@ -203,7 +201,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
val recalibration = new GatkVariantRecalibration(this)
recalibration.inputVcf = multisampleVariantcalling.scriptOutput.finalVcfFile
recalibration.bamFiles = allBamfiles
recalibration.outputDir = outputDir + "recalibration/"
recalibration.outputDir = new File(outputDir, "recalibration")
recalibration.init
recalibration.biopetScript
}
......
......@@ -26,9 +26,7 @@ class GatkVariantRecalibration(val root: Configurable) extends QScript with Biop
var outputVcf: File = _
def init() {
if (inputVcf == null) throw new IllegalStateException("Missing Output directory on gatk module")
if (outputDir == null) throw new IllegalStateException("Missing Output directory on gatk module")
else if (!outputDir.endsWith("/")) outputDir += "/"
require(inputVcf != null, "Missing Output directory on gatk module")
}
def biopetScript() {
......@@ -37,7 +35,7 @@ class GatkVariantRecalibration(val root: Configurable) extends QScript with Biop
vcfFile = addIndelVariantRecalibrator(vcfFile, outputDir)
}
def addSnpVariantRecalibrator(inputVcf: File, dir: String): File = {
def addSnpVariantRecalibrator(inputVcf: File, dir: File): File = {
val snpRecal = VariantRecalibrator(this, inputVcf, swapExt(dir, inputVcf, ".vcf", ".indel.recal"),
swapExt(dir, inputVcf, ".vcf", ".indel.tranches"), indel = false)
if (!snpRecal.resource.isEmpty) {
......@@ -54,7 +52,7 @@ class GatkVariantRecalibration(val root: Configurable) extends QScript with Biop
}
}
def addIndelVariantRecalibrator(inputVcf: File, dir: String): File = {
def addIndelVariantRecalibrator(inputVcf: File, dir: File): File = {
val indelRecal = VariantRecalibrator(this, inputVcf, swapExt(dir, inputVcf, ".vcf", ".indel.recal"),
swapExt(dir, inputVcf, ".vcf", ".indel.tranches"), indel = true)
if (!indelRecal.resource.isEmpty) {
......@@ -71,7 +69,7 @@ class GatkVariantRecalibration(val root: Configurable) extends QScript with Biop
}
}
def addVariantAnnotator(inputvcf: File, bamfiles: List[File], dir: String): File = {
def addVariantAnnotator(inputvcf: File, bamfiles: List[File], dir: File): File = {
val variantAnnotator = VariantAnnotator(this, inputvcf, bamfiles, swapExt(dir, inputvcf, ".vcf", ".anotated.vcf"))
add(variantAnnotator)
return variantAnnotator.out
......
......@@ -52,8 +52,6 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
def init() {
if (outputName == null && sampleID != null) outputName = sampleID
else if (outputName == null) outputName = config("output_name", default = "noname")
if (outputDir == null) throw new IllegalStateException("Missing Output directory on gatk module")
else if (!outputDir.endsWith("/")) outputDir += "/"
val baseRecalibrator = new BaseRecalibrator(this)
if (preProcesBams && useBaseRecalibration && baseRecalibrator.knownSites.isEmpty) {
......@@ -66,7 +64,7 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
if (files.isEmpty) throw new IllegalStateException("Files can't be empty")
else if (!doublePreProces) files
else if (files.size == 1) {
val bamFile: File = outputDir + files.head.getName
val bamFile = new File(outputDir, files.head.getName)
if (bamFile != files.head) {
val oldIndex: File = files.head.getAbsolutePath.stripSuffix(".bam") + ".bai"
val newIndex: File = bamFile.getAbsolutePath.stripSuffix(".bam") + ".bai"
......@@ -113,20 +111,20 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
val hcGvcf = new HaplotypeCaller(this)
hcGvcf.useGvcf
hcGvcf.input_file = scriptOutput.bamFiles
hcGvcf.out = outputDir + outputName + ".hc.discovery.gvcf.vcf.gz"
hcGvcf.out = new File(outputDir, outputName + ".hc.discovery.gvcf.vcf.gz")
add(hcGvcf)
scriptOutput.gvcfFile = hcGvcf.out
}
if (useHaplotypecaller) {
if (sampleID != null) {
val genotypeGVCFs = GenotypeGVCFs(this, List(scriptOutput.gvcfFile), outputDir + outputName + ".hc.discovery.vcf.gz")
val genotypeGVCFs = GenotypeGVCFs(this, List(scriptOutput.gvcfFile), new File(outputDir, outputName + ".hc.discovery.vcf.gz"))
add(genotypeGVCFs)
scriptOutput.hcVcfFile = genotypeGVCFs.out
} else {
val hcGvcf = new HaplotypeCaller(this)
hcGvcf.input_file = scriptOutput.bamFiles
hcGvcf.out = outputDir + outputName + ".hc.discovery.vcf.gz"
hcGvcf.out = new File(outputDir, outputName + ".hc.discovery.vcf.gz")
add(hcGvcf)
scriptOutput.hcVcfFile = hcGvcf.out
}
......@@ -136,7 +134,7 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
if (useUnifiedGenotyper) {
val ugVcf = new UnifiedGenotyper(this)
ugVcf.input_file = scriptOutput.bamFiles
ugVcf.out = outputDir + outputName + ".ug.discovery.vcf.gz"
ugVcf.out = new File(outputDir, outputName + ".ug.discovery.vcf.gz")
add(ugVcf)
scriptOutput.ugVcfFile = ugVcf.out
mergBuffer += ("2.UG-Discovery" -> scriptOutput.ugVcfFile)
......@@ -148,7 +146,7 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
val m2v = new MpileupToVcf(this)
m2v.inputBam = scriptOutput.bamFiles.head
m2v.sample = sampleID
m2v.output = outputDir + outputName + ".raw.vcf"
m2v.output = new File(outputDir, outputName + ".raw.vcf")
add(m2v)
scriptOutput.rawVcfFile = m2v.output
......@@ -160,7 +158,7 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
), super.defaults)
}
vcfFilter.inputVcf = m2v.output
vcfFilter.outputVcf = this.swapExt(outputDir, m2v.output, ".vcf", ".filter.vcf.gz")
vcfFilter.outputVcf = swapExt(outputDir, m2v.output, ".vcf", ".filter.vcf.gz")
add(vcfFilter)
scriptOutput.rawFilterVcfFile = vcfFilter.outputVcf
} else if (rawVcfInput != null) scriptOutput.rawFilterVcfFile = rawVcfInput
......@@ -176,7 +174,7 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
if (useHaplotypecaller) {
val hcAlleles = new HaplotypeCaller(this)
hcAlleles.input_file = scriptOutput.bamFiles
hcAlleles.out = outputDir + outputName + ".hc.allele.vcf.gz"
hcAlleles.out = new File(outputDir, outputName + ".hc.allele.vcf.gz")
hcAlleles.alleles = mergeAlleles.output
hcAlleles.genotyping_mode = org.broadinstitute.gatk.tools.walkers.genotyper.GenotypingOutputMode.GENOTYPE_GIVEN_ALLELES
add(hcAlleles)
......@@ -187,7 +185,7 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
if (useUnifiedGenotyper) {
val ugAlleles = new UnifiedGenotyper(this)
ugAlleles.input_file = scriptOutput.bamFiles
ugAlleles.out = outputDir + outputName + ".ug.allele.vcf.gz"
ugAlleles.out = new File(outputDir, outputName + ".ug.allele.vcf.gz")
ugAlleles.alleles = mergeAlleles.output
ugAlleles.genotyping_mode = org.broadinstitute.gatk.tools.walkers.genotyper.GenotypingOutputMode.GENOTYPE_GIVEN_ALLELES
add(ugAlleles)
......@@ -206,32 +204,32 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
sv.out
}
val cvFinal = CombineVariants(this, mergeList.toList, outputDir + outputName + ".final.vcf.gz")
val cvFinal = CombineVariants(this, mergeList.toList, new File(outputDir, outputName + ".final.vcf.gz"))
cvFinal.genotypemergeoption = org.broadinstitute.gatk.utils.variant.GATKVariantContextUtils.GenotypeMergeType.UNSORTED
add(cvFinal)
val vcfStats = new VcfStats(this)
vcfStats.input = cvFinal.out
vcfStats.setOutputDir(outputDir + File.separator + "vcfstats")
vcfStats.setOutputDir(new File(outputDir, "vcfstats"))
add(vcfStats)
scriptOutput.finalVcfFile = cvFinal.out
}
}
def addIndelRealign(inputBam: File, dir: String, isIntermediate: Boolean = true): File = {
def addIndelRealign(inputBam: File, dir: File, isIntermediate: Boolean = true): File = {
val realignerTargetCreator = RealignerTargetCreator(this, inputBam, dir)
realignerTargetCreator.isIntermediate = true
add(realignerTargetCreator)
val indelRealigner = IndelRealigner.apply(this, inputBam, realignerTargetCreator.out, dir)
val indelRealigner = IndelRealigner(this, inputBam, realignerTargetCreator.out, dir)
indelRealigner.isIntermediate = isIntermediate
add(indelRealigner)
return indelRealigner.o
}
def addBaseRecalibrator(inputBam: File, dir: String, isIntermediate: Boolean = false): File = {
def addBaseRecalibrator(inputBam: File, dir: File, isIntermediate: Boolean = false): File = {
val baseRecalibrator = BaseRecalibrator(this, inputBam, swapExt(dir, inputBam, ".bam", ".baserecal"))
if (baseRecalibrator.knownSites.isEmpty) {
......
#
# Biopet is built on top of GATK Queue for building bioinformatic
# pipelines. It is mainly intended to support LUMC SHARK cluster which is running
# SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
# should also be able to execute Biopet tools and pipelines.
#
# Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
#
# Contact us at: sasc@lumc.nl
#
# A dual licensing mode is applied. The source code within this project that are
# not part of GATK Queue is freely available for non-commercial use under an AGPL
# license; For commercial users or users who do not want to follow the AGPL
# license, please contact us to obtain a separate license.
#
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=ERROR, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p [%d] [%C{1}] - %m%n
\ No newline at end of file
#
# Biopet is built on top of GATK Queue for building bioinformatic
# pipelines. It is mainly intended to support LUMC SHARK cluster which is running
# SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
# should also be able to execute Biopet tools and pipelines.
#
# Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
#
# Contact us at: sasc@lumc.nl
#
# A dual licensing mode is applied. The source code within this project that are
# not part of GATK Queue is freely available for non-commercial use under an AGPL
# license; For commercial users or users who do not want to follow the AGPL
# license, please contact us to obtain a separate license.
#
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=ERROR, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p [%d] [%C{1}] - %m%n
\ No newline at end of file
#
# Biopet is built on top of GATK Queue for building bioinformatic
# pipelines. It is mainly intended to support LUMC SHARK cluster which is running
# SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
# should also be able to execute Biopet tools and pipelines.
#
# Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
#
# Contact us at: sasc@lumc.nl
#
# A dual licensing mode is applied. The source code within this project that are
# not part of GATK Queue is freely available for non-commercial use under an AGPL
# license; For commercial users or users who do not want to follow the AGPL
# license, please contact us to obtain a separate license.
#
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=ERROR, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p [%d] [%C{1}] - %m%n
\ No newline at end of file
#
# Biopet is built on top of GATK Queue for building bioinformatic
# pipelines. It is mainly intended to support LUMC SHARK cluster which is running
# SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
# should also be able to execute Biopet tools and pipelines.
#
# Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
#
# Contact us at: sasc@lumc.nl
#
# A dual licensing mode is applied. The source code within this project that are
# not part of GATK Queue is freely available for non-commercial use under an AGPL
# license; For commercial users or users who do not want to follow the AGPL
# license, please contact us to obtain a separate license.
#
# Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=ERROR, A1
# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-5p [%d] [%C{1}] - %m%n
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment