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

Merge branch 'develop' into feature-licence

parents 853f39a6 f12c5edf
......@@ -6,8 +6,10 @@ import nl.lumc.sasc.biopet.core.config.{ Config, Configurable }
import org.broadinstitute.gatk.utils.commandline.Argument
import org.broadinstitute.gatk.queue.QSettings
import org.broadinstitute.gatk.queue.function.QFunction
import org.broadinstitute.gatk.queue.function.scattergather.ScatterGatherableFunction
import org.broadinstitute.gatk.queue.util.{ Logging => GatkLogging }
trait BiopetQScript extends Configurable {
trait BiopetQScript extends Configurable with GatkLogging {
@Argument(doc = "JSON config file(s)", fullName = "config_file", shortName = "config", required = false)
val configfiles: List[File] = Nil
......@@ -15,6 +17,9 @@ trait BiopetQScript extends Configurable {
@Argument(doc = "Output directory", fullName = "output_directory", shortName = "outDir", required = true)
var outputDir: String = _
@Argument(doc = "Disable all scatters", shortName = "DSC", required = false)
var disableScatterDefault: Boolean = false
var outputFiles: Map[String, File] = Map()
var qSettings: QSettings
......@@ -28,6 +33,11 @@ trait BiopetQScript extends Configurable {
if (!outputDir.endsWith("/")) outputDir += "/"
init
biopetScript
if (disableScatterDefault) for (function <- functions) function match {
case f: ScatterGatherableFunction => f.scatterCount = 1
case _ =>
}
for (function <- functions) function match {
case f: BiopetCommandLineFunctionTrait => f.afterGraph
case _ =>
......
package nl.lumc.sasc.biopet.core
import nl.lumc.sasc.biopet.core.config.{ Config, Configurable }
import nl.lumc.sasc.biopet.utils.ConfigUtils._
trait MultiSampleQScript extends BiopetQScript {
type LibraryOutput <: AbstractLibraryOutput
......@@ -20,7 +21,7 @@ trait MultiSampleQScript extends BiopetQScript {
final def runSamplesJobs() {
if (samplesConfig == null) samplesConfig = Map()
if (Config.global.contains("samples")) for ((key, value) <- samplesConfig) {
var sample = Configurable.any2map(value)
var sample = any2map(value)
if (!sample.contains("ID")) sample += ("ID" -> key)
if (sample("ID") == key) {
samplesOutput += key -> runSingleSampleJobs(sample)
......@@ -31,7 +32,7 @@ trait MultiSampleQScript extends BiopetQScript {
def runSingleSampleJobs(sampleConfig: Map[String, Any]): SampleOutput
def runSingleSampleJobs(sample: String): SampleOutput = {
var map = Configurable.any2map(samplesConfig(sample))
var map = any2map(samplesConfig(sample))
if (map.contains("ID") && map("ID") != sample)
throw new IllegalStateException("ID in config not the same as the key")
else map += ("ID" -> sample)
......@@ -42,9 +43,9 @@ trait MultiSampleQScript extends BiopetQScript {
var output: Map[String, LibraryOutput] = Map()
val sampleID = sampleConfig("ID").toString
if (sampleConfig.contains("libraries")) {
val runs = Configurable.any2map(sampleConfig("libraries"))
val runs = any2map(sampleConfig("libraries"))
for ((key, value) <- runs) {
var library = Configurable.any2map(value)
var library = any2map(value)
if (!library.contains("ID")) library += ("ID" -> key)
if (library("ID") == key) {
output += key -> runSingleLibraryJobs(library, sampleConfig)
......
......@@ -2,8 +2,7 @@ package nl.lumc.sasc.biopet.core.config
import java.io.File
import nl.lumc.sasc.biopet.core.Logging
import argonaut._, Argonaut._
import scalaz._, Scalaz._
import nl.lumc.sasc.biopet.utils.ConfigUtils._
class Config(var map: Map[String, Any]) extends Logging {
logger.debug("Init phase of config")
......@@ -12,30 +11,27 @@ class Config(var map: Map[String, Any]) extends Logging {
loadDefaultConfig()
}
def loadDefaultConfig() {
var globalFile: String = System.getenv("BIOPET_CONFIG")
if (globalFile != null) {
def loadConfigEnv(valueName: String) {
val globalFiles = sys.env.get(valueName).getOrElse("").split(":")
if (globalFiles.isEmpty) logger.info(valueName + " value not found, no global config is loaded")
for (globalFile <- globalFiles) {
var file: File = new File(globalFile)
if (file.exists()) {
logger.info("Loading config file: " + file)
loadConfigFile(file)
} else logger.warn("BIOPET_CONFIG value found but file does not exist, no global config is loaded")
} else logger.info("BIOPET_CONFIG value not found, no global config is loaded")
} else logger.warn(valueName + " value found but file does not exist, no global config is loaded")
}
}
def loadDefaultConfig() {
loadConfigEnv("BIOPET_CONFIG")
}
def loadConfigFile(configFile: File) {
logger.debug("Jsonfile: " + configFile)
val jsonText = scala.io.Source.fromFile(configFile).mkString
val json = Parse.parseOption(jsonText)
if (json == None) {
throw new IllegalStateException("The config JSON file is either not properly formatted or not a JSON file, file: " + configFile)
}
logger.debug(json)
val configJson = Config.jsonToMap(json.get)
logger.debug("Contain: " + configJson)
val configMap = fileToConfigMap(configFile)
if (map.isEmpty) map = configJson
else map = Config.mergeMaps(configJson, map)
if (map.isEmpty) map = configMap
else map = mergeMaps(configMap, map)
logger.debug("New config: " + map)
}
......@@ -107,66 +103,13 @@ class Config(var map: Map[String, Any]) extends Logging {
object Config extends Logging {
val global = new Config
def valueToMap(input: Any): Map[String, Any] = {
input match {
case m: Map[_, _] => return m.asInstanceOf[Map[String, Any]]
case _ => throw new IllegalStateException("Value '" + input + "' is not an Map")
}
}
def mergeMaps(map1: Map[String, Any], map2: Map[String, Any]): Map[String, Any] = {
var newMap: Map[String, Any] = Map()
for (key <- map1.keySet.++(map2.keySet)) {
if (map1.contains(key) && !map2.contains(key)) newMap += (key -> map1(key))
else if (!map1.contains(key) && map2.contains(key)) newMap += (key -> map2(key))
else if (map1.contains(key) && map2.contains(key)) {
map1(key) match {
case m1: Map[_, _] => {
map2(key) match {
case m2: Map[_, _] => newMap += (key -> mergeMaps(Config.valueToMap(m1), Config.valueToMap(m2)))
case _ => newMap += (key -> map1(key))
}
}
case _ => newMap += (key -> map1(key))
}
}
}
return newMap
}
def mergeConfigs(config1: Config, config2: Config): Config = new Config(mergeMaps(config1.map, config2.map))
private def jsonToMap(json: Json): Map[String, Any] = {
var output: Map[String, Any] = Map()
if (json.isObject) {
for (key <- json.objectFieldsOrEmpty) {
val value: Any = jsonToAny(json.field(key).get)
output += (key -> value)
}
} else return null
return output
}
private def jsonToAny(json: Json): Any = {
if (json.isObject) return jsonToMap(json)
else if (json.isArray) {
var list: List[Any] = List()
for (value <- json.array.get) list ::= jsonToAny(value)
return list
} else if (json.isBool) return json.bool.get
else if (json.isString) return json.string.get.toString
else if (json.isNumber) {
val num = json.number.get
if (num.toString.contains(".")) return num.toDouble
else return num.toLong
} else throw new IllegalStateException("Config value type not supported, value: " + json)
}
private def getMapFromPath(map: Map[String, Any], path: List[String]): Map[String, Any] = {
var returnMap: Map[String, Any] = map
for (m <- path) {
if (!returnMap.contains(m)) return Map()
else returnMap = Config.valueToMap(returnMap(m))
else returnMap = any2map(returnMap(m))
}
return returnMap
}
......@@ -199,28 +142,4 @@ object Config extends Logging {
return None
}
}
def mapToJson(map: Map[String, Any]): Json = {
map.foldLeft(jEmptyObject)((acc, kv) => (kv._1 := {
kv._2 match {
case m: Map[_, _] => mapToJson(m.map(m => m._1.toString -> anyToJson(m._2)))
case _ => anyToJson(kv._2)
}
}) ->: acc)
}
def anyToJson(any: Any): Json = {
any match {
case j: Json => j
case m: Map[_, _] => mapToJson(m.map(m => m._1.toString -> anyToJson(m._2)))
case l: List[_] => Json.array(l.map(anyToJson(_)): _*)
case n: Int => Json.jNumberOrString(n)
case n: Double => Json.jNumberOrString(n)
case n: Long => Json.jNumberOrString(n)
case n: Short => Json.jNumberOrString(n)
case n: Float => Json.jNumberOrString(n)
case n: Byte => Json.jNumberOrString(n)
case _ => jString(any.toString)
}
}
}
\ No newline at end of file
package nl.lumc.sasc.biopet.core.config
import java.io.File
import nl.lumc.sasc.biopet.utils.ConfigUtils._
class ConfigValue(val requestIndex: ConfigValueIndex, val foundIndex: ConfigValueIndex, val value: Any, val default: Boolean) {
def getString = Configurable.any2string(value)
def getInt = Configurable.any2int(value)
def getDouble = Configurable.any2double(value)
def getList = Configurable.any2list(value)
def getFileList: List[File] = for (file <- Configurable.any2stringList(value)) yield new File(file)
def getStringList: List[String] = Configurable.any2stringList(value)
def getMap = Configurable.any2map(value)
def getBoolean = Configurable.any2boolean(value)
def asString = any2string(value)
def asInt = any2int(value)
def asDouble = any2double(value)
def asList = any2list(value)
def asFileList: List[File] = for (file <- any2stringList(value)) yield new File(file)
def asStringList: List[String] = any2stringList(value)
def asMap = any2map(value)
def asBoolean = any2boolean(value)
override def toString: String = {
var output = "key = " + requestIndex.key
......
package nl.lumc.sasc.biopet.core.config
import java.io.File
import org.broadinstitute.gatk.queue.util.Logging
import scala.language.implicitConversions
import nl.lumc.sasc.biopet.core.Logging
import nl.lumc.sasc.biopet.utils.ConfigUtils.ImplicitConversions
trait Configurable extends Logging {
trait Configurable extends ImplicitConversions {
val root: Configurable
//val globalConfig: Config = if (root != null) root.globalConfig else new Config()
def configPath: List[String] = if (root != null) root.configFullPath else List()
protected lazy val configName = getClass.getSimpleName.toLowerCase
protected lazy val configFullPath = configName :: configPath
......@@ -25,7 +24,7 @@ trait Configurable extends Logging {
}
if (!contains(key, submodule, freeVar) && d == null) {
if (required) {
logger.error("Value in config could not be found but it is required, key: " + key + " module: " + m + " path: " + p)
Logging.logger.error("Value in config could not be found but it is required, key: " + key + " module: " + m + " path: " + p)
throw new IllegalStateException("Value in config could not be found but it is required, key: " + key + " module: " + m + " path: " + p)
} else return null
}
......@@ -40,120 +39,4 @@ trait Configurable extends Logging {
Config.global.contains(m, p, key, freeVar) || !(Config.getValueFromMap(defaults.toMap, ConfigValueIndex(m, p, key, freeVar)) == None)
}
}
implicit def configValue2file(value: ConfigValue): File = if (value != null) new File(Configurable.any2string(value.value)) else null
implicit def configValue2string(value: ConfigValue): String = if (value != null) Configurable.any2string(value.value) else null
implicit def configValue2long(value: ConfigValue): Long = if (value != null) Configurable.any2long(value.value) else 0
implicit def configValue2optionLong(value: ConfigValue): Option[Long] = if (value != null) Option(Configurable.any2long(value.value)) else None
implicit def configValue2int(value: ConfigValue): Int = if (value != null) Configurable.any2int(value.value) else 0
implicit def configValue2optionInt(value: ConfigValue): Option[Int] = if (value != null) Option(Configurable.any2int(value.value)) else None
implicit def configValue2double(value: ConfigValue): Double = if (value != null) Configurable.any2double(value.value) else 0
implicit def configValue2optionDouble(value: ConfigValue): Option[Double] = if (value != null) Option(Configurable.any2double(value.value)) else None
implicit def configValue2float(value: ConfigValue): Float = if (value != null) Configurable.any2float(value.value) else 0
implicit def configValue2optionFloat(value: ConfigValue): Option[Float] = if (value != null) Option(Configurable.any2float(value.value)) else None
implicit def configValue2boolean(value: ConfigValue): Boolean = if (value != null) Configurable.any2boolean(value.value) else false
implicit def configValue2optionBoolean(value: ConfigValue): Option[Boolean] = if (value != null) Option(Configurable.any2boolean(value.value)) else None
implicit def configValue2list(value: ConfigValue): List[Any] = if (value != null) Configurable.any2list(value.value) else null
implicit def configValue2stringList(value: ConfigValue): List[String] = if (value != null) Configurable.any2stringList(value.value) else null
implicit def configValue2stringSet(value: ConfigValue): Set[String] = if (value != null) Configurable.any2stringList(value.value).toSet else null
implicit def configValue2map(value: ConfigValue): Map[String, Any] = if (value != null) Configurable.any2map(value.value) else null
}
object Configurable extends Logging {
def any2string(any: Any): String = {
if (any == null) return null
any match {
case s: String => return s
case _ => return any.toString
}
}
def any2int(any: Any): Int = {
any match {
case i: Double => return i.toInt
case i: Int => return i
case i: String => {
logger.warn("Value '" + any + "' is a string insteadof int in json file, trying auto convert")
return i.toInt
}
case _ => throw new IllegalStateException("Value '" + any + "' is not an int")
}
}
def any2long(any: Any): Long = {
any match {
case l: Double => return l.toLong
case l: Int => return l.toLong
case l: Long => return l
case l: String => {
logger.warn("Value '" + any + "' is a string insteadof int in json file, trying auto convert")
return l.toLong
}
case _ => throw new IllegalStateException("Value '" + any + "' is not an int")
}
}
def any2double(any: Any): Double = {
any match {
case d: Double => return d
case d: Float => return d.toDouble
case d: Int => return d.toDouble
case d: String => {
logger.warn("Value '" + any + "' is a string insteadof int in json file, trying auto convert")
return d.toDouble
}
case _ => throw new IllegalStateException("Value '" + any + "' is not an int")
}
}
def any2float(any: Any): Float = {
any match {
case f: Double => return f.toFloat
case f: Int => return f.toFloat
case f: Float => return f
case f: String => {
logger.warn("Value '" + any + "' is a string insteadof int in json file, trying auto convert")
return f.toFloat
}
case _ => throw new IllegalStateException("Value '" + any + "' is not an int")
}
}
def any2boolean(any: Any): Boolean = {
any match {
case b: Boolean => return b
case b: String => {
logger.warn("Value '" + any + "' is a string insteadof boolean in json file, trying auto convert")
return b.contains("true")
}
case b: Int => {
logger.warn("Value '" + any + "' is a int insteadof boolean in json file, trying auto convert")
return (b > 0)
}
case _ => throw new IllegalStateException("Value '" + any + "' is not an boolean")
}
}
def any2list(any: Any): List[Any] = {
if (any == null) return null
any match {
case l: List[_] => return l
case _ => List(any)
}
}
def any2stringList(any: Any): List[String] = {
if (any == null) return null
var l: List[String] = Nil
for (v <- any2list(any)) l :+= v.toString
return l
}
def any2map(any: Any): Map[String, Any] = {
if (any == null) return null
any match {
case m: Map[_, _] => return m.asInstanceOf[Map[String, Any]]
case _ => throw new IllegalStateException("Value '" + any + "' is not an Map")
}
}
}
\ No newline at end of file
......@@ -21,11 +21,11 @@ class Cutadapt(val root: Configurable) extends BiopetCommandLineFunction {
var default_clip_mode: String = config("default_clip_mode", default = "3")
var opt_adapter: Set[String] = Set()
if (config.contains("adapter")) for (adapter <- config("adapter").getList) opt_adapter += adapter.toString
if (config.contains("adapter")) for (adapter <- config("adapter").asList) opt_adapter += adapter.toString
var opt_anywhere: Set[String] = Set()
if (config.contains("anywhere")) for (adapter <- config("anywhere").getList) opt_anywhere += adapter.toString
if (config.contains("anywhere")) for (adapter <- config("anywhere").asList) opt_anywhere += adapter.toString
var opt_front: Set[String] = Set()
if (config.contains("front")) for (adapter <- config("front").getList) opt_front += adapter.toString
if (config.contains("front")) for (adapter <- config("front").asList) opt_front += adapter.toString
var opt_discard: Boolean = config("discard")
var opt_minimum_length: String = config("minimum_length", 1)
......
......@@ -7,13 +7,9 @@ class BaseRecalibrator(val root: Configurable) extends org.broadinstitute.gatk.q
memoryLimit = Option(4)
override val defaultVmem = "8G"
override def afterGraph {
super.afterGraph
if (config.contains("scattercount")) scatterCount = config("scattercount")
if (config.contains("dbsnp")) knownSites :+= new File(config("dbsnp").getString)
if (config.contains("known_sites")) knownSites :+= new File(config("known_sites").getString)
}
if (config.contains("scattercount")) scatterCount = config("scattercount")
if (config.contains("dbsnp")) knownSites :+= new File(config("dbsnp").asString)
if (config.contains("known_sites")) knownSites :+= new File(config("known_sites").asString)
}
object BaseRecalibrator {
......
......@@ -10,9 +10,9 @@ trait GatkGeneral extends CommandLineGATK with BiopetJavaCommandLineFunction {
override val defaultVmem = "7G"
if (config.contains("intervals", submodule = "gatk")) intervals = config("intervals", submodule = "gatk").getFileList
if (config.contains("exclude_intervals", submodule = "gatk")) excludeIntervals = config("exclude_intervals", submodule = "gatk").getFileList
if (config.contains("intervals", submodule = "gatk")) intervals = config("intervals", submodule = "gatk").asFileList
if (config.contains("exclude_intervals", submodule = "gatk")) excludeIntervals = config("exclude_intervals", submodule = "gatk").asFileList
reference_sequence = config("reference", submodule = "gatk")
gatk_key = config("gatk_key", submodule = "gatk")
if (config.contains("pedigree", submodule = "gatk")) pedigree = config("pedigree", submodule = "gatk").getFileList
if (config.contains("pedigree", submodule = "gatk")) pedigree = config("pedigree", submodule = "gatk").asFileList
}
......@@ -4,12 +4,12 @@ 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 {
annotation ++= config("annotation", default = Seq("FisherStrand", "QualByDepth", "ChromosomeCounts")).getStringList
annotation ++= config("annotation", default = Seq("FisherStrand", "QualByDepth", "ChromosomeCounts")).asStringList
if (config.contains("dbsnp")) dbsnp = config("dbsnp")
if (config.contains("scattercount", "genotypegvcfs")) scatterCount = config("scattercount")
if (config("inputtype", default = "dna").getString == "rna") {
if (config("inputtype", default = "dna").asString == "rna") {
stand_call_conf = config("stand_call_conf", default = 20)
stand_emit_conf = config("stand_emit_conf", default = 0)
} else {
......
......@@ -17,7 +17,7 @@ class HaplotypeCaller(val root: Configurable) extends org.broadinstitute.gatk.qu
if (config.contains("allSitePLs")) this.allSitePLs = config("allSitePLs")
if (config.contains("output_mode")) {
import org.broadinstitute.gatk.tools.walkers.genotyper.OutputMode._
config("output_mode").getString match {
config("output_mode").asString match {
case "EMIT_ALL_CONFIDENT_SITES" => output_mode = EMIT_ALL_CONFIDENT_SITES
case "EMIT_ALL_SITES" => output_mode = EMIT_ALL_SITES
case "EMIT_VARIANTS_ONLY" => output_mode = EMIT_VARIANTS_ONLY
......@@ -25,7 +25,7 @@ class HaplotypeCaller(val root: Configurable) extends org.broadinstitute.gatk.qu
}
}
if (config("inputtype", default = "dna").getString == "rna") {
if (config("inputtype", default = "dna").asString == "rna") {
dontUseSoftClippedBases = config("dontusesoftclippedbases", default = true)
stand_call_conf = config("stand_call_conf", default = 5)
stand_emit_conf = config("stand_emit_conf", default = 0)
......
......@@ -9,7 +9,7 @@ class RealignerTargetCreator(val root: Configurable) extends org.broadinstitute.
if (config.contains("scattercount")) scatterCount = config("scattercount")
if (config.contains("known")) known ++= config("known").getFileList
if (config.contains("known")) known ++= config("known").asFileList
}
object RealignerTargetCreator {
......
......@@ -15,7 +15,7 @@ class UnifiedGenotyper(val root: Configurable) extends org.broadinstitute.gatk.q
if (config.contains("allSitePLs")) this.allSitePLs = config("allSitePLs")
if (config.contains("output_mode")) {
import org.broadinstitute.gatk.tools.walkers.genotyper.OutputMode._
config("output_mode").getString match {
config("output_mode").asString match {
case "EMIT_ALL_CONFIDENT_SITES" => output_mode = EMIT_ALL_CONFIDENT_SITES
case "EMIT_ALL_SITES" => output_mode = EMIT_ALL_SITES
case "EMIT_VARIANTS_ONLY" => output_mode = EMIT_VARIANTS_ONLY
......@@ -23,7 +23,7 @@ class UnifiedGenotyper(val root: Configurable) extends org.broadinstitute.gatk.q
}
}
if (config("inputtype", default = "dna").getString == "rna") {
if (config("inputtype", default = "dna").asString == "rna") {
stand_call_conf = config("stand_call_conf", default = 5)
stand_emit_conf = config("stand_emit_conf", default = 0)
} else {
......
......@@ -8,9 +8,9 @@ class VariantRecalibrator(val root: Configurable) extends org.broadinstitute.gat
nt = Option(getThreads(4))
memoryLimit = Option(nt.getOrElse(1) * 2)
if (config.contains("dbsnp")) resource :+= new TaggedFile(config("dbsnp").getString, "known=true,training=false,truth=false,prior=2.0")
if (config.contains("dbsnp")) resource :+= new TaggedFile(config("dbsnp").asString, "known=true,training=false,truth=false,prior=2.0")
an = config("annotation", default = List("QD", "DP", "FS", "ReadPosRankSum", "MQRankSum")).getStringList
an = config("annotation", default = List("QD", "DP", "FS", "ReadPosRankSum", "MQRankSum")).asStringList
minNumBadVariants = config("minnumbadvariants")
maxGaussians = config("maxgaussians")
}
......@@ -23,13 +23,13 @@ object VariantRecalibrator {
if (indel) {
mode = org.broadinstitute.gatk.tools.walkers.variantrecalibration.VariantRecalibratorArgumentCollection.Mode.INDEL
defaults ++= Map("ts_filter_level" -> 99.0)
if (config.contains("mills")) resource :+= new TaggedFile(config("mills").getString, "known=false,training=true,truth=true,prior=12.0")
if (config.contains("mills")) resource :+= new TaggedFile(config("mills").asString, "known=false,training=true,truth=true,prior=12.0")
} else {
mode = org.broadinstitute.gatk.tools.walkers.variantrecalibration.VariantRecalibratorArgumentCollection.Mode.SNP
defaults ++= Map("ts_filter_level" -> 99.5)
if (config.contains("hapmap")) resource +:= new TaggedFile(config("hapmap").getString, "known=false,training=true,truth=true,prior=15.0")
if (config.contains("omni")) resource +:= new TaggedFile(config("omni").getString, "known=false,training=true,truth=true,prior=12.0")
if (config.contains("1000G")) resource +:= new TaggedFile(config("1000G").getString, "known=false,training=true,truth=false,prior=10.0")
if (config.contains("hapmap")) resource +:= new TaggedFile(config("hapmap").asString, "known=false,training=true,truth=true,prior=15.0")
if (config.contains("omni")) resource +:= new TaggedFile(config("omni").asString, "known=false,training=true,truth=true,prior=12.0")
if (config.contains("1000G")) resource +:= new TaggedFile(config("1000G").asString, "known=false,training=true,truth=false,prior=10.0")
}
}
vr.input :+= input
......
......@@ -29,7 +29,7 @@ class BamMetrics(val root: Configurable) extends QScript with BiopetQScript {
if (outputDir == null) throw new IllegalStateException("Missing Output directory on BamMetrics module")
else if (!outputDir.endsWith("/")) outputDir += "/"
if (config.contains("target_bed")) {
for (file <- config("target_bed").getList) {
for (file <- config("target_bed").asList) {
bedFiles +:= new File(file.toString)
}
}
......
......@@ -68,7 +68,7 @@ class Basty(val root: Configurable) extends QScript with MultiSampleQScript {
add(raxmlMl)
val r = new scala.util.Random(seed)
val numBoot = config("boot_runs", default = 100, submodule = "raxml").getInt
val numBoot = config("boot_runs", default = 100, submodule = "raxml").asInt
val bootList = for (t <- 0 until numBoot) yield {
val raxmlBoot = new Raxml(this)
raxmlBoot.threads = 1
......
......@@ -24,7 +24,7 @@ class GatkBenchmarkGenotyping(val root: Configurable) extends QScript with Biope
var dbsnp: File = config("dbsnp")
def init() {
if (config.contains("gvcffiles")) for (file <- config("gvcffiles").getList) {
if (config.contains("gvcffiles")) for (file <- config("gvcffiles").asList) {
gvcfFiles ::= file.toString
}
if (outputDir == null) throw new IllegalStateException("Missing Output directory on gatk module")
......
......@@ -50,10 +50,10 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
def init() {
if (config.contains("target_bed")) {
defaults ++= Map("gatk" -> Map(("intervals" -> config("target_bed").getStringList)))
defaults ++= Map("gatk" -> Map(("intervals" -> config("target_bed").asStringList)))
}
if (config.contains("gvcfFiles"))
for (file <- config("gvcfFiles").getList)
for (file <- config("gvcfFiles").asList)
gvcfFiles :+= file.toString
if (outputDir == null) throw new IllegalStateException("Missing Output directory on gatk module")
else if (!outputDir.endsWith("/")) outputDir += "/"
......@@ -114,7 +114,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
multisampleVariantcalling.biopetScript
addAll(multisampleVariantcalling.functions)
if (config("inputtype", default = "dna").getString != "rna" && config("recalibration", default = false).getBoolean) {
if (config("inputtype", default = "dna").asString != "rna" && config("recalibration", default = false).asBoolean) {
val recalibration = new GatkVariantRecalibration(this)
recalibration.inputVcf = multisampleVariantcalling.scriptOutput.finalVcfFile
recalibration.bamFiles = finalBamFiles
......@@ -174,7 +174,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
var bamFile = new File(runConfig("bam").toString)
if (!bamFile.exists) throw new IllegalStateException("Bam in config does not exist, file: " + bamFile)
if (config("bam_to_fastq", default = false).getBoolean) {
if (config("bam_to_fastq", default = false).asBoolean) {
val samToFastq = SamToFastq(this, bamFile, runDir + sampleID + "-" + runID + ".R1.fastq",