From e42e39c69d49f7a083545f55644e0559bf757645 Mon Sep 17 00:00:00 2001 From: Peter van 't Hof <p.j.van_t_hof@lumc.nl> Date: Mon, 16 Feb 2015 19:36:21 +0100 Subject: [PATCH] Fix outputDirs --- .../lumc/sasc/biopet/extensions/Raxml.scala | 23 ++++++++++--------- .../sasc/biopet/extensions/RunGubbins.scala | 5 ++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Raxml.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Raxml.scala index 991325495..12a36ad80 100644 --- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Raxml.scala +++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/Raxml.scala @@ -48,7 +48,7 @@ class Raxml(val root: Configurable) extends BiopetCommandLineFunction { var f: String = "d" @Argument(doc = "Output directory", required = true) - var w: String = _ + var w: File = null var noBfgs: Boolean = config("no_bfgs", default = false) @@ -65,6 +65,7 @@ class Raxml(val root: Configurable) extends BiopetCommandLineFunction { var executableThreads: Option[String] = config("exe_pthreads") override def beforeGraph { + require(w != null) if (threads == 0) threads = getThreads(defaultThreads) executable = if (threads > 1 && executableThreads.isDefined) executableThreads.get else executableNonThreads super.beforeGraph @@ -73,24 +74,24 @@ class Raxml(val root: Configurable) extends BiopetCommandLineFunction { case "d" if b.isEmpty => { out +:= getBestTreeFile for (t <- 0 until N.getOrElse(1)) { - out +:= new File(w + File.separator + "RAxML_log." + n + ".RUN." + t) - out +:= new File(w + File.separator + "RAxML_parsimonyTree." + n + ".RUN." + t) - out +:= new File(w + File.separator + "RAxML_result." + n + ".RUN." + t) + out +:= new File(w, "RAxML_log." + n + ".RUN." + t) + out +:= new File(w, "RAxML_parsimonyTree." + n + ".RUN." + t) + out +:= new File(w, "RAxML_result." + n + ".RUN." + t) } } case "d" if b.isDefined => out +:= getBootstrapFile case "b" => { - out +:= new File(w + File.separator + "RAxML_bipartitionsBranchLabels." + n) - out +:= new File(w + File.separator + "RAxML_bipartitions." + n) + out +:= new File(w, "RAxML_bipartitionsBranchLabels." + n) + out +:= new File(w, "RAxML_bipartitions." + n) } case _ => } } - def getBestTreeFile: File = new File(w + File.separator + "RAxML_bestTree." + n) - def getBootstrapFile: File = new File(w + File.separator + "RAxML_bootstrap." + n) - def getBipartitionsFile: File = new File(w + File.separator + "RAxML_bipartitions." + n) - def getInfoFile: File = new File(w + File.separator + "RAxML_info." + n) + def getBestTreeFile: File = new File(w, "RAxML_bestTree." + n) + def getBootstrapFile: File = new File(w, "RAxML_bootstrap." + n) + def getBipartitionsFile: File = new File(w, "RAxML_bipartitions." + n) + def getInfoFile: File = new File(w, "RAxML_info." + n) def cmdLine = required(executable) + required("-m", m) + @@ -103,6 +104,6 @@ class Raxml(val root: Configurable) extends BiopetCommandLineFunction { optional("-f", f) + optional("-t", t) + optional("-z", z) + - conditional(noBfgs, "--no-bgfs") + + conditional(noBfgs, "--no-bfgs") + required("-T", threads) } diff --git a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/RunGubbins.scala b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/RunGubbins.scala index a041f5dc7..454572dab 100644 --- a/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/RunGubbins.scala +++ b/public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/extensions/RunGubbins.scala @@ -33,7 +33,7 @@ class RunGubbins(val root: Configurable) extends BiopetCommandLineFunction { var outputFiles: List[File] = Nil @Argument(required = true) - var outputDirectory: String = _ + var outputDirectory: File = null executable = config("exe", default = "run_gubbins.py") var outgroup: Option[String] = config("outgroup") @@ -49,7 +49,8 @@ class RunGubbins(val root: Configurable) extends BiopetCommandLineFunction { override def beforeGraph: Unit = { super.beforeGraph - jobLocalDir = new File(outputDirectory) + require(outputDirectory != null) + jobLocalDir = outputDirectory if (prefix.isEmpty) prefix = Some(fastafile.getName) val out: List[String] = List(".recombination_predictions.embl", ".recombination_predictions.gff", -- GitLab