diff --git a/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/PipelineCommand.scala b/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/PipelineCommand.scala index dcede52573eb901026c7e62deb9d071d486df9fb..928bee57a9da53decce94c5e611d0c934c1f93a5 100644 --- a/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/PipelineCommand.scala +++ b/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/PipelineCommand.scala @@ -18,13 +18,14 @@ package nl.lumc.sasc.biopet.core import java.io.{ File, PrintWriter } import nl.lumc.sasc.biopet.utils.config.Config +import nl.lumc.sasc.biopet.utils.ConfigUtils.ImplicitConversions import nl.lumc.sasc.biopet.core.workaround.BiopetQCommandLine import nl.lumc.sasc.biopet.utils.{ MainCommand, Logging } import org.apache.log4j.{ PatternLayout, WriterAppender } import org.broadinstitute.gatk.queue.util.{ Logging => GatkLogging } /** Wrapper around executable from Queue */ -trait PipelineCommand extends MainCommand with GatkLogging { +trait PipelineCommand extends MainCommand with GatkLogging with ImplicitConversions { /** * Gets location of compiled class of pipeline @@ -32,6 +33,8 @@ trait PipelineCommand extends MainCommand with GatkLogging { */ def pipeline = "/" + getClass.getName.stripSuffix("$").replaceAll("\\.", "/") + ".class" + def pipelineName = getClass.getSimpleName.takeWhile(_ != '$').toLowerCase + /** Class can be used directly from java with -cp option */ def main(args: Array[String]): Unit = { val argsSize = args.length @@ -87,6 +90,11 @@ trait PipelineCommand extends MainCommand with GatkLogging { if (!args.contains("--log_to_file") && !args.contains("-log")) { argv ++= List("--log_to_file", new File(logFile.getParentFile, "queue." + BiopetQCommandLine.timestamp + ".log").getAbsolutePath) } + if (!args.contains("-retry") && !args.contains("--retry_failed")) { + val retry: Int = Config.global(pipelineName, Nil, "retry", default = 5) + logger.info("No retry flag found, ") + argv ++= List("-retry", retry.toString) + } BiopetQCommandLine.main(argv) } } \ No newline at end of file diff --git a/public/biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/config/Config.scala b/public/biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/config/Config.scala index 4c69bf57c8be5332aeb3f1cc3d1f78b2ae204007..a3b8a8ab006a08eaa237ab5c680406344204f1bf 100644 --- a/public/biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/config/Config.scala +++ b/public/biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/config/Config.scala @@ -168,12 +168,12 @@ class Config(protected var _map: Map[String, Any], * @param freeVar Default true, if set false value must exist in module * @return Config value */ - protected[config] def apply(module: String, - path: List[String], - key: String, - default: Any = null, - freeVar: Boolean = true, - fixedValues: Map[String, Any] = Map()): ConfigValue = { + def apply(module: String, + path: List[String], + key: String, + default: Any = null, + freeVar: Boolean = true, + fixedValues: Map[String, Any] = Map()): ConfigValue = { val requestedIndex = ConfigValueIndex(module, path, key, freeVar) if (contains(requestedIndex, fixedValues)) { val fixedValue = fixedCache.get(requestedIndex)