Skip to content
Snippets Groups Projects
Commit 5a4df715 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Added merge config

parent 03e66819
No related branches found
No related tags found
No related merge requests found
Showing
with 19 additions and 16 deletions
...@@ -5,17 +5,20 @@ import org.broadinstitute.sting.queue.function.CommandLineFunction ...@@ -5,17 +5,20 @@ import org.broadinstitute.sting.queue.function.CommandLineFunction
//import org.broadinstitute.sting.queue.function.QFunction //import org.broadinstitute.sting.queue.function.QFunction
import org.broadinstitute.sting.commandline._ import org.broadinstitute.sting.commandline._
import java.io.File import java.io.File
import scala.sys.process._
class Ln(val globalConfig: Config) extends CommandLineFunction { class Ln(val globalConfig: Config) extends CommandLineFunction {
def this() = this(new Config(Map())) def this() = this(new Config(Map()))
this.analysisName = "ln" this.analysisName = "ln"
val config: Config = globalConfig.getAsConfig(this.analysisName) val config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName), globalConfig)
logger.debug("Config for " + this.analysisName + ": " + config) logger.debug("Config for " + this.analysisName + ": " + config)
@Input(doc="Input file") var in: File = _ @Input(doc="Input file") var in: File = _
@Output(doc="Link destination") var out: File = _ @Output(doc="Link destination") var out: File = _
def commandLine = "ln -sf %s %s".format(in, out) def commandLine = {
"ln -sf " + required(in) + required(out)
}
} }
object Ln { object Ln {
......
...@@ -8,7 +8,7 @@ import java.io.File ...@@ -8,7 +8,7 @@ import java.io.File
class Sha1sum(val globalConfig: Config) extends CommandLineFunction { class Sha1sum(val globalConfig: Config) extends CommandLineFunction {
def this() = this(new Config(Map())) def this() = this(new Config(Map()))
this.analysisName = "sha1sum" this.analysisName = "sha1sum"
val config: Config = globalConfig.getAsConfig("sha1sum") val config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName), globalConfig)
logger.debug("Config for " + this.analysisName + ": " + config) logger.debug("Config for " + this.analysisName + ": " + config)
@Input(doc="Zipped file") var in: File = _ @Input(doc="Zipped file") var in: File = _
......
...@@ -8,7 +8,7 @@ import java.io.File ...@@ -8,7 +8,7 @@ import java.io.File
class Zcat(val globalConfig: Config) extends CommandLineFunction { class Zcat(val globalConfig: Config) extends CommandLineFunction {
def this() = this(new Config(Map())) def this() = this(new Config(Map()))
this.analysisName = "zcat" this.analysisName = "zcat"
val config: Config = globalConfig.getAsConfig("zcat") val config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName), globalConfig)
logger.debug("Config for " + this.analysisName + ": " + config) logger.debug("Config for " + this.analysisName + ": " + config)
@Input(doc="Zipped file") var in: File = _ @Input(doc="Zipped file") var in: File = _
......
...@@ -10,7 +10,7 @@ import java.io.File ...@@ -10,7 +10,7 @@ import java.io.File
class FastqSync(val globalConfig: Config) extends CommandLineFunction with Python { class FastqSync(val globalConfig: Config) extends CommandLineFunction with Python {
def this() = this(new Config(Map())) def this() = this(new Config(Map()))
analysisName = "fastqsync" analysisName = "fastqsync"
val config: Config = globalConfig.getAsConfig(analysisName) val config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName), globalConfig)
logger.debug("Config for " + analysisName + ": " + config) logger.debug("Config for " + analysisName + ": " + config)
setPythonScript("__init__.py", "scripts/pyfastqc/") setPythonScript("__init__.py", "scripts/pyfastqc/")
......
...@@ -9,7 +9,7 @@ import java.io.File ...@@ -9,7 +9,7 @@ import java.io.File
class FastqcToContams(val globalConfig: Config) extends CommandLineFunction with Python { class FastqcToContams(val globalConfig: Config) extends CommandLineFunction with Python {
def this() = this(new Config(Map())) def this() = this(new Config(Map()))
analysisName = "getcontams" analysisName = "getcontams"
val config: Config = globalConfig.getAsConfig(analysisName) val config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName), globalConfig)
logger.debug("Config for " + analysisName + ": " + config) logger.debug("Config for " + analysisName + ": " + config)
setPythonScript("__init__.py", "scripts/pyfastqc/") setPythonScript("__init__.py", "scripts/pyfastqc/")
......
...@@ -9,7 +9,7 @@ import java.io.File ...@@ -9,7 +9,7 @@ import java.io.File
class FastqcToQualtype(val globalConfig: Config) extends CommandLineFunction with Python { class FastqcToQualtype(val globalConfig: Config) extends CommandLineFunction with Python {
def this() = this(new Config(Map())) def this() = this(new Config(Map()))
analysisName = "getqualtype" analysisName = "getqualtype"
val config: Config = globalConfig.getAsConfig(analysisName) val config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName), globalConfig)
logger.debug("Config for " + analysisName + ": " + config) logger.debug("Config for " + analysisName + ": " + config)
setPythonScript("__init__.py", "scripts/pyfastqc/") setPythonScript("__init__.py", "scripts/pyfastqc/")
......
...@@ -9,7 +9,7 @@ import java.io.File ...@@ -9,7 +9,7 @@ import java.io.File
class Seqstat(val globalConfig: Config) extends CommandLineFunction with Python { class Seqstat(val globalConfig: Config) extends CommandLineFunction with Python {
def this() = this(new Config(Map())) def this() = this(new Config(Map()))
analysisName = "seqstat" analysisName = "seqstat"
val config: Config = globalConfig.getAsConfig(analysisName) val config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName), globalConfig)
logger.debug("Config for " + analysisName + ": " + config) logger.debug("Config for " + analysisName + ": " + config)
setPythonScript("__init__.py", "scripts/pyfastqc/") setPythonScript("__init__.py", "scripts/pyfastqc/")
......
...@@ -9,7 +9,7 @@ import java.io.File ...@@ -9,7 +9,7 @@ import java.io.File
class Summarize(val globalConfig: Config) extends CommandLineFunction with Python { class Summarize(val globalConfig: Config) extends CommandLineFunction with Python {
def this() = this(new Config(Map())) def this() = this(new Config(Map()))
analysisName = "flexiprep_sumarize" analysisName = "flexiprep_sumarize"
val config: Config = globalConfig.getAsConfig(analysisName) val config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName), globalConfig)
logger.debug("Config for " + analysisName + ": " + config) logger.debug("Config for " + analysisName + ": " + config)
setPythonScript("__init__.py", "scripts/pyfastqc/") setPythonScript("__init__.py", "scripts/pyfastqc/")
......
...@@ -10,7 +10,7 @@ import scala.sys.process._ ...@@ -10,7 +10,7 @@ import scala.sys.process._
class Cutadapt(val globalConfig: Config) extends CommandLineFunction { class Cutadapt(val globalConfig: Config) extends CommandLineFunction {
def this() = this(new Config(Map())) def this() = this(new Config(Map()))
analysisName = "cutadapt" analysisName = "cutadapt"
val config: Config = Config.mergeConfigs(globalConfig.getAsConfig("cutadapt"), globalConfig) val config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName), globalConfig)
logger.debug("Config for " + this.analysisName + ": " + config) logger.debug("Config for " + this.analysisName + ": " + config)
@Input(doc="Cutadapt exe", required=false) @Input(doc="Cutadapt exe", required=false)
......
...@@ -9,7 +9,7 @@ import scala.sys.process._ ...@@ -9,7 +9,7 @@ import scala.sys.process._
class Fastqc(val globalConfig: Config) extends CommandLineFunction { class Fastqc(val globalConfig: Config) extends CommandLineFunction {
def this() = this(new Config(Map())) def this() = this(new Config(Map()))
this.analysisName = "fastqc" this.analysisName = "fastqc"
val config: Config = globalConfig.getAsConfig("fastqc") val config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName), globalConfig)
logger.debug("Config for " + this.analysisName + ": " + config) logger.debug("Config for " + this.analysisName + ": " + config)
@Input(doc="fastqc executeble", shortName="Fastqc_Exe") @Input(doc="fastqc executeble", shortName="Fastqc_Exe")
......
...@@ -10,7 +10,7 @@ import scala.sys.process._ ...@@ -10,7 +10,7 @@ import scala.sys.process._
class Sickle(val globalConfig: Config) extends CommandLineFunction { class Sickle(val globalConfig: Config) extends CommandLineFunction {
def this() = this(new Config(Map())) def this() = this(new Config(Map()))
this.analysisName = "sickle" this.analysisName = "sickle"
val config: Config = globalConfig.getAsConfig("sickle") val config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName), globalConfig)
logger.debug("Config for " + this.analysisName + ": " + config) logger.debug("Config for " + this.analysisName + ": " + config)
@Input(doc="Sickle exe", required=false) var sickle_exe: File = new File(config.getAsString("exe", "/usr/local/bin/sickle")) @Input(doc="Sickle exe", required=false) var sickle_exe: File = new File(config.getAsString("exe", "/usr/local/bin/sickle"))
......
...@@ -9,7 +9,7 @@ import scala.sys.process._ ...@@ -9,7 +9,7 @@ import scala.sys.process._
class Bwa(val globalConfig: Config) extends CommandLineFunction { class Bwa(val globalConfig: Config) extends CommandLineFunction {
def this() = this(new Config(Map())) def this() = this(new Config(Map()))
this.analysisName = "bwa" this.analysisName = "bwa"
val config: Config = Config.mergeConfigs(globalConfig.getAsConfig("bwa"), globalConfig) val config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName), globalConfig)
logger.debug("Config for " + this.analysisName + ": " + config) logger.debug("Config for " + this.analysisName + ": " + config)
@Argument(doc="Bwa executeble", shortName="bwa_exe", required=false) var bwa_exe: String = config.getAsString("exe", "/usr/local/bin/bwa") @Argument(doc="Bwa executeble", shortName="bwa_exe", required=false) var bwa_exe: String = config.getAsString("exe", "/usr/local/bin/bwa")
......
...@@ -8,8 +8,8 @@ import scala.sys.process._ ...@@ -8,8 +8,8 @@ import scala.sys.process._
class Star(val globalConfig: Config) extends CommandLineFunction { class Star(val globalConfig: Config) extends CommandLineFunction {
def this() = this(new Config(Map())) def this() = this(new Config(Map()))
this.analysisName = "STAR" this.analysisName = "star"
val config: Config = globalConfig.getAsConfig("star") val config: Config = Config.mergeConfigs(globalConfig.getAsConfig(analysisName), globalConfig)
logger.debug("Config for " + this.analysisName + ": " + config) logger.debug("Config for " + this.analysisName + ": " + config)
@Argument(doc="STAR executeble", shortName="star_exe", required=false) @Argument(doc="STAR executeble", shortName="star_exe", required=false)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment