1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
#!/bin/sh
#set -e -x
usage()
{
echo "Usage: $0 minlength [-q query] file1 [file2 ...]"
}
checkerror()
{
$1
if test $? -ne 0
then
echo "failure: ${1}"
exit 1
fi
}
cleanhashlines()
{
TMPFILE=`mktemp TMP.XXXXXX` || exit 1
sed -e '/^#/d' $1 > ${TMPFILE}
mv ${TMPFILE} $1
}
if test $# -lt 2
then
usage
exit 1
fi
queryfile=""
minlength=$1
if test "$2" = "-q"
then
if test $# -lt 4
then
usage
exit 1
fi
queryfile=$3
shift
shift
fi
shift
filenames=$*
for filename in ${filenames}
do
echo "$0 ${minlength} ${filename}"
checkerror "../bin/gt suffixerator -algbds 3 43 120 -db ${filename} -indexname sfxidx -dna -suf -tis -lcp -pl"
if test "X${queryfile}" = "X"
then
checkerror "../bin/gt repfind -l ${minlength} -ii sfxidx" > result.mp
cleanhashlines result.mp
else
checkerror "../bin/gt repfind -l ${minlength} -q ${queryfile} -ii sfxidx" > result.mp
cleanhashlines result.mp
fi
resultfile="${GTTESTDATA}/repfind-result/`basename ${filename}`.result"
checkerror "cmp -s ${resultfile} result.mp"
done
|