From 20cd7b6d381320bbd0cbaa745a0b9bed0b6edff0 Mon Sep 17 00:00:00 2001
From: Peter van 't Hof <p.j.van_t_hof@lumc.nl>
Date: Fri, 30 Oct 2015 12:53:58 +0100
Subject: [PATCH] Added input file checking

---
 .../scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala    | 2 +-
 .../scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala b/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
index 1109f30da..4cbcfdb68 100644
--- a/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
+++ b/public/biopet-core/src/main/scala/nl/lumc/sasc/biopet/core/BiopetQScript.scala
@@ -119,5 +119,5 @@ trait BiopetQScript extends Configurable with GatkLogging {
 }
 
 object BiopetQScript {
-  protected case class InputFile(file: File, md5: Option[String] = None)
+  case class InputFile(file: File, md5: Option[String] = None)
 }
diff --git a/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala b/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
index d8d72c851..b2af00dd2 100644
--- a/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
+++ b/public/gears/src/main/scala/nl/lumc/sasc/biopet/pipelines/gears/Gears.scala
@@ -16,6 +16,7 @@
 package nl.lumc.sasc.biopet.pipelines.gears
 
 import nl.lumc.sasc.biopet.core.summary.SummaryQScript
+import nl.lumc.sasc.biopet.core.BiopetQScript.InputFile
 import nl.lumc.sasc.biopet.core.{ PipelineCommand, SampleLibraryTag }
 import nl.lumc.sasc.biopet.extensions.kraken.{ Kraken, KrakenReport }
 import nl.lumc.sasc.biopet.extensions.picard.SamToFastq
@@ -55,6 +56,13 @@ class Gears(val root: Configurable) extends QScript with SummaryQScript with Sam
         .getOrElse("noName")
       else outputName = bamFile.map(_.getName.stripSuffix(".bam")).getOrElse("noName")
     }
+
+    if (fastqR1.isDefined) {
+      fastqR1.foreach(inputFiles :+= InputFile(_))
+      fastqR2.foreach(inputFiles :+= InputFile(_))
+    } else {
+      inputFiles :+= InputFile(bamFile.get)
+    }
   }
 
   override def reportClass = {
-- 
GitLab