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

Added option to disable raw caller

parent 109ff2b3
...@@ -89,17 +89,20 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri ...@@ -89,17 +89,20 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
) yield file ) yield file
val allRawVcfFiles = for ((sampleID, sampleOutput) <- samplesOutput) yield sampleOutput.variantcalling.rawFilterVcfFile val allRawVcfFiles = for ((sampleID, sampleOutput) <- samplesOutput) yield sampleOutput.variantcalling.rawFilterVcfFile
val cvRaw = CombineVariants(this, allRawVcfFiles.toList, outputDir + "variantcalling/multisample.raw.vcf.gz")
add(cvRaw)
val gatkVariantcalling = new GatkVariantcalling(this) { val gatkVariantcalling = new GatkVariantcalling(this) {
override protected lazy val configName = "gatkvariantcalling" override protected lazy val configName = "gatkvariantcalling"
override def configPath: List[String] = "multisample" :: super.configPath override def configPath: List[String] = "multisample" :: super.configPath
} }
if (gatkVariantcalling.useMpileup) {
val cvRaw = CombineVariants(this, allRawVcfFiles.toList, outputDir + "variantcalling/multisample.raw.vcf.gz")
add(cvRaw)
gatkVariantcalling.rawVcfInput = cvRaw.out
}
gatkVariantcalling.preProcesBams = Some(false) gatkVariantcalling.preProcesBams = Some(false)
gatkVariantcalling.doublePreProces = Some(false) gatkVariantcalling.doublePreProces = Some(false)
gatkVariantcalling.inputBams = allBamfiles.toList gatkVariantcalling.inputBams = allBamfiles.toList
gatkVariantcalling.rawVcfInput = cvRaw.out
gatkVariantcalling.outputDir = outputDir + "variantcalling" gatkVariantcalling.outputDir = outputDir + "variantcalling"
gatkVariantcalling.outputName = "multisample" gatkVariantcalling.outputName = "multisample"
gatkVariantcalling.init gatkVariantcalling.init
......
...@@ -41,6 +41,7 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr ...@@ -41,6 +41,7 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
var useHaplotypecaller: Option[Boolean] = config("use_haplotypecaller", default = true) var useHaplotypecaller: Option[Boolean] = config("use_haplotypecaller", default = true)
var useUnifiedGenotyper: Option[Boolean] = config("use_unifiedgenotyper", default = false) var useUnifiedGenotyper: Option[Boolean] = config("use_unifiedgenotyper", default = false)
var useAllelesOption: Option[Boolean] = config("use_alleles_option", default = false) var useAllelesOption: Option[Boolean] = config("use_alleles_option", default = false)
var useMpileup: Option[Boolean] = config("use_mpileup", default = true)
def init() { def init() {
if (outputName == null && sampleID != null) outputName = sampleID if (outputName == null && sampleID != null) outputName = sampleID
...@@ -113,27 +114,30 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr ...@@ -113,27 +114,30 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
} }
// Generate raw vcf // Generate raw vcf
if (sampleID != null && scriptOutput.bamFiles.size == 1) { if (useMpileup) {
val m2v = new MpileupToVcf(this) if (sampleID != null && scriptOutput.bamFiles.size == 1) {
m2v.inputBam = scriptOutput.bamFiles.head val m2v = new MpileupToVcf(this)
m2v.sample = sampleID m2v.inputBam = scriptOutput.bamFiles.head
m2v.output = outputDir + outputName + ".raw.vcf" m2v.sample = sampleID
add(m2v) m2v.output = outputDir + outputName + ".raw.vcf"
scriptOutput.rawVcfFile = m2v.output add(m2v)
scriptOutput.rawVcfFile = m2v.output
val vcfFilter = new VcfFilter(this)
vcfFilter.defaults ++= Map("min_sample_depth" -> 8, val vcfFilter = new VcfFilter(this)
"min_alternate_depth" -> 2, vcfFilter.defaults ++= Map("min_sample_depth" -> 8,
"min_samples_pass" -> 1, "min_alternate_depth" -> 2,
"filter_ref_calls" -> true) "min_samples_pass" -> 1,
vcfFilter.inputVcf = m2v.output "filter_ref_calls" -> true)
vcfFilter.outputVcf = this.swapExt(outputDir, m2v.output, ".vcf", ".filter.vcf.gz") vcfFilter.inputVcf = m2v.output
add(vcfFilter) vcfFilter.outputVcf = this.swapExt(outputDir, m2v.output, ".vcf", ".filter.vcf.gz")
scriptOutput.rawFilterVcfFile = vcfFilter.outputVcf add(vcfFilter)
} else if (rawVcfInput != null) scriptOutput.rawFilterVcfFile = rawVcfInput scriptOutput.rawFilterVcfFile = vcfFilter.outputVcf
if (scriptOutput.rawFilterVcfFile == null) throw new IllegalStateException("Files can't be empty") } else if (rawVcfInput != null) scriptOutput.rawFilterVcfFile = rawVcfInput
mergBuffer += ("9.raw" -> scriptOutput.rawFilterVcfFile) if (scriptOutput.rawFilterVcfFile == null) throw new IllegalStateException("Files can't be empty")
mergBuffer += ("9.raw" -> scriptOutput.rawFilterVcfFile)
}
// Allele mode
if (useAllelesOption.get) { if (useAllelesOption.get) {
val mergeAlleles = MergeAlleles(this, mergeList.toList, outputDir + "raw.allele__temp_only.vcf.gz") val mergeAlleles = MergeAlleles(this, mergeList.toList, outputDir + "raw.allele__temp_only.vcf.gz")
add(mergeAlleles, isIntermediate = true) add(mergeAlleles, isIntermediate = true)
......
Supports Markdown
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