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 0fb2a914dca601be80069b3c59a33224b748f7ce..c32326f342ea6d4e2b690b51a4755d84c561cb14 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 = {