File: checkmaxpairs.sh

package info (click to toggle)
genometools 1.6.1%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 50,412 kB
  • sloc: ansic: 271,241; ruby: 30,339; python: 4,880; sh: 3,193; makefile: 1,194; perl: 219; pascal: 159; haskell: 37; sed: 5
file content (63 lines) | stat: -rwxr-xr-x 1,080 bytes parent folder | download | duplicates (9)
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