From 6ca9d8beb1aefd68bc4fa6a9ada5bed6c009844b Mon Sep 17 00:00:00 2001 From: bow <bow@bow.web.id> Date: Thu, 5 Mar 2015 10:30:14 +0100 Subject: [PATCH] Update Tabix wrapper --- .../scala/nl/lumc/sasc/biopet/extensions/Tabix.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Tabix.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Tabix.scala index 0fb2a914d..c32326f34 100644 --- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Tabix.scala +++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Tabix.scala @@ -36,7 +36,7 @@ class Tabix(val root: Configurable) extends BiopetCommandLineFunction { var outputQuery: File = null @Output(doc = "Output (for indexing)", required = false) // NOTE: it's a def since we can't change the index name ~ it's always input_name + .tbi - def outputIndex: File = { + lazy val outputIndex: File = { require(input != null, "Input must be defined") new File(input.toString + ".tbi") } @@ -44,7 +44,7 @@ class Tabix(val root: Configurable) extends BiopetCommandLineFunction { @Argument(doc = "Regions to query", required = false) var regions: List[String] = config("regions", default = List.empty[String]) - var p: String = config("p") + var p: Option[String] = config("p") var s: Option[Int] = config("s") var b: Option[Int] = config("b") var e: Option[Int] = config("e") @@ -67,7 +67,11 @@ class Tabix(val root: Configurable) extends BiopetCommandLineFunction { private val validFormats: Set[String] = Set("gff", "bed", "sam", "vcf", "psltbl") override def beforeGraph: Unit = { - require(validFormats.contains(p), "-p flag must be one of " + validFormats.mkString(", ")) + p match { + case Some(fmt) => + require(validFormats.contains(fmt), "-p flag must be one of " + validFormats.mkString(", ")) + case None => ; + } } def cmdLine = { -- GitLab