Commit 1cbac3c9 authored by bow's avatar bow

Merge branch 'feature-multiple_configs' into 'develop'

Feature multiple configs

see #88

See merge request !54
parents d50a9777 e3df8cc5
......@@ -6,6 +6,7 @@ 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
trait BiopetQScript extends Configurable {
......@@ -15,6 +16,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 +32,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 _ =>
......
......@@ -12,15 +12,20 @@ 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) {
var globalFiles = System.getenv(valueName).split(":")
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")
}
if (globalFiles.isEmpty) logger.info(valueName + " value not found, no global config is loaded")
}
def loadDefaultConfig() {
loadConfigEnv("BIOPET_CONFIG")
}
def loadConfigFile(configFile: File) {
......
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