aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xSelectiveWholeGenomeAmplification8
1 files changed, 7 insertions, 1 deletions
diff --git a/SelectiveWholeGenomeAmplification b/SelectiveWholeGenomeAmplification
index 8fb5e4f..e807690 100755
--- a/SelectiveWholeGenomeAmplification
+++ b/SelectiveWholeGenomeAmplification
@@ -3,6 +3,12 @@
set -e
# arguments:
+# remove lock if error exit
+exit_handler() {
+ rmdir $tmp_directory/counts-lock
+ exit 1
+}
+
# check_non_empty
check_non_empty() {
if [[ ! -s $1 ]]; then
@@ -31,7 +37,7 @@ check_mers() {
for (( mer = min_mer_range; mer <= max_mer_range; mer++)) ; do
if [[ ! -e "$counts"-counts-"$mer" ]]; then
echo " checking $mer mers for $fasta_file"
- kmer_total_count -c -i "$fasta_file" -k "$mer" -l -n > "$counts"-counts-"$mer" || exit 1
+ kmer_total_count -c -i "$fasta_file" -k "$mer" -l -n > "$counts"-counts-"$mer" || exit_handler
else
echo " $mer-mers already done for $fasta_file (assuming no change)"
fi