| 1 | #! /bin/sh |
| 2 | |
| 3 | # Usage: |
| 4 | # ./i4-zerolength-seqs.sh <builddir> <srcdir> <HMM database> <tmpfile prefix> |
| 5 | # |
| 6 | # Example: |
| 7 | # ../src/hmmbuild minifam.hmm minifam |
| 8 | # ../src/hmmpress minifam.hmm |
| 9 | # ./i4-zerolength-seqs.sh .. .. minifam.hmm baz |
| 10 | # rm minifam.hmm* |
| 11 | # |
| 12 | # Verifies that the search programs can take zero length sequences as |
| 13 | # input without crashing. |
| 14 | # |
| 15 | # The <HMM database> must be press'ed, for hmmscan to work on it. |
| 16 | |
| 17 | if test ! $# -eq 4; then |
| 18 | echo "Usage: $0 <builddir> <srcdir> <HMM database> <tmpfile prefix>" |
| 19 | exit 1 |
| 20 | fi |
| 21 | |
| 22 | builddir=$1; |
| 23 | srcdir=$2; |
| 24 | hmmfile=$3; |
| 25 | tmppfx=$4; |
| 26 | |
| 27 | hmmscan=$builddir/src/hmmscan; if test ! -x $hmmscan; then echo "FAIL: $hmmscan not executable"; exit 1; fi |
| 28 | hmmsearch=$builddir/src/hmmsearch; if test ! -x $hmmsearch; then echo "FAIL: $hmmsearch not executable"; exit 1; fi |
| 29 | phmmer=$builddir/src/phmmer; if test ! -x $phmmer; then echo "FAIL: $phmmer not executable"; exit 1; fi |
| 30 | jackhmmer=$builddir/src/jackhmmer; if test ! -x $jackhmmer; then echo "FAIL: $jackhmmer not executable"; exit 1; fi |
| 31 | if test ! -r $hmmfile; then echo "FAIL: $hmmfile not readable"; exit 1; fi |
| 32 | |
| 33 | fafile=$tmppfx.fa |
| 34 | |
| 35 | cat > $fafile <<EOF |
| 36 | >foo |
| 37 | >bar |
| 38 | YYYYY |
| 39 | EOF |
| 40 | |
| 41 | $hmmscan $hmmfile $fafile > /dev/null 2>&1; if test $? -ne 0; then echo "FAIL: crash"; exit 1; fi |
| 42 | $hmmsearch $hmmfile $fafile > /dev/null 2>&1; if test $? -ne 0; then echo "FAIL: crash"; exit 1; fi |
| 43 | $phmmer $fafile $fafile > /dev/null 2>&1; if test $? -ne 0; then echo "FAIL: crash"; exit 1; fi |
| 44 | $jackhmmer $fafile $fafile > /dev/null 2>&1; if test $? -ne 0; then echo "FAIL: crash"; exit 1; fi |
| 45 | |
| 46 | echo "ok" |
| 47 | |
| 48 | rm $fafile |
| 49 | exit 0 |
| 50 |