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

Fixing compile and code warnings

parent 23f8f923
...@@ -116,22 +116,22 @@ class VariantAnnotator(val parent: Configurable) extends CommandLineGATK with Sc ...@@ -116,22 +116,22 @@ class VariantAnnotator(val parent: Configurable) extends CommandLineGATK with Sc
outputIndex = VcfUtils.getVcfIndexFile(out) outputIndex = VcfUtils.getVcfIndexFile(out)
} }
override def cmdLine = super.cmdLine + override def cmdLine: String = super.cmdLine +
required(TaggedFile.formatCommandLineParameter("-V", variant), variant, spaceSeparated = true, escape = true, format = "%s") + required(TaggedFile.formatCommandLineParameter("-V", variant), variant) +
optional(TaggedFile.formatCommandLineParameter("-snpEffFile", snpEffFile.getOrElse()), snpEffFile, spaceSeparated = true, escape = true, format = "%s") + optional(TaggedFile.formatCommandLineParameter("-snpEffFile", snpEffFile.getOrElse(new File("."))), snpEffFile) +
optional(TaggedFile.formatCommandLineParameter("-D", dbsnp.getOrElse()), dbsnp, spaceSeparated = true, escape = true, format = "%s") + optional(TaggedFile.formatCommandLineParameter("-D", dbsnp.getOrElse(new File("."))), dbsnp) +
repeat("-comp", comp, formatPrefix = TaggedFile.formatCommandLineParameter, spaceSeparated = true, escape = true, format = "%s") + repeat("-comp", comp, formatPrefix = TaggedFile.formatCommandLineParameter) +
repeat("-resource", resource, formatPrefix = TaggedFile.formatCommandLineParameter, spaceSeparated = true, escape = true, format = "%s") + repeat("-resource", resource, formatPrefix = TaggedFile.formatCommandLineParameter) +
optional("-o", out, spaceSeparated = true, escape = true, format = "%s") + optional("-o", out) +
repeat("-A", annotation, spaceSeparated = true, escape = true, format = "%s") + repeat("-A", annotation) +
repeat("-XA", excludeAnnotation, spaceSeparated = true, escape = true, format = "%s") + repeat("-XA", excludeAnnotation) +
repeat("-G", group, spaceSeparated = true, escape = true, format = "%s") + repeat("-G", group) +
repeat("-E", expression, spaceSeparated = true, escape = true, format = "%s") + repeat("-E", expression) +
conditional(resourceAlleleConcordance, "-rac", escape = true, format = "%s") + conditional(resourceAlleleConcordance, "-rac") +
conditional(useAllAnnotations, "-all", escape = true, format = "%s") + conditional(useAllAnnotations, "-all") +
conditional(alwaysAppendDbsnpId, "-alwaysAppendDbsnpId", escape = true, format = "%s") + conditional(alwaysAppendDbsnpId, "-alwaysAppendDbsnpId") +
optional("-mvq", MendelViolationGenotypeQualityThreshold, spaceSeparated = true, escape = true, format = MendelViolationGenotypeQualityThresholdFormat) + optional("-mvq", MendelViolationGenotypeQualityThreshold, format = MendelViolationGenotypeQualityThresholdFormat) +
conditional(filter_reads_with_N_cigar, "-filterRNC", escape = true, format = "%s") + conditional(filter_reads_with_N_cigar, "-filterRNC") +
conditional(filter_mismatching_base_and_quals, "-filterMBQ", escape = true, format = "%s") + conditional(filter_mismatching_base_and_quals, "-filterMBQ") +
conditional(filter_bases_not_stored, "-filterNoBases", escape = true, format = "%s") conditional(filter_bases_not_stored, "-filterNoBases")
} }
...@@ -28,7 +28,7 @@ object Question { ...@@ -28,7 +28,7 @@ object Question {
if (posibleValues.nonEmpty) println(s"possible values: ${posibleValues.mkString(", ")}") if (posibleValues.nonEmpty) println(s"possible values: ${posibleValues.mkString(", ")}")
default.foreach(x => println(s"Default value: $x")) default.foreach(x => println(s"Default value: $x"))
print(s"$name > ") print(s"$name > ")
(Console.readLine.trim, default) match { (scala.io.StdIn.readLine.trim, default) match {
case (a, Some(d)) if a.isEmpty => d case (a, Some(d)) if a.isEmpty => d
case (a, None) if a.isEmpty => case (a, None) if a.isEmpty =>
println("ERROR: Value is required") println("ERROR: Value is required")
...@@ -50,7 +50,7 @@ object Question { ...@@ -50,7 +50,7 @@ object Question {
description.foreach(println) description.foreach(println)
default.foreach(x => println(s"Default value: $x")) default.foreach(x => println(s"Default value: $x"))
print(s"$name (y/n) > ") print(s"$name (y/n) > ")
Console.readLine.trim.toLowerCase match { scala.io.StdIn.readLine.trim.toLowerCase match {
case "" => case "" =>
default match { default match {
case Some(d) => d case Some(d) => d
...@@ -75,7 +75,7 @@ object Question { ...@@ -75,7 +75,7 @@ object Question {
if (posibleValues.nonEmpty) println(s"possible values: ${posibleValues.mkString(", ")}") if (posibleValues.nonEmpty) println(s"possible values: ${posibleValues.mkString(", ")}")
default.foreach(x => println(s"Default value: $x")) default.foreach(x => println(s"Default value: $x"))
print(s"$name > ") print(s"$name > ")
(Console.readLine.split(",").toList.map(_.trim), default) match { (scala.io.StdIn.readLine.split(",").toList.map(_.trim), default) match {
case (List(""), Some(d)) => d case (List(""), Some(d)) => d
case (List(""), None) => case (List(""), None) =>
println("ERROR: Value is required") println("ERROR: Value is required")
......
...@@ -523,7 +523,6 @@ class SummaryDbWrite(val db: Database)(implicit val ec: ExecutionContext) extend ...@@ -523,7 +523,6 @@ class SummaryDbWrite(val db: Database)(implicit val ec: ExecutionContext) extend
/** This method will create all tables */ /** This method will create all tables */
def createTables(): Unit = { def createTables(): Unit = {
try {
val setup = DBIO.seq( val setup = DBIO.seq(
(runs.schema ++ samples.schema ++ (runs.schema ++ samples.schema ++
libraries.schema ++ pipelines.schema ++ libraries.schema ++ pipelines.schema ++
...@@ -533,7 +532,6 @@ class SummaryDbWrite(val db: Database)(implicit val ec: ExecutionContext) extend ...@@ -533,7 +532,6 @@ class SummaryDbWrite(val db: Database)(implicit val ec: ExecutionContext) extend
val setupFuture = db.run(setup) val setupFuture = db.run(setup)
Await.result(setupFuture, Duration.Inf) Await.result(setupFuture, Duration.Inf)
} }
}
/** This method will create a new run and return the runId */ /** This method will create a new run and return the runId */
def createRun(runName: String, def createRun(runName: String,
......
...@@ -68,14 +68,14 @@ class Tarmac(val parent: Configurable) ...@@ -68,14 +68,14 @@ class Tarmac(val parent: Configurable)
) )
} }
def init() = {} def init(): Unit = {}
def biopetScript() = { def biopetScript(): Unit = {
addSamplesJobs() addSamplesJobs()
addSummaryJobs() addSummaryJobs()
} }
def addMultiSampleJobs() = { def addMultiSampleJobs(): Unit = {
val initRefMap = samples map { val initRefMap = samples map {
case (sampleName, sample) => sample -> getReferenceSamplesForSample(sampleName) case (sampleName, sample) => sample -> getReferenceSamplesForSample(sampleName)
} }
...@@ -383,7 +383,7 @@ class Tarmac(val parent: Configurable) ...@@ -383,7 +383,7 @@ class Tarmac(val parent: Configurable)
*/ */
def createXhmmReferenceJobs(sample: Sample, def createXhmmReferenceJobs(sample: Sample,
referenceSamples: Set[Sample], referenceSamples: Set[Sample],
outputDirectory: File): Tuple2[List[QFunction], File] = { outputDirectory: File): (List[QFunction], File) = {
/* XHMM requires refset including self */ /* XHMM requires refset including self */
val totalSet = referenceSamples + sample val totalSet = referenceSamples + sample
val merger = new XhmmMergeGatkDepths(this) val merger = new XhmmMergeGatkDepths(this)
...@@ -431,7 +431,7 @@ class Tarmac(val parent: Configurable) ...@@ -431,7 +431,7 @@ class Tarmac(val parent: Configurable)
zscore zscore
} }
def createXhmmZscore(sample: Sample, referenceMatrix: File): Tuple2[List[QFunction], File] = { def createXhmmZscore(sample: Sample, referenceMatrix: File): (List[QFunction], File) = {
// the filtered and centered matrix // the filtered and centered matrix
val filtMatrix = new XhmmMatrix(this) val filtMatrix = new XhmmMatrix(this)
...@@ -494,7 +494,7 @@ class Tarmac(val parent: Configurable) ...@@ -494,7 +494,7 @@ class Tarmac(val parent: Configurable)
protected lazy val outputXhmmCountJob: String \/ QFunction = { protected lazy val outputXhmmCountJob: String \/ QFunction = {
val outFile = new File(xhmmDir, s"$name.dcov") val outFile = new File(xhmmDir, s"$name.dcov")
(inputXhmmCountFile, bamFile) match { (inputXhmmCountFile, bamFile) match {
case (Some(f), _) => { case (Some(f), _) =>
if (bamFile.isDefined) { if (bamFile.isDefined) {
logger.warn( logger.warn(
s"Both BAM and Xhmm count files are given for sample $name. The BAM file will be ignored") s"Both BAM and Xhmm count files are given for sample $name. The BAM file will be ignored")
...@@ -503,11 +503,9 @@ class Tarmac(val parent: Configurable) ...@@ -503,11 +503,9 @@ class Tarmac(val parent: Configurable)
ln.input = f ln.input = f
ln.output = outFile ln.output = outFile
\/-(ln) \/-(ln)
} case (None, Some(bam)) =>
case (None, Some(bam)) => {
val dcov = DepthOfCoverage(root, List(bam), outFile, List(targets)) val dcov = DepthOfCoverage(root, List(bam), outFile, List(targets))
\/-(dcov) \/-(dcov)
}
case _ => case _ =>
-\/( -\/(
s"Cannot find bam file or xhmm count file for sample" + s"Cannot find bam file or xhmm count file for sample" +
...@@ -522,6 +520,7 @@ class Tarmac(val parent: Configurable) ...@@ -522,6 +520,7 @@ class Tarmac(val parent: Configurable)
case \/-(ln: Ln) => \/-(ln.output) case \/-(ln: Ln) => \/-(ln.output)
case \/-(doc: DepthOfCoverage) => \/-(doc.intervalSummaryFile) case \/-(doc: DepthOfCoverage) => \/-(doc.intervalSummaryFile)
case -\/(error) => -\/(error) case -\/(error) => -\/(error)
case _ => throw new IllegalStateException("This should not be reachable")
} }
} }
...@@ -534,7 +533,7 @@ class Tarmac(val parent: Configurable) ...@@ -534,7 +533,7 @@ class Tarmac(val parent: Configurable)
protected lazy val outputWisecondorCountJob: String \/ QFunction = { protected lazy val outputWisecondorCountJob: String \/ QFunction = {
val outFile = new File(wisecondorDir, s"$name.wisecondor.bed") val outFile = new File(wisecondorDir, s"$name.wisecondor.bed")
(inputWisecondorCountFile, bamFile) match { (inputWisecondorCountFile, bamFile) match {
case (Some(f), _) => { case (Some(f), _) =>
if (bamFile.isDefined) { if (bamFile.isDefined) {
logger.warn( logger.warn(
s"Both BAM and Wisecondor count files are given for sample $name. The BAM file will be ignored") s"Both BAM and Wisecondor count files are given for sample $name. The BAM file will be ignored")
...@@ -543,14 +542,12 @@ class Tarmac(val parent: Configurable) ...@@ -543,14 +542,12 @@ class Tarmac(val parent: Configurable)
ln.input = f ln.input = f
ln.output = outFile ln.output = outFile
\/-(ln) \/-(ln)
} case (None, Some(bam)) =>
case (None, Some(bam)) => {
val counter = new WisecondorCount(root) val counter = new WisecondorCount(root)
counter.inputBam = bam counter.inputBam = bam
counter.output = outFile counter.output = outFile
counter.binFile = Some(targets) counter.binFile = Some(targets)
\/-(counter) \/-(counter)
}
case _ => case _ =>
-\/( -\/(
s"Cannot find bam file or wisecondor count for sample" + s"Cannot find bam file or wisecondor count for sample" +
...@@ -565,6 +562,7 @@ class Tarmac(val parent: Configurable) ...@@ -565,6 +562,7 @@ class Tarmac(val parent: Configurable)
case \/-(ln: Ln) => \/-(ln.output) case \/-(ln: Ln) => \/-(ln.output)
case \/-(count: WisecondorCount) => \/-(count.output) case \/-(count: WisecondorCount) => \/-(count.output)
case -\/(error) => -\/(error) case -\/(error) => -\/(error)
case _ => throw new IllegalStateException("This should not be reachable")
} }
} }
...@@ -582,6 +580,7 @@ class Tarmac(val parent: Configurable) ...@@ -582,6 +580,7 @@ class Tarmac(val parent: Configurable)
outputWisecondorGccJob match { outputWisecondorGccJob match {
case \/-(gcc: WisecondorGcCorrect) => \/-(gcc.output) case \/-(gcc: WisecondorGcCorrect) => \/-(gcc.output)
case -\/(error) => -\/(error) case -\/(error) => -\/(error)
case _ => throw new IllegalStateException("This should not be reachable")
} }
} }
......
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