Skip to content
Snippets Groups Projects
Commit 8c71c8ff authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Fix code warnings

parent 96e36e5e
Branches
Tags
No related merge requests found
...@@ -6,25 +6,27 @@ import nl.lumc.sasc.biopet.core.config.Configurable ...@@ -6,25 +6,27 @@ import nl.lumc.sasc.biopet.core.config.Configurable
import org.broadinstitute.gatk.utils.commandline.{Output, Input} import org.broadinstitute.gatk.utils.commandline.{Output, Input}
/** /**
* This class can pipe multiple BiopetCommandFunctions to 1 job
*
* Created by pjvanthof on 08/09/15. * Created by pjvanthof on 08/09/15.
*/ */
class BiopetPipe(val commands: List[BiopetCommandLineFunction]) extends BiopetCommandLineFunction { class BiopetPipe(val commands: List[BiopetCommandLineFunction]) extends BiopetCommandLineFunction {
@Input @Input
lazy val input: List[File] = try { lazy val input: List[File] = try {
commands.map(_.inputs).flatten commands.flatMap(_.inputs)
} catch { } catch {
case e: Exception => Nil case e: Exception => Nil
} }
@Output @Output
lazy val output: List[File] = try { lazy val output: List[File] = try {
commands.map(_.outputs).flatten commands.flatMap(_.outputs)
} catch { } catch {
case e: Exception => Nil case e: Exception => Nil
} }
override def beforeGraph { override def beforeGraph() {
super.beforeGraph() super.beforeGraph()
commands.foreach(_.beforeGraph()) commands.foreach(_.beforeGraph())
...@@ -39,7 +41,7 @@ class BiopetPipe(val commands: List[BiopetCommandLineFunction]) extends BiopetCo ...@@ -39,7 +41,7 @@ class BiopetPipe(val commands: List[BiopetCommandLineFunction]) extends BiopetCo
if (commands.head.stdinFile.isDefined) commands.head._inputAsStdin = true if (commands.head.stdinFile.isDefined) commands.head._inputAsStdin = true
val inputOutput = input.filter(x => output.exists(y => x == y)) val inputOutput = input.filter(x => output.contains(x))
require(inputOutput.isEmpty, "File found as input and output in the same job, files: " + inputOutput.mkString(", ")) require(inputOutput.isEmpty, "File found as input and output in the same job, files: " + inputOutput.mkString(", "))
threads = commands.map(x => if (x.threads > 0) x.threads else 0).sum threads = commands.map(x => if (x.threads > 0) x.threads else 0).sum
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment