From bce349bee83381e191ae2c9588e5338dd8a6fee0 Mon Sep 17 00:00:00 2001
From: bow <bow@bow.web.id>
Date: Mon, 27 Oct 2014 23:48:07 +0100
Subject: [PATCH] Add more CLI validation

---
 .../nl/lumc/sasc/biopet/tools/ExtractAlignedFastq.scala   | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/ExtractAlignedFastq.scala b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/ExtractAlignedFastq.scala
index d53b1afd0..72cf7be79 100644
--- a/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/ExtractAlignedFastq.scala
+++ b/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/ExtractAlignedFastq.scala
@@ -208,8 +208,12 @@ object ExtractAlignedFastq extends ToolCommand {
         |This tool creates FASTQ file(s) containing reads mapped to the given alignment intervals.
       """.stripMargin)
 
-    checkConfig { c=>
-      if (c.inputFastq2 != null && c.outputFastq2 == null)
+    checkConfig { c =>
+      if (!c.inputBam.exists)
+        failure("Input BAM file not found")
+      else if (!c.inputFastq1.exists)
+        failure("Input FASTQ file 1 not found")
+      else if (c.inputFastq2 != null && c.outputFastq2 == null)
         failure("Missing output FASTQ file 2")
       else if (c.inputFastq2 == null && c.outputFastq2 != null)
         failure("Missing input FASTQ file 2")
-- 
GitLab