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

Style fixes

parent 1be6069f
...@@ -92,10 +92,12 @@ class Raxml(val parent: Configurable) extends BiopetCommandLineFunction with Ver ...@@ -92,10 +92,12 @@ class Raxml(val parent: Configurable) extends BiopetCommandLineFunction with Ver
} }
/** Returns bestTree file */ /** Returns bestTree file */
def getBestTreeFile: Option[File] = option(f == "d" && b.isEmpty, new File(w, "RAxML_bestTree." + n)) def getBestTreeFile: Option[File] =
option(f == "d" && b.isEmpty, new File(w, "RAxML_bestTree." + n))
/** Returns bootstrap file */ /** Returns bootstrap file */
def getBootstrapFile: Option[File] = option(f == "d" && b.isDefined, new File(w, "RAxML_bootstrap." + n)) def getBootstrapFile: Option[File] =
option(f == "d" && b.isDefined, new File(w, "RAxML_bootstrap." + n))
/** Returns bipartitions file */ /** Returns bipartitions file */
def getBipartitionsFile: Option[File] = option(f == "b", new File(w, "RAxML_bipartitions." + n)) def getBipartitionsFile: Option[File] = option(f == "b", new File(w, "RAxML_bipartitions." + n))
......
...@@ -163,7 +163,8 @@ class Centrifuge(val parent: Configurable) ...@@ -163,7 +163,8 @@ class Centrifuge(val parent: Configurable)
.map { file => .map { file =>
val reader = Source.fromFile(file) val reader = Source.fromFile(file)
val header = reader.getLines().next().split("\t") val header = reader.getLines().next().split("\t")
val values = reader.getLines().next().split("\t").map(tryToParseNumber(_, fallBack = true).get) val values =
reader.getLines().next().split("\t").map(tryToParseNumber(_, fallBack = true).get)
reader.close() reader.close()
Map("metrics" -> header.zip(values).toMap) Map("metrics" -> header.zip(values).toMap)
} }
......
/** /**
* Biopet is built on top of GATK Queue for building bioinformatic * Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running * 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) * 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. * should also be able to execute Biopet tools and pipelines.
* *
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center * Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
* *
* Contact us at: sasc@lumc.nl * Contact us at: sasc@lumc.nl
* *
* A dual licensing mode is applied. The source code within this project is freely available for non-commercial use under an AGPL * A dual licensing mode is applied. The source code within this project 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; For commercial users or users who do not want to follow the AGPL
* license, please contact us to obtain a separate license. * license, please contact us to obtain a separate license.
*/ */
package nl.lumc.sasc.biopet.extensions.freec package nl.lumc.sasc.biopet.extensions.freec
import java.io.{File, PrintWriter} import java.io.{File, PrintWriter}
...@@ -22,7 +22,10 @@ import org.broadinstitute.gatk.utils.commandline._ ...@@ -22,7 +22,10 @@ import org.broadinstitute.gatk.utils.commandline._
import scala.util.matching.Regex import scala.util.matching.Regex
class FreeC(val parent: Configurable) extends BiopetCommandLineFunction with Reference with Version { class FreeC(val parent: Configurable)
extends BiopetCommandLineFunction
with Reference
with Version {
override def defaults = Map("max_walltime_limit" -> 7200) override def defaults = Map("max_walltime_limit" -> 7200)
...@@ -62,7 +65,8 @@ class FreeC(val parent: Configurable) extends BiopetCommandLineFunction with Ref ...@@ -62,7 +65,8 @@ class FreeC(val parent: Configurable) extends BiopetCommandLineFunction with Ref
executable = config("exe", default = "freec", freeVar = false) executable = config("exe", default = "freec", freeVar = false)
var bedGraphOutput: Boolean = config("BedGraphOutput", default = false) var bedGraphOutput: Boolean = config("BedGraphOutput", default = false)
var bedtools: Option[File] = config("exe", default = "bedtools", namespace = "bedtools", freeVar = false) var bedtools: Option[File] =
config("exe", default = "bedtools", namespace = "bedtools", freeVar = false)
var breakPointThreshold: Option[Double] = config("breakPointThreshold") var breakPointThreshold: Option[Double] = config("breakPointThreshold")
var breakPointType: Option[Int] = config("breakPointType") var breakPointType: Option[Int] = config("breakPointType")
...@@ -162,19 +166,31 @@ class FreeC(val parent: Configurable) extends BiopetCommandLineFunction with Ref ...@@ -162,19 +166,31 @@ class FreeC(val parent: Configurable) extends BiopetCommandLineFunction with Ref
optional("breakPointType=", breakPointType, spaceSeparated = false, escape = false) + "\n" + optional("breakPointType=", breakPointType, spaceSeparated = false, escape = false) + "\n" +
required("chrFiles=", chrFiles, spaceSeparated = false, escape = false) + "\n" + required("chrFiles=", chrFiles, spaceSeparated = false, escape = false) + "\n" +
required("chrLenFile=", chrLenFile, spaceSeparated = false, escape = false) + "\n" + required("chrLenFile=", chrLenFile, spaceSeparated = false, escape = false) + "\n" +
optional("coefficientOfVariation=", coefficientOfVariation, spaceSeparated = false, escape = false) + "\n" + optional("coefficientOfVariation=",
coefficientOfVariation,
spaceSeparated = false,
escape = false) + "\n" +
optional("contamination=", contamination, spaceSeparated = false, escape = false) + "\n" + optional("contamination=", contamination, spaceSeparated = false, escape = false) + "\n" +
conditional(contaminationAdjustment, "contaminationAdjustment=TRUE", escape = false) + "\n" + conditional(contaminationAdjustment, "contaminationAdjustment=TRUE", escape = false) + "\n" +
optional("degree=", degree, spaceSeparated = false, escape = false) + "\n" + optional("degree=", degree, spaceSeparated = false, escape = false) + "\n" +
optional("forceGCcontentNormalization=", forceGCcontentNormalization, spaceSeparated = false, escape = false) + "\n" + optional("forceGCcontentNormalization=",
forceGCcontentNormalization,
spaceSeparated = false,
escape = false) + "\n" +
optional("GCcontentProfile=", gcContentProfile, spaceSeparated = false, escape = false) + "\n" + optional("GCcontentProfile=", gcContentProfile, spaceSeparated = false, escape = false) + "\n" +
optional("gemMappabilityFile=", gemMappabilityFile, spaceSeparated = false, escape = false) + "\n" + optional("gemMappabilityFile=", gemMappabilityFile, spaceSeparated = false, escape = false) + "\n" +
optional("intercept=", intercept, spaceSeparated = false, escape = false) + "\n" + optional("intercept=", intercept, spaceSeparated = false, escape = false) + "\n" +
optional("minCNAlength=", minCNAlength, spaceSeparated = false, escape = false) + "\n" + optional("minCNAlength=", minCNAlength, spaceSeparated = false, escape = false) + "\n" +
optional("minMappabilityPerWindow=", minMappabilityPerWindow, spaceSeparated = false, escape = false) + "\n" + optional("minMappabilityPerWindow=",
minMappabilityPerWindow,
spaceSeparated = false,
escape = false) + "\n" +
optional("minExpectedGC=", minExpectedGC, spaceSeparated = false, escape = false) + "\n" + optional("minExpectedGC=", minExpectedGC, spaceSeparated = false, escape = false) + "\n" +
optional("maxExpectedGC=", maxExpectedGC, spaceSeparated = false, escape = false) + "\n" + optional("maxExpectedGC=", maxExpectedGC, spaceSeparated = false, escape = false) + "\n" +
optional("minimalSubclonePresence=", minimalSubclonePresence, spaceSeparated = false, escape = false) + "\n" + optional("minimalSubclonePresence=",
minimalSubclonePresence,
spaceSeparated = false,
escape = false) + "\n" +
optional("maxThreads=", getThreads, spaceSeparated = false, escape = false) + "\n" + optional("maxThreads=", getThreads, spaceSeparated = false, escape = false) + "\n" +
conditional(noisyData, "noisyData=TRUE", escape = false) + "\n" + conditional(noisyData, "noisyData=TRUE", escape = false) + "\n" +
required("outputDir=", outputPath, spaceSeparated = false, escape = false) + "\n" + required("outputDir=", outputPath, spaceSeparated = false, escape = false) + "\n" +
...@@ -196,10 +212,16 @@ class FreeC(val parent: Configurable) extends BiopetCommandLineFunction with Ref ...@@ -196,10 +212,16 @@ class FreeC(val parent: Configurable) extends BiopetCommandLineFunction with Ref
required("mateOrientation=", mateOrientation, spaceSeparated = false, escape = false) + "\n" + required("mateOrientation=", mateOrientation, spaceSeparated = false, escape = false) + "\n" +
"[BAF]" + "\n" + "[BAF]" + "\n" +
optional("SNPfile=", snpFile, spaceSeparated = false, escape = false) + "\n" + optional("SNPfile=", snpFile, spaceSeparated = false, escape = false) + "\n" +
optional("minimalCoveragePerPosition=", minimalCoveragePerPosition, spaceSeparated = false, escape = false) + "\n" + optional("minimalCoveragePerPosition=",
minimalCoveragePerPosition,
spaceSeparated = false,
escape = false) + "\n" +
optional("makePileup=", makePileup, spaceSeparated = false, escape = false) + "\n" + optional("makePileup=", makePileup, spaceSeparated = false, escape = false) + "\n" +
optional("fastaFile=", fastaFile, spaceSeparated = false, escape = false) + "\n" + optional("fastaFile=", fastaFile, spaceSeparated = false, escape = false) + "\n" +
optional("minimalQualityPerPosition=", minimalQualityPerPosition, spaceSeparated = false, escape = false) + "\n" + optional("minimalQualityPerPosition=",
minimalQualityPerPosition,
spaceSeparated = false,
escape = false) + "\n" +
optional("shiftInQuality=", shiftInQuality, spaceSeparated = false, escape = false) + "\n" + optional("shiftInQuality=", shiftInQuality, spaceSeparated = false, escape = false) + "\n" +
"[target]" + "\n" + "[target]" + "\n" +
optional("captureRegions=", captureRegions, spaceSeparated = false, escape = false) + "\n" optional("captureRegions=", captureRegions, spaceSeparated = false, escape = false) + "\n"
...@@ -208,6 +230,7 @@ class FreeC(val parent: Configurable) extends BiopetCommandLineFunction with Ref ...@@ -208,6 +230,7 @@ class FreeC(val parent: Configurable) extends BiopetCommandLineFunction with Ref
writer.close() writer.close()
} }
def cmdLine: String = required(executable) + def cmdLine: String =
required("--conf", configFile) required(executable) +
required("--conf", configFile)
} }
...@@ -80,7 +80,8 @@ class CollectGcBiasMetrics(val parent: Configurable) ...@@ -80,7 +80,8 @@ class CollectGcBiasMetrics(val parent: Configurable)
def summaryFiles: Map[String, File] = Map() def summaryFiles: Map[String, File] = Map()
/** Returns stats for summary */ /** Returns stats for summary */
def summaryStats: Option[Map[String, List[Option[Any]]]] = Picard.getHistogram(output, tag = "METRICS CLASS") def summaryStats: Option[Map[String, List[Option[Any]]]] =
Picard.getHistogram(output, tag = "METRICS CLASS")
} }
object CollectGcBiasMetrics { object CollectGcBiasMetrics {
......
...@@ -43,8 +43,10 @@ class VarscanMpileup2cns(val parent: Configurable) extends Varscan { ...@@ -43,8 +43,10 @@ class VarscanMpileup2cns(val parent: Configurable) extends Varscan {
override def beforeGraph(): Unit = { override def beforeGraph(): Unit = {
val validValues: Set[Int] = Set(0, 1) val validValues: Set[Int] = Set(0, 1)
// check for boolean vars that are passed as ints // check for boolean vars that are passed as ints
strandFilter.foreach(v => require(validValues.contains(v), "strand_filter value must be either 0 or 1")) strandFilter.foreach(v =>
outputVcf.foreach(v => require(validValues.contains(v), "output_vcf value must be either 0 or 1")) require(validValues.contains(v), "strand_filter value must be either 0 or 1"))
outputVcf.foreach(v =>
require(validValues.contains(v), "output_vcf value must be either 0 or 1"))
variants.foreach(v => require(validValues.contains(v), "variants value must be either 0 or 1")) variants.foreach(v => require(validValues.contains(v), "variants value must be either 0 or 1"))
} }
......
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