Commit 94f9d6bd authored by Peter van 't Hof's avatar Peter van 't Hof

Style changes

parent bdaab956
......@@ -7,8 +7,8 @@ import nl.lumc.sasc.biopet.utils.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
/**
* Created by pjvanthof on 30/03/16.
*/
* Created by pjvanthof on 30/03/16.
*/
class Grep(val root: Configurable) extends BiopetCommandLineFunction {
@Input(doc = "Input file", required = true)
var input: File = _
......
......@@ -274,7 +274,7 @@ class VariantEffectPredictor(val root: Configurable) extends BiopetCommandLineFu
override def resolveSummaryConflict(v1: Any, v2: Any, key: String): Any = {
(v1, v2) match {
case (x1: Int, x2: Int) => x1 + x2
case _ => throw new IllegalStateException("Value are not Int's, unable to sum them up")
case _ => throw new IllegalStateException("Value are not Int's, unable to sum them up")
}
}
......
/**
* 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.
*/
* 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.
*/
package nl.lumc.sasc.biopet.pipelines.toucan
import java.io.File
......@@ -31,10 +31,10 @@ import nl.lumc.sasc.biopet.utils.intervals.BedRecordList
import org.broadinstitute.gatk.queue.QScript
/**
* Pipeline to annotate a vcf file with VEP
*
* Created by ahbbollen on 15-1-15.
*/
* Pipeline to annotate a vcf file with VEP
*
* Created by ahbbollen on 15-1-15.
*/
class Toucan(val root: Configurable) extends QScript with BiopetQScript with SummaryQScript with Reference {
def this() = this(null)
......@@ -78,58 +78,58 @@ class Toucan(val root: Configurable) extends QScript with BiopetQScript with Sum
.scatter(config("bin_size", default = 50000000))
.allRecords.map { region =>
val chunkName = s"${region.chr}-${region.start}-${region.end}"
val chunkDir = new File(outputDir, "chunk" + File.separator + chunkName)
val sv = new SelectVariants(this)
sv.inputFiles :+= useVcf
sv.outputFile = new File(chunkDir, chunkName + ".vcf.gz")
sv.isIntermediate = true
add(sv)
val vep = new VariantEffectPredictor(this)
vep.input = sv.outputFile
vep.output = new File(chunkDir, chunkName + ".vep.vcf")
vep.isIntermediate = true
add(vep)
addSummarizable(vep, "variant_effect_predictor")
val normalizer = new VepNormalizer(this)
normalizer.inputVCF = vep.output
normalizer.outputVcf = new File(chunkDir, chunkName + ".normalized.vcf.gz")
normalizer.isIntermediate = true
add(normalizer)
var outputFile = normalizer.outputVcf
gonlVcfFile match {
case Some(gonlFile) =>
val vcfWithVcf = new VcfWithVcf(this)
vcfWithVcf.input = outputFile
vcfWithVcf.secondaryVcf = gonlFile
vcfWithVcf.output = swapExt(chunkDir, normalizer.outputVcf, ".vcf.gz", ".gonl.vcf.gz")
vcfWithVcf.fields ::= ("AF", "AF_gonl", None)
vcfWithVcf.isIntermediate = true
add(vcfWithVcf)
outputFile = vcfWithVcf.output
case _ =>
val chunkName = s"${region.chr}-${region.start}-${region.end}"
val chunkDir = new File(outputDir, "chunk" + File.separator + chunkName)
val sv = new SelectVariants(this)
sv.inputFiles :+= useVcf
sv.outputFile = new File(chunkDir, chunkName + ".vcf.gz")
sv.isIntermediate = true
add(sv)
val vep = new VariantEffectPredictor(this)
vep.input = sv.outputFile
vep.output = new File(chunkDir, chunkName + ".vep.vcf")
vep.isIntermediate = true
add(vep)
addSummarizable(vep, "variant_effect_predictor")
val normalizer = new VepNormalizer(this)
normalizer.inputVCF = vep.output
normalizer.outputVcf = new File(chunkDir, chunkName + ".normalized.vcf.gz")
normalizer.isIntermediate = true
add(normalizer)
var outputFile = normalizer.outputVcf
gonlVcfFile match {
case Some(gonlFile) =>
val vcfWithVcf = new VcfWithVcf(this)
vcfWithVcf.input = outputFile
vcfWithVcf.secondaryVcf = gonlFile
vcfWithVcf.output = swapExt(chunkDir, normalizer.outputVcf, ".vcf.gz", ".gonl.vcf.gz")
vcfWithVcf.fields ::= ("AF", "AF_gonl", None)
vcfWithVcf.isIntermediate = true
add(vcfWithVcf)
outputFile = vcfWithVcf.output
case _ =>
}
exacVcfFile match {
case Some(exacFile) =>
val vcfWithVcf = new VcfWithVcf(this)
vcfWithVcf.input = outputFile
vcfWithVcf.secondaryVcf = exacFile
vcfWithVcf.output = swapExt(chunkDir, outputFile, ".vcf.gz", ".exac.vcf.gz")
vcfWithVcf.fields ::= ("AF", "AF_exac", None)
vcfWithVcf.isIntermediate = true
add(vcfWithVcf)
outputFile = vcfWithVcf.output
case _ =>
}
outputFile
}
exacVcfFile match {
case Some(exacFile) =>
val vcfWithVcf = new VcfWithVcf(this)
vcfWithVcf.input = outputFile
vcfWithVcf.secondaryVcf = exacFile
vcfWithVcf.output = swapExt(chunkDir, outputFile, ".vcf.gz", ".exac.vcf.gz")
vcfWithVcf.fields ::= ("AF", "AF_exac", None)
vcfWithVcf.isIntermediate = true
add(vcfWithVcf)
outputFile = vcfWithVcf.output
case _ =>
}
outputFile
}
val cv = new CatVariants(this)
cv.inputFiles = outputVcfFiles.toList
cv.outputFile = (gonlVcfFile, exacVcfFile) match {
......@@ -144,14 +144,14 @@ class Toucan(val root: Configurable) extends QScript with BiopetQScript with Sum
}
/**
* Performs the varda import and activate for one sample
*
* @param sampleID the sampleID to be used
* @param inputVcf the input VCF
* @param gVCF the gVCF for coverage
* @param annotation: ManweDownloadAnnotateVcf object of annotated vcf
* @return
*/
* Performs the varda import and activate for one sample
*
* @param sampleID the sampleID to be used
* @param inputVcf the input VCF
* @param gVCF the gVCF for coverage
* @param annotation: ManweDownloadAnnotateVcf object of annotated vcf
* @return
*/
def importAndActivateSample(sampleID: String, sampleGroups: List[String], inputVcf: File,
gVCF: File, annotation: ManweAnnotateVcf): ManweActivateAfterAnnotImport = {
......@@ -215,12 +215,12 @@ class Toucan(val root: Configurable) extends QScript with BiopetQScript with Sum
}
/**
* Perform varda analysis
*
* @param vcf input vcf
* @param gVcf The gVCF to be used for coverage calculations
* @return return vcf
*/
* Perform varda analysis
*
* @param vcf input vcf
* @param gVcf The gVCF to be used for coverage calculations
* @return return vcf
*/
def varda(vcf: File, gVcf: File): File = {
val annotationQueries: List[String] = config("annotation_queries", default = List("GLOBAL *"), namespace = "manwe")
......
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