Commit 6645de03 authored by Peter van 't Hof's avatar Peter van 't Hof

Change vals to defs

parent 30ddf578
......@@ -15,15 +15,15 @@ trait GatkGeneral extends CommandLineGATK with BiopetJavaCommandLineFunction wit
jarFile = config("gatk_jar")
override val defaultCoreMemory = 4.0
override def defaultCoreMemory = 4.0
if (config.contains("intervals")) intervals = config("intervals").asFileList
if (config.contains("exclude_intervals")) excludeIntervals = config("exclude_intervals").asFileList
if (config.contains("gatk_key")) gatk_key = config("gatk_key")
if (config.contains("pedigree")) pedigree = config("pedigree")
override val versionRegex = """(.*)""".r
override val versionExitcode = List(0, 1)
override def versionRegex = """(.*)""".r
override def versionExitcode = List(0, 1)
override def versionCommand = executable + " -jar " + jarFile + " -version"
override def getVersion = super.getVersion.collect { case version => "Gatk " + version }
......
......@@ -33,11 +33,11 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
var deps: List[File] = Nil
var threads = 0
val defaultThreads = 1
def defaultThreads = 1
var vmem: Option[String] = config("vmem")
protected val defaultCoreMemory: Double = 1.0
protected val defaultVmemFactor: Double = 1.4
protected def defaultCoreMemory: Double = 1.0
protected def defaultVmemFactor: Double = 1.4
var vmemFactor: Double = config("vmem_factor", default = defaultVmemFactor)
var residentFactor: Double = config("resident_factor", default = 1.2)
......@@ -151,10 +151,10 @@ trait BiopetCommandLineFunctionTrait extends CommandLineFunction with Configurab
protected def versionCommand: String = null
/** Regex to get version from version command output */
protected val versionRegex: Regex = null
protected def versionRegex: Regex = null
/** Allowed exit codes for the version command */
protected val versionExitcode = List(0)
protected def versionExitcode = List(0)
/** Executes the version command */
private[core] def getVersionInternal(): Option[String] = {
......
......@@ -25,7 +25,7 @@ trait BiopetJavaCommandLineFunction extends JavaCommandLineFunction with BiopetC
javaGCHeapFreeLimit = config("java_gc_heap_freelimit")
javaGCTimeLimit = config("java_gc_timelimit")
override protected val defaultVmemFactor: Double = 2.0
override protected def defaultVmemFactor: Double = 2.0
/** Constructs java opts, this adds scala threads */
override def javaOpts = super.javaOpts +
......
......@@ -26,7 +26,7 @@ trait ReportBuilderExtension extends ToolCommandFuntion {
/** Arguments that are passed on the commandline */
var args: Map[String, String] = Map()
override val defaultCoreMemory = 3.0
override def defaultCoreMemory = 3.0
override def beforeGraph: Unit = {
super.beforeGraph
......
......@@ -40,12 +40,12 @@ class Bowtie(val root: Configurable) extends BiopetCommandLineFunction with Refe
var output: File = null
executable = config("exe", default = "bowtie", freeVar = false)
override val versionRegex = """.*[Vv]ersion:? (.*)""".r
override val versionExitcode = List(0, 1)
override def versionRegex = """.*[Vv]ersion:? (.*)""".r
override def versionExitcode = List(0, 1)
override def versionCommand = executable + " --version"
override val defaultCoreMemory = 4.0
override val defaultThreads = 8
override def defaultCoreMemory = 4.0
override def defaultThreads = 8
var sam: Boolean = config("sam", default = true)
var sam_RG: Option[String] = config("sam-RG")
......
......@@ -30,10 +30,10 @@ class Cufflinks(val root: Configurable) extends BiopetCommandLineFunction {
executable = config("exe", default = "cufflinks")
/** default threads */
override val defaultThreads = 8
override def defaultThreads = 8
/** default vmem for cluster jobs */
override val defaultCoreMemory = 6.0
override def defaultCoreMemory = 6.0
/** input file */
@Input(doc = "Input file (SAM or BAM)", required = true)
......@@ -184,9 +184,9 @@ class Cufflinks(val root: Configurable) extends BiopetCommandLineFunction {
/** do not contact server to check for update availability [FALSE] */
var no_update_check: Boolean = config("no_update_check", default = false)
override val versionRegex = """cufflinks v(.*)""".r
override def versionRegex = """cufflinks v(.*)""".r
override def versionCommand = executable
override val versionExitcode = List(0, 1)
override def versionExitcode = List(0, 1)
def cmdLine =
required(executable) +
......
......@@ -117,9 +117,9 @@ class Cuffquant(val root: Configurable) extends BiopetCommandLineFunction {
/** Disable SCV correction */
var no_scv_correction: Boolean = config("no_scv_correction", default = false)
override val versionRegex = """cuffquant v(.*)""".r
override def versionRegex = """cuffquant v(.*)""".r
override def versionCommand = executable
override val versionExitcode = List(0, 1)
override def versionExitcode = List(0, 1)
def cmdLine =
required(executable) +
......
......@@ -40,7 +40,7 @@ class Cutadapt(val root: Configurable) extends BiopetCommandLineFunction with Su
executable = config("exe", default = "cutadapt")
override def versionCommand = executable + " --version"
override val versionRegex = """(.*)""".r
override def versionRegex = """(.*)""".r
var default_clip_mode: String = config("default_clip_mode", default = "3")
var opt_adapter: Set[String] = config("adapter", default = Nil)
......
......@@ -48,9 +48,9 @@ class Fastqc(val root: Configurable) extends BiopetCommandLineFunction {
var nogroup: Boolean = config("nogroup", default = false)
var extract: Boolean = config("extract", default = true)
override val versionRegex = """FastQC (.*)""".r
override def versionRegex = """FastQC (.*)""".r
override def versionCommand = executable + " --version"
override val defaultThreads = 4
override def defaultThreads = 4
/** Sets contaminants and adapters when not yet set */
override def beforeGraph {
......
......@@ -39,7 +39,7 @@ class Freebayes(val root: Configurable) extends BiopetCommandLineFunction with R
var haplotypeLength: Option[Int] = config("haplotype_length")
executable = config("exe", default = "freebayes")
override val versionRegex = """version: (.*)""".r
override def versionRegex = """version: (.*)""".r
override def versionCommand = executable + " --version"
override def beforeGraph: Unit = {
......
......@@ -32,10 +32,10 @@ class Gsnap(val root: Configurable) extends BiopetCommandLineFunction with Refer
executable = config("exe", default = "gsnap", freeVar = false)
/** default threads */
override val defaultThreads = 8
override def defaultThreads = 8
/** default vmem for cluster jobs */
override val defaultCoreMemory = 10.0
override def defaultCoreMemory = 10.0
/** input file */
@Input(doc = "Input FASTQ file(s)", required = true) //var input: List[File] = _
......@@ -329,7 +329,7 @@ class Gsnap(val root: Configurable) extends BiopetCommandLineFunction with Refer
/** value to put into read-group library (rg-pl) field */
var read_group_platform: Option[String] = config("read_group_platform")
override val versionRegex = """.* version (.*)""".r
override def versionRegex = """.* version (.*)""".r
override def versionCommand = executable + " --version"
def cmdLine = {
......
......@@ -29,7 +29,7 @@ class Gzip(val root: Configurable) extends BiopetCommandLineFunction {
executable = config("exe", default = "gzip")
override val versionRegex = """gzip (.*)""".r
override def versionRegex = """gzip (.*)""".r
override def versionCommand = executable + " --version"
def cmdLine = required(executable) + " -c " + repeat(input) + " > " + required(output)
......
......@@ -69,7 +69,7 @@ class HtseqCount(val root: Configurable) extends BiopetCommandLineFunction {
/** suppress progress report */
var quiet: Boolean = config("quiet", default = false)
override val versionRegex = """.*, version (.*)\.""".r
override def versionRegex = """.*, version (.*)\.""".r
override def versionCommand = executable + " --help"
def cmdLine = {
......
......@@ -33,7 +33,7 @@ class Md5sum(val root: Configurable) extends BiopetCommandLineFunction {
executable = config("exe", default = "md5sum")
override val versionRegex = """md5sum \(GNU coreutils\) (.*)""".r
override def versionRegex = """md5sum \(GNU coreutils\) (.*)""".r
override def versionCommand = executable + " --version"
/** return commandline to execute */
......
......@@ -33,8 +33,8 @@ class Pbzip2(val root: Configurable) extends BiopetCommandLineFunction {
var decomrpess = true
var memory: Option[Int] = config("memory")
override val defaultCoreMemory = memory.getOrElse(1000).toDouble / 1000
override val defaultThreads = 2
override def defaultCoreMemory = memory.getOrElse(1000).toDouble / 1000
override def defaultThreads = 2
override def beforeCmd {
if (!memory.isEmpty) memory = Option(memory.get * threads)
......
......@@ -27,9 +27,9 @@ import scalaz.std.boolean.option
*/
class Raxml(val root: Configurable) extends BiopetCommandLineFunction {
override val defaultThreads = 1
override def defaultThreads = 1
override def versionCommand = executable + " -v"
override val versionRegex = """.*version ([\w\.]*) .*""".r
override def versionRegex = """.*version ([\w\.]*) .*""".r
@Input(doc = "Input phy/fasta file", required = true)
var input: File = _
......
......@@ -58,7 +58,7 @@ class Sickle(val root: Configurable) extends BiopetCommandLineFunction with Summ
var discardN: Boolean = config("discardN", default = false)
var quiet: Boolean = config("quiet", default = false)
var defaultQualityType: String = config("defaultqualitytype", default = "sanger")
override val versionRegex = """sickle version (.*)""".r
override def versionRegex = """sickle version (.*)""".r
override def versionCommand = executable + " --version"
/** Sets qualityType is still empty */
......
......@@ -60,12 +60,12 @@ class Stampy(val root: Configurable) extends BiopetCommandLineFunction with Refe
var logfile: Option[String] = config("logfile")
executable = config("exe", default = "stampy.py", freeVar = false)
override val versionRegex = """stampy v(.*) \(.*\), .*""".r
override val versionExitcode = List(0, 1)
override def versionRegex = """stampy v(.*) \(.*\), .*""".r
override def versionExitcode = List(0, 1)
/// Stampy uses approx factor 1.1 times the size of the genome in memory.
override val defaultCoreMemory = 4.0
override val defaultThreads = 8
override def defaultCoreMemory = 4.0
override def defaultThreads = 8
override def versionCommand = executable + " --help"
......
......@@ -63,8 +63,8 @@ class Star(val root: Configurable) extends BiopetCommandLineFunction with Refere
var outFileNamePrefix: String = _
var runThreadN: Option[Int] = config("runThreadN")
override val defaultCoreMemory = 4.0
override val defaultThreads = 8
override def defaultCoreMemory = 4.0
override def defaultThreads = 8
/** Sets output files for the graph */
override def beforeGraph() {
......
......@@ -60,8 +60,8 @@ class Tabix(val root: Configurable) extends BiopetCommandLineFunction {
executable = config("exe", default = "tabix")
override def versionCommand = executable
override val versionRegex = """Version: (.*)""".r
override val versionExitcode = List(0, 1)
override def versionRegex = """Version: (.*)""".r
override def versionExitcode = List(0, 1)
/** Formats that tabix can handle */
private val validFormats: Set[String] = Set("gff", "bed", "sam", "vcf", "psltbl")
......
......@@ -28,12 +28,12 @@ class Tophat(val root: Configurable) extends BiopetCommandLineFunction {
executable = config("exe", default = "tophat", freeVar = false)
override val versionRegex = """TopHat v(.*)""".r
override val versionExitcode = List(0, 1)
override def versionRegex = """TopHat v(.*)""".r
override def versionExitcode = List(0, 1)
override def versionCommand = executable + " --version"
override val defaultCoreMemory = 4.0
override val defaultThreads = 8
override def defaultCoreMemory = 4.0
override def defaultThreads = 8
@Input(doc = "FastQ file(s) R1", shortName = "R1")
var R1: List[File] = List.empty[File]
......
......@@ -36,7 +36,7 @@ class VariantEffectPredictor(val root: Configurable) extends BiopetCommandLineFu
@Output(doc = "output file", required = true)
var output: File = null
override val versionRegex = """version (\d*)""".r
override def versionRegex = """version (\d*)""".r
override def versionCommand = executable + " " + vep_script + " --help"
//Boolean vars
......@@ -134,7 +134,7 @@ class VariantEffectPredictor(val root: Configurable) extends BiopetCommandLineFu
var cache_region_size: Option[String] = config("cache_region_size")
// Numeric args
override val defaultThreads: Int = config("fork", default = 2)
override def defaultThreads: Int = config("fork", default = 2)
var cache_version: Option[Int] = config("cache_version")
var freq_freq: Option[Float] = config("freq_freq")
var port: Option[Int] = config("port")
......
......@@ -30,7 +30,7 @@ class Zcat(val root: Configurable) extends BiopetCommandLineFunction {
executable = config("exe", default = "zcat")
override val versionRegex = """zcat \(gzip\) (.*)""".r
override def versionRegex = """zcat \(gzip\) (.*)""".r
override def versionCommand = executable + " --version"
/** Returns command to execute */
......
......@@ -21,6 +21,6 @@ abstract class Bcftools extends BiopetCommandLineFunction {
override def subPath = "bcftools" :: super.subPath
executable = config("exe", default = "bcftools")
override def versionCommand = executable
override val versionRegex = """Version: (.*)""".r
override val versionExitcode = List(0, 1)
override def versionRegex = """Version: (.*)""".r
override def versionExitcode = List(0, 1)
}
\ No newline at end of file
......@@ -22,5 +22,5 @@ abstract class Bedtools extends BiopetCommandLineFunction {
override def subPath = "bedtools" :: super.subPath
executable = config("exe", default = "bedtools", submodule = "bedtools")
override def versionCommand = executable + " --version"
override val versionRegex = """bedtools (.*)""".r
override def versionRegex = """bedtools (.*)""".r
}
\ No newline at end of file
......@@ -46,7 +46,7 @@ class BedtoolsCoverage(val root: Configurable) extends Bedtools {
if (input.getName.endsWith(".bam")) inputTag = "-abam"
}
override val defaultCoreMemory = 4.0
override def defaultCoreMemory = 4.0
/** Returns command to execute */
def cmdLine = required(executable) + required("coverage") +
......
......@@ -9,10 +9,10 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
class BreakdancerCaller(val root: Configurable) extends BiopetCommandLineFunction {
executable = config("exe", default = "breakdancer-max", freeVar = false)
override val defaultThreads = 1 // breakdancer can only work on 1 single thread
override def defaultThreads = 1 // breakdancer can only work on 1 single thread
override val versionRegex = """.*[Vv]ersion:? (.*)""".r
override val versionExitcode = List(1)
override def versionRegex = """.*[Vv]ersion:? (.*)""".r
override def versionExitcode = List(1)
override def versionCommand = executable
@Input(doc = "The breakdancer configuration file")
......
......@@ -25,7 +25,7 @@ import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
abstract class Bwa extends BiopetCommandLineFunction {
override def subPath = "bwa" :: super.subPath
executable = config("exe", default = "bwa")
override val versionRegex = """Version: (.*)""".r
override val versionExitcode = List(0, 1)
override def versionRegex = """Version: (.*)""".r
override def versionExitcode = List(0, 1)
override def versionCommand = executable
}
......@@ -61,8 +61,8 @@ class BwaAln(val root: Configurable) extends Bwa with Reference {
var n2: Boolean = config("2", default = false)
var Y: Boolean = config("Y", default = false)
override val defaultCoreMemory = 4.0
override val defaultThreads = 8
override def defaultCoreMemory = 4.0
override def defaultThreads = 8
override def beforeGraph {
super.beforeGraph
......
......@@ -69,8 +69,8 @@ class BwaMem(val root: Configurable) extends Bwa with Reference {
var Y: Boolean = config("Y", default = false)
var I: Option[String] = config("I")
override val defaultCoreMemory = 4.0
override val defaultThreads = 8
override def defaultCoreMemory = 4.0
override def defaultThreads = 8
override def beforeGraph {
super.beforeGraph
......
......@@ -11,11 +11,11 @@ class CleverCaller(val root: Configurable) extends BiopetCommandLineFunction {
private lazy val versionexecutable: File = config("version_exe", default = (new File(executable).getParent + "/ctk-version"))
override val defaultThreads = 8
override def defaultThreads = 8
override def versionCommand = versionexecutable.getAbsolutePath
override val versionRegex = """(.*)""".r
override val versionExitcode = List(0, 1)
override def versionRegex = """(.*)""".r
override def versionExitcode = List(0, 1)
@Input(doc = "Input file (bam)")
var input: File = _
......
......@@ -22,12 +22,12 @@ abstract class Conifer extends PythonCommandLineFunction {
override def subPath = "conifer" :: super.subPath
// executable = config("exe", default = "conifer")
setPythonScript(config("script", default = "conifer"))
override val versionRegex = """(.*)""".r
override val versionExitcode = List(0)
override def versionRegex = """(.*)""".r
override def versionExitcode = List(0)
override def versionCommand = executable + " " + python_script + " --version"
override val defaultCoreMemory = 5.0
override val defaultThreads = 1
override def defaultCoreMemory = 5.0
override def defaultThreads = 1
def cmdLine = getPythonCommand
......
......@@ -12,11 +12,11 @@ class DellyCaller(val root: Configurable) extends BiopetCommandLineFunction {
private lazy val versionexecutable: File = new File(executable)
override val defaultThreads = 1
override def defaultThreads = 1
override def versionCommand = versionexecutable.getAbsolutePath
override val versionRegex = """DELLY \(Version: (.*)\)""".r
override val versionExitcode = List(0, 1)
override def versionRegex = """DELLY \(Version: (.*)\)""".r
override def versionExitcode = List(0, 1)
@Input(doc = "Input file (bam)")
var input: File = _
......
......@@ -31,7 +31,7 @@ abstract class Gatk extends BiopetJavaCommandLineFunction with Reference {
val analysisType: String
override val defaultCoreMemory = 3.0
override def defaultCoreMemory = 3.0
@Input(required = true)
var reference: File = null
......@@ -48,8 +48,8 @@ abstract class Gatk extends BiopetJavaCommandLineFunction with Reference {
@Input(required = false)
var pedigree: List[File] = config("pedigree", default = Nil)
override val versionRegex = """(.*)""".r
override val versionExitcode = List(0, 1)
override def versionRegex = """(.*)""".r
override def versionExitcode = List(0, 1)
override def versionCommand = executable + " -jar " + jarFile + " -version"
override def getVersion = super.getVersion.collect { case version => "Gatk " + version }
......
......@@ -25,6 +25,6 @@ import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
abstract class IGVTools extends BiopetCommandLineFunction {
executable = config("exe", default = "igvtools", submodule = "igvtools", freeVar = false)
override def versionCommand = executable + " version"
override val versionRegex = """IGV Version:? ([\w\.]*) .*""".r
override val versionExitcode = List(0)
override def versionRegex = """IGV Version:? ([\w\.]*) .*""".r
override def versionExitcode = List(0)
}
\ No newline at end of file
......@@ -59,7 +59,7 @@ class IGVToolsCount(val root: Configurable) extends IGVTools {
var pairs: Boolean = config("pairs", default = false)
override val defaultCoreMemory = 4.0
override def defaultCoreMemory = 4.0
override def beforeGraph {
super.beforeGraph
......
......@@ -51,11 +51,11 @@ class Kraken(val root: Configurable) extends BiopetCommandLineFunction {
var paired: Boolean = config("paired", default = false)
executable = config("exe", default = "kraken")
override val versionRegex = """Kraken version ([\d\w\-\.]+)\n.*""".r
override val versionExitcode = List(0, 1)
override def versionRegex = """Kraken version ([\d\w\-\.]+)\n.*""".r
override def versionExitcode = List(0, 1)
override val defaultCoreMemory = 8.0
override val defaultThreads = 4
override def defaultCoreMemory = 8.0
override def defaultThreads = 4
override def versionCommand = executable + " --version"
......
......@@ -26,11 +26,11 @@ import org.broadinstitute.gatk.utils.commandline.{ Input, Output }
class KrakenReport(val root: Configurable) extends BiopetCommandLineFunction {
executable = config("exe", default = "kraken-report")
override val versionRegex = """Kraken version (.*)""".r
override val versionExitcode = List(0, 1)
override def versionRegex = """Kraken version (.*)""".r
override def versionExitcode = List(0, 1)
override val defaultCoreMemory = 4.0
override val defaultThreads = 1
override def defaultCoreMemory = 4.0
override def defaultThreads = 1
override def versionCommand = new File(new File(executable).getParent, "kraken").getAbsolutePath + " --version"
......
......@@ -25,6 +25,6 @@ import nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
abstract class Macs2 extends BiopetCommandLineFunction {
executable = config("exe", default = "macs2", submodule = "macs2", freeVar = false)
override def versionCommand = executable + " --version"
override val versionRegex = """macs2 (.*)""".r
override val versionExitcode = List(0, 1)
override def versionRegex = """macs2 (.*)""".r
override def versionExitcode = List(0, 1)
}
......@@ -15,7 +15,7 @@ class CollectMultipleMetrics(val root: Configurable) extends Picard with Summari
javaMainClass = new picard.analysis.CollectMultipleMetrics().getClass.getName
override val defaultCoreMemory = 6.0
override def defaultCoreMemory = 6.0
@Input(doc = "The input SAM or BAM files to analyze", required = true)
var input: File = null
......
......@@ -58,10 +58,10 @@ abstract class Picard extends BiopetJavaCommandLineFunction {
if (jarFile != null) executable + " -cp " + jarFile + " " + javaMainClass + " -h"
else null
}
override val versionRegex = """Version: (.*)""".r