Commit e88b3068 authored by Wai Yi Leung's avatar Wai Yi Leung
Browse files

Merge branch 'fix-warns' into 'develop'

Fix warns

Going to try to fix most of the code warnings from the IDE
Also going to optimise imports for the whole repository

See merge request !187
parents 29a61dfe c1acac57
......@@ -9,7 +9,6 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>nl.lumc.sasc</groupId>
<artifactId>BiopetGatkExtensions</artifactId>
<packaging>jar</packaging>
......
......@@ -6,6 +6,7 @@
package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
class AnalyzeCovariates(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.AnalyzeCovariates with GatkGeneral {
......@@ -17,6 +18,6 @@ object AnalyzeCovariates {
ac.before = before
ac.after = after
ac.plots = plots
return ac
ac
}
}
\ No newline at end of file
......@@ -6,13 +6,14 @@
package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
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 beforeGraph {
super.beforeGraph
override def beforeGraph() {
super.beforeGraph()
nt = Option(getThreads(3))
memoryLimit = Option(nt.getOrElse(1) * 2)
......@@ -36,6 +37,6 @@ object ApplyRecalibration {
ar.recal_file = recal_file
ar.tranches_file = tranches_file
ar.out = output
return ar
ar
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@
package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
class BaseRecalibrator(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.BaseRecalibrator with GatkGeneral {
......@@ -19,7 +20,7 @@ object BaseRecalibrator {
val br = new BaseRecalibrator(root)
br.input_file :+= input
br.out = output
br.beforeGraph
return br
br.beforeGraph()
br
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@
package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
class CombineGVCFs(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.CombineGVCFs with GatkGeneral {
......@@ -17,6 +18,6 @@ object CombineGVCFs {
val cg = new CombineGVCFs(root)
cg.variant = input
cg.o = output
return cg
cg
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@
package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
class CombineVariants(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.CombineVariants with GatkGeneral {
......@@ -17,6 +18,6 @@ object CombineVariants {
val cv = new CombineVariants(root)
cv.variant = input
cv.out = output
return cv
cv
}
}
\ No newline at end of file
......@@ -5,7 +5,7 @@
*/
package nl.lumc.sasc.biopet.extensions.gatk.broad
import nl.lumc.sasc.biopet.core.{ Reference, BiopetJavaCommandLineFunction }
import nl.lumc.sasc.biopet.core.{ BiopetJavaCommandLineFunction, Reference }
import org.broadinstitute.gatk.queue.extensions.gatk.CommandLineGATK
trait GatkGeneral extends CommandLineGATK with BiopetJavaCommandLineFunction with Reference {
......@@ -27,10 +27,10 @@ trait GatkGeneral extends CommandLineGATK with BiopetJavaCommandLineFunction wit
override def versionExitcode = List(0, 1)
override def versionCommand = executable + " -jar " + jarFile + " -version"
override def getVersion = super.getVersion.collect { case version => "Gatk " + version }
override def getVersion = super.getVersion.collect { case v => "Gatk " + v }
override def beforeGraph: Unit = {
super.beforeGraph
override def beforeGraph(): Unit = {
super.beforeGraph()
if (reference_sequence == null) reference_sequence = referenceFasta()
}
}
......@@ -6,6 +6,7 @@
package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
class GenotypeGVCFs(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.GenotypeGVCFs with GatkGeneral {
......@@ -28,6 +29,6 @@ object GenotypeGVCFs {
val gg = new GenotypeGVCFs(root)
gg.variant = gvcfFiles
gg.out = output
return gg
gg
}
}
\ No newline at end of file
......@@ -35,8 +35,8 @@ class HaplotypeCaller(val root: Configurable) extends org.broadinstitute.gatk.qu
stand_emit_conf = config("stand_emit_conf", default = 0)
}
override def beforeGraph {
super.beforeGraph
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")
......
......@@ -6,6 +6,7 @@
package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
class IndelRealigner(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.IndelRealigner with GatkGeneral {
......@@ -18,6 +19,6 @@ object IndelRealigner {
ir.input_file :+= input
ir.targetIntervals = targetIntervals
ir.out = new File(outputDir, input.getName.stripSuffix(".bam") + ".realign.bam")
return ir
ir
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@
package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
class PrintReads(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.PrintReads with GatkGeneral {
......@@ -17,6 +18,6 @@ object PrintReads {
val br = new PrintReads(root)
br.input_file :+= input
br.out = output
return br
br
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@
package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
class RealignerTargetCreator(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.RealignerTargetCreator with GatkGeneral {
......@@ -19,6 +20,6 @@ object RealignerTargetCreator {
val re = new RealignerTargetCreator(root)
re.input_file :+= input
re.out = new File(outputDir, input.getName.stripSuffix(".bam") + ".realign.intervals")
return re
re
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@
package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
class SelectVariants(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.SelectVariants with GatkGeneral {
......@@ -17,6 +18,6 @@ object SelectVariants {
val sv = new SelectVariants(root)
sv.variant = input
sv.out = output
return sv
sv
}
}
\ No newline at end of file
......@@ -26,8 +26,8 @@ class UnifiedGenotyper(val root: Configurable) extends org.broadinstitute.gatk.q
}
}
override def beforeGraph {
super.beforeGraph
override def beforeGraph() {
super.beforeGraph()
genotype_likelihoods_model = org.broadinstitute.gatk.tools.walkers.genotyper.GenotypeLikelihoodsCalculationModel.Model.BOTH
nct = Some(getThreads(1))
......
......@@ -6,6 +6,7 @@
package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
class VariantAnnotator(val root: Configurable) extends org.broadinstitute.gatk.queue.extensions.gatk.VariantAnnotator with GatkGeneral {
......@@ -19,6 +20,6 @@ object VariantAnnotator {
va.variant = input
va.input_file = bamFiles
va.out = output
return va
va
}
}
\ No newline at end of file
......@@ -6,11 +6,12 @@
package nl.lumc.sasc.biopet.extensions.gatk.broad
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 beforeGraph {
super.beforeGraph
override def beforeGraph() {
super.beforeGraph()
}
}
......@@ -21,8 +22,8 @@ object VariantEval {
vareval.eval = Seq(sample)
vareval.comp = Seq(compareWith)
vareval.out = output
vareval.beforeGraph
return vareval
vareval.beforeGraph()
vareval
}
def apply(root: Configurable, sample: File, compareWith: File,
......@@ -35,8 +36,8 @@ object VariantEval {
vareval.ST = ST
vareval.noEV = true
vareval.EV = EV
vareval.beforeGraph
return vareval
vareval.beforeGraph()
vareval
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@
package nl.lumc.sasc.biopet.extensions.gatk.broad
import java.io.File
import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.queue.extensions.gatk.TaggedFile
......@@ -38,6 +39,6 @@ object VariantRecalibrator {
vr.input :+= input
vr.recal_file = recal_file
vr.tranches_file = tranches_file
return vr
vr
}
}
\ No newline at end of file
......@@ -9,7 +9,6 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>nl.lumc.sasc</groupId>
<artifactId>BiopetGatkPipelines</artifactId>
<packaging>jar</packaging>
......
......@@ -11,6 +11,8 @@ import nl.lumc.sasc.biopet.pipelines.basty.BastyTrait
import org.broadinstitute.gatk.queue.QScript
/**
* Basty pipeline including GATK steps
*
* Created by pjvan_thof on 3/4/15.
*/
class Basty(val root: Configurable) extends QScript with BastyTrait {
......
......@@ -5,10 +5,10 @@
*/
package nl.lumc.sasc.biopet.pipelines.gatk
import nl.lumc.sasc.biopet.core.{ BiopetQScript, PipelineCommand }
import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.core.{ BiopetQScript, PipelineCommand }
import org.broadinstitute.gatk.queue.QScript
import org.broadinstitute.gatk.utils.commandline.{ Input, Argument }
import scala.util.Random
class GatkBenchmarkGenotyping(val root: Configurable) extends QScript with BiopetQScript {
......@@ -38,7 +38,7 @@ class GatkBenchmarkGenotyping(val root: Configurable) extends QScript with Biope
var gvcfPool: List[File] = Nil
addGenotypingPipeline(gvcfPool)
while (todoGvcfs.size > 0) {
while (todoGvcfs.nonEmpty) {
val index = Random.nextInt(todoGvcfs.size)
gvcfPool ::= todoGvcfs(index)
addGenotypingPipeline(gvcfPool)
......@@ -51,8 +51,8 @@ class GatkBenchmarkGenotyping(val root: Configurable) extends QScript with Biope
gatkGenotyping.inputGvcfs = sampleGvcf :: gvcfPool
gatkGenotyping.samples :+= sampleName
gatkGenotyping.outputDir = new File(outputDir, "samples_" + gvcfPool.size)
gatkGenotyping.init
gatkGenotyping.biopetScript
gatkGenotyping.init()
gatkGenotyping.biopetScript()
addAll(gatkGenotyping.functions)
}
}
......
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