diff --git a/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala b/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala index 090b55b1b5a6be93c58f858afc183c69505889dc..a8f5b846e31311fe3a9b9ae884d94b138e32b76c 100644 --- a/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala +++ b/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetCommandLineFunction.scala @@ -18,7 +18,7 @@ import java.io.{ File, FileInputStream, PrintWriter } import java.security.MessageDigest import nl.lumc.sasc.biopet.utils.Logging -import org.broadinstitute.gatk.utils.commandline.{ Gather, Input, Output } +import org.broadinstitute.gatk.utils.commandline.{ Input, Output } import org.broadinstitute.gatk.utils.runtime.ProcessSettings import org.ggf.drmaa.JobTemplate @@ -40,6 +40,8 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction => def defaultRemoteCommand = "bash" private val remoteCommand: String = config("remote_command", default = defaultRemoteCommand) + val preCommands: List[String] = config("pre_commands", default = Nil) + private def changeScript(file: File): Unit = { val lines = Source.fromFile(file).getLines().toList val writer = new PrintWriter(file) @@ -219,7 +221,8 @@ trait BiopetCommandLineFunction extends CommandLineResources { biopetFunction => */ override final def commandLine: String = { preCmdInternal() - val cmd = cmdLine + + val cmd = preCommands.mkString("\n", "\n", "\n") + + cmdLine + stdinFile.map(file => " < " + required(file.getAbsoluteFile)).getOrElse("") + stdoutFile.map(file => " > " + required(file.getAbsoluteFile)).getOrElse("") addJobReportBinding("command", cmd)