From 63d9ea9057947d711cd4eb15de8d54f80b833ab5 Mon Sep 17 00:00:00 2001
From: Holger Brandl <holgerbrandl@gmail.com>
Date: Tue, 8 Sep 2015 10:03:02 +0200
Subject: [PATCH] added warning if index already existis

---
 dge_workflow/dge_utils.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dge_workflow/dge_utils.sh b/dge_workflow/dge_utils.sh
index dadb9ce..16e697d 100755
--- a/dge_workflow/dge_utils.sh
+++ b/dge_workflow/dge_utils.sh
@@ -414,6 +414,12 @@ dge_create_star_index(){
     fi
 
     export star_index="${igenome}/Sequence/StarIndex"
+
+    ## stop if index exists already
+    if [ -d "$star_index" ]; then
+        echo "Error: Index directory ${star_index} already exists." >&2 ; return;
+    fi
+
     chmod +w $(dirname ${star_index})
 
     mailme "${project}: creating STAR index in ${star_index}"
-- 
GitLab