diff --git a/dge_workflow/dge_utils.sh b/dge_workflow/dge_utils.sh index dadb9ce674dab4a856d70dc2d7c823dd2beb1e05..16e697dfb31fff467feec82fd2375a1ca243650f 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}"