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

Remove required from config calls

parent b7fe37de
......@@ -13,13 +13,13 @@ trait GatkGeneral extends CommandLineGATK with BiopetJavaCommandLineFunction {
override def subPath = "gatk" :: super.subPath
jarFile = config("gatk_jar", required = true)
jarFile = config("gatk_jar")
override val defaultVmem = "7G"
if (config.contains("intervals")) intervals = config("intervals").asFileList
if (config.contains("exclude_intervals")) excludeIntervals = config("exclude_intervals").asFileList
reference_sequence = config("reference", required = true)
reference_sequence = config("reference")
if (config.contains("gatk_key")) gatk_key = config("gatk_key")
if (config.contains("pedigree")) pedigree = config("pedigree").asFileList
}
......@@ -35,7 +35,7 @@ class GatkPipeline(val root: Configurable) extends QScript with MultiSampleQScri
var jointGenotyping: Boolean = config("joint_genotyping", default = false)
var singleSampleCalling = config("single_sample_calling", default = true)
var reference: File = config("reference", required = true)
var reference: File = config("reference")
var useAllelesOption: Boolean = config("use_alleles_option", default = false)
val externalGvcfs = config("external_gvcfs_files", default = Nil).asFileList
......
......@@ -30,7 +30,7 @@ class GatkVariantcalling(val root: Configurable) extends QScript with BiopetQScr
var rawVcfInput: File = _
@Argument(doc = "Reference", shortName = "R", required = false)
var reference: File = config("reference", required = true)
var reference: File = config("reference")
@Argument(doc = "OutputName", required = false)
var outputName: String = _
......
......@@ -51,7 +51,7 @@ trait BiopetQScript extends Configurable with GatkLogging {
var functions: Seq[QFunction]
final def script() {
outputDir = config("output_dir", required = true)
outputDir = config("output_dir")
if (!outputDir.endsWith("/")) outputDir += "/"
init
biopetScript
......
......@@ -29,7 +29,7 @@ class Bowtie(val root: Configurable) extends BiopetCommandLineFunction {
var R2: File = _
@Input(doc = "The reference file for the bam files.", shortName = "R")
var reference: File = config("reference", required = true)
var reference: File = config("reference")
@Output(doc = "Output file SAM", shortName = "output")
var output: File = _
......
......@@ -29,13 +29,13 @@ class Stampy(val root: Configurable) extends BiopetCommandLineFunction {
var R2: File = _
@Input(doc = "The reference file for the bam files.", shortName = "ref")
var reference: File = config("reference", required = true)
var reference: File = config("reference")
@Input(doc = "The genome prefix.")
var genome: File = config("genome", required = true)
var genome: File = config("genome")
@Input(doc = "The hash prefix")
var hash: File = config("hash", required = true)
var hash: File = config("hash")
@Output(doc = "Output file SAM", shortName = "output")
var output: File = _
......
......@@ -29,7 +29,7 @@ class TopHat(val root: Configurable) extends BiopetCommandLineFunction {
var R2: File = _
@Input(doc = "Bowtie index", shortName = "bti")
var bowtie_index: File = config("bowtie_index", required = true)
var bowtie_index: File = config("bowtie_index")
@Argument(doc = "Output Directory")
var outputDir: String = _
......
......@@ -13,7 +13,7 @@ class BwaAln(val root: Configurable) extends Bwa {
var fastq: File = _
@Input(doc = "The reference file for the bam files.", required = true)
var reference: File = config("reference", required = true)
var reference: File = config("reference")
@Output(doc = "Output file SAM", required = false)
var output: File = _
......
......@@ -29,7 +29,7 @@ class BwaMem(val root: Configurable) extends Bwa {
var R2: File = _
@Input(doc = "The reference file for the bam files.", shortName = "R")
var reference: File = config("reference", required = true)
var reference: File = config("reference")
@Output(doc = "Output file SAM", shortName = "output")
var output: File = _
......
......@@ -26,7 +26,7 @@ class BwaSampe(val root: Configurable) extends Bwa {
var saiR2: File = _
@Input(doc = "The reference file for the bam files.", required = true)
var reference: File = config("reference", required = true)
var reference: File = config("reference")
@Output(doc = "Output file SAM", required = false)
var output: File = _
......
......@@ -16,7 +16,7 @@ class BwaSamse(val root: Configurable) extends Bwa {
var sai: File = _
@Input(doc = "The reference file for the bam files.", required = true)
var reference: File = config("reference", required = true)
var reference: File = config("reference")
@Output(doc = "Output file SAM", required = false)
var output: File = _
......
......@@ -35,7 +35,7 @@ class CollectGcBiasMetrics(val root: Configurable) extends Picard {
var outputSummary: File = _
@Argument(doc = "Reference file", required = false)
var reference: File = config("reference", required = true)
var reference: File = config("reference")
@Argument(doc = "Window size", required = false)
var windowSize: Option[Int] = config("windowsize")
......
......@@ -30,9 +30,6 @@ class ConfigTest extends TestNGSuite with Matchers with ConfigUtils.ImplicitConv
@Test def testApply: Unit = {
ConfigTest.config("m1", Nil, "k1").asString shouldBe "v2"
ConfigTest.config("m1", Nil, "notexist", default = "default").asString shouldBe "default"
intercept[IllegalStateException] {
ConfigTest.config("m1", Nil, "notexist")
}
}
@Test def testMergeConfigs: Unit = {
......
......@@ -27,10 +27,6 @@ class ConfigurableTest extends TestNGSuite with Matchers {
classC.classB.get("k1").asString shouldBe "c1"
classC.classB.classA.get("k1").asString shouldBe "c1"
classC.get("notexist") shouldBe null
intercept[IllegalStateException] {
classC.get("notexist", required = true)
}
classC.get("notexist", default = "default").asString shouldBe "default"
classC.get("k1", freeVar = false).asString shouldBe "c1"
......@@ -47,11 +43,10 @@ abstract class Cfg extends Configurable {
def get(key: String,
default: String = null,
submodule: String = null,
required: Boolean = false,
freeVar: Boolean = true,
sample: String = null,
library: String = null) = {
config(key, default, submodule, required, freeVar = freeVar, sample = sample, library = library)
config(key, default, submodule, freeVar = freeVar, sample = sample, library = library)
}
}
......
......@@ -60,7 +60,7 @@ class Sage(val root: Configurable) extends QScript with MultiSampleQScript {
class Sample(sampleId: String) extends AbstractSample(sampleId) {
def makeLibrary(id: String) = new Library(id)
class Library(libId: String) extends AbstractLibrary(libId) {
val inputFastq: File = config("R1", required = true)
val inputFastq: File = config("R1")
val prefixFastq: File = createFile(".prefix.fastq")
val flexiprep = new Flexiprep(qscript)
......
......@@ -35,7 +35,7 @@ import org.broadinstitute.gatk.queue.engine.JobRunInfo
class Yamsvp(val root: Configurable) extends QScript with BiopetQScript { //with MultiSampleQScript {
def this() = this(null)
var reference: File = config("reference", required = true)
var reference: File = config("reference")
var finalBamFiles: List[File] = Nil
/*
class LibraryOutput extends AbstractLibraryOutput {
......
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