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

Fixing compile and code warnings

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