From b32e2aa72b026b491f10a56111e1bf392e7d1e9a Mon Sep 17 00:00:00 2001
From: Holger Brandl <holgerbrandl@gmail.com>
Date: Tue, 15 Mar 2016 18:15:05 +0100
Subject: [PATCH] improved bash wrapper

---
 dge_workflow/star_align.kts | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dge_workflow/star_align.kts b/dge_workflow/star_align.kts
index 9ece376..17a0dcd 100755
--- a/dge_workflow/star_align.kts
+++ b/dge_workflow/star_align.kts
@@ -28,18 +28,21 @@ Options:
 """
 
 
-
 val doArgs = Docopt(usage).parse(args.toList()).map {
-    it.key.removePrefix("--").replace("[<>]", "") to it.value?.toString()
+    it.key.removePrefix("--").replace("[<>]".toRegex(), "") to it.value?.toString()
 }.toMap()
 
+//println(doArgs.keys.joinToString())
+//println(doArgs.values.joinToString())
+//doArgs["fastq_files"]
 
 // extract all configuration parameters
-val fastqFiles = (doArgs["fastq_files"] as String).split(" ").map { File(it) }
+val fastqFiles = (doArgs["fastq_files"] as String).substring(1).substringBefore("]").split(" ").map { File(it) }
 val igenome = File(doArgs["igenome"])
 val star_index = File(igenome, "Sequence/StarIndex")
 val gtfFile = if (doArgs["gtfFile"] != null) File(doArgs["gtfFile"]) else File(igenome, "Annotation/Genes/genes.gtf")
 
+println("validating inputs...")
 
 
 // make sure that STAR is in the PATH
-- 
GitLab