Commit e69b6f0c authored by bow's avatar bow

Merge branch 'feature-fix_disable_mpileup' into 'develop'

Feature fix disable mpileup

Small change in pipeline to skip raw caller

See merge request !53
parents 13dd6e6a e03f5bd8
......@@ -94,13 +94,20 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
) yield file
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) {
override protected lazy val configName = "gatkvariantcalling"
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
}
multisampleVariantcalling.preProcesBams = false
multisampleVariantcalling.doublePreProces = false
multisampleVariantcalling.inputBams = allBamfiles.toList
multisampleVariantcalling.rawVcfInput = cvRaw.out
multisampleVariantcalling.outputDir = outputDir + "variantcalling"
multisampleVariantcalling.outputName = "multisample"
multisampleVariantcalling.init
......
......@@ -41,6 +41,7 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
var useHaplotypecaller: Option[Boolean] = config("use_haplotypecaller", default = true)
var useUnifiedGenotyper: Option[Boolean] = config("use_unifiedgenotyper", default = false)
var useAllelesOption: Option[Boolean] = config("use_alleles_option", default = false)
var useMpileup: Boolean = config("use_mpileup", default = true)
var useIndelRealigner: Boolean = config("use_indel_realign", default = true)
var useBaseRecalibration: Boolean = config("use_base_recalibration", default = true)
......@@ -126,27 +127,30 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
}
// Generate raw vcf
if (sampleID != null && scriptOutput.bamFiles.size == 1) {
val m2v = new MpileupToVcf(this)
m2v.inputBam = scriptOutput.bamFiles.head
m2v.sample = sampleID
m2v.output = outputDir + outputName + ".raw.vcf"
add(m2v)
scriptOutput.rawVcfFile = m2v.output
val vcfFilter = new VcfFilter(this)
vcfFilter.defaults ++= Map("min_sample_depth" -> 8,
"min_alternate_depth" -> 2,
"min_samples_pass" -> 1,
"filter_ref_calls" -> true)
vcfFilter.inputVcf = m2v.output
vcfFilter.outputVcf = this.swapExt(outputDir, m2v.output, ".vcf", ".filter.vcf.gz")
add(vcfFilter)
scriptOutput.rawFilterVcfFile = vcfFilter.outputVcf
} else if (rawVcfInput != null) scriptOutput.rawFilterVcfFile = rawVcfInput
if (scriptOutput.rawFilterVcfFile == null) throw new IllegalStateException("Files can't be empty")
mergBuffer += ("9.raw" -> scriptOutput.rawFilterVcfFile)
if (useMpileup) {
if (sampleID != null && scriptOutput.bamFiles.size == 1) {
val m2v = new MpileupToVcf(this)
m2v.inputBam = scriptOutput.bamFiles.head
m2v.sample = sampleID
m2v.output = outputDir + outputName + ".raw.vcf"
add(m2v)
scriptOutput.rawVcfFile = m2v.output
val vcfFilter = new VcfFilter(this)
vcfFilter.defaults ++= Map("min_sample_depth" -> 8,
"min_alternate_depth" -> 2,
"min_samples_pass" -> 1,
"filter_ref_calls" -> true)
vcfFilter.inputVcf = m2v.output
vcfFilter.outputVcf = this.swapExt(outputDir, m2v.output, ".vcf", ".filter.vcf.gz")
add(vcfFilter)
scriptOutput.rawFilterVcfFile = vcfFilter.outputVcf
} else if (rawVcfInput != null) scriptOutput.rawFilterVcfFile = rawVcfInput
if (scriptOutput.rawFilterVcfFile == null) throw new IllegalStateException("Files can't be empty")
mergBuffer += ("9.raw" -> scriptOutput.rawFilterVcfFile)
}
// Allele mode
if (useAllelesOption.get) {
val mergeAlleles = MergeAlleles(this, mergeList.toList, outputDir + "raw.allele__temp_only.vcf.gz")
add(mergeAlleles, isIntermediate = true)
......
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