diff options
author | Calvin Morrison <mutantturkey@gmail.com> | 2014-04-18 12:06:21 -0400 |
---|---|---|
committer | Calvin Morrison <mutantturkey@gmail.com> | 2014-04-18 12:06:21 -0400 |
commit | 2ebd92bd9d3acdf3902cc985dcabd99bf6182351 (patch) | |
tree | 5de344c812ec29ae2770474450fdf976079c001b /SelectiveWholeGenomeAmplification | |
parent | 48c27ee437771a815bff4fde413e9d9e09fa9f62 (diff) |
remove lock if fail
Diffstat (limited to 'SelectiveWholeGenomeAmplification')
-rwxr-xr-x | SelectiveWholeGenomeAmplification | 8 |
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 |