@@ -5,6 +5,33 @@ fail() {
55 exit 1
66}
77
8+ abspath () {
9+ if [ -d " $1 " ]; then
10+ (cd " $1 " ; pwd)
11+ elif [ -f " $1 " ]; then
12+ if [ -z " ${1##*/* } " ]; then
13+ echo " $( cd " ${1%/* } " ; pwd) /${1##*/ } "
14+ else
15+ echo " $( pwd) /$1 "
16+ fi
17+ elif [ -d " $( dirname " $1 " ) " ]; then
18+ echo " $( cd " $( dirname " $1 " ) " ; pwd) /$( basename " $1 " ) "
19+ fi
20+ }
21+
22+ fake_pref () {
23+ QDB=" $1 "
24+ TDB=" $2 "
25+ RES=" $3 "
26+ # create link to data file which contains a list of all targets that should be aligned
27+ ln -s " $( abspath " ${TDB} .index" ) " " ${RES} "
28+ # create new index repeatedly pointing to same entry
29+ INDEX_SIZE=" $( wc -c < " ${TDB} .index" ) "
30+ awk -v size=" $INDEX_SIZE " ' { print $1"\t0\t"size; }' " ${QDB} .index" > " ${RES} .index"
31+ # create dbtype (7)
32+ awk ' BEGIN { printf("%c%c%c%c",7,0,0,0); exit; }' > " ${RES} .dbtype"
33+ }
34+
835notExists () {
936 [ ! -f " $1 " ]
1037}
@@ -27,14 +54,23 @@ ALN_RES_MERGE="$TMP_PATH/aln_0"
2754while [ " $STEP " -lt " $STEPS " ]; do
2855 SENS_PARAM=SENSE_${STEP}
2956 eval SENS=" \$ $SENS_PARAM "
30- # call prefilter module
57+
58+ # 1. Prefilter hits
3159 if notExists " $TMP_PATH /pref_$STEP .dbtype" ; then
32- # shellcheck disable=SC2086
33- $RUNNER " $MMSEQS " prefilter " $INPUT " " $TARGET " " $TMP_PATH /pref_$STEP " $PREFILTER_PAR -s " $SENS " \
34- || fail " Prefilter died"
60+ if [ " $PREFMODE " = " EXHAUSTIVE" ]; then
61+ fake_pref " ${INPUT} " " ${TARGET} " " $TMP_PATH /pref_$STEP "
62+ elif [ " $PREFMODE " = " UNGAPPED" ]; then
63+ # shellcheck disable=SC2086
64+ $RUNNER " $MMSEQS " ungappedprefilter " $INPUT " " $TARGET " " $TMP_PATH /pref_$STEP " $UNGAPPEDPREFILTER_PAR \
65+ || fail " Ungapped prefilter died"
66+ else
67+ # shellcheck disable=SC2086
68+ $RUNNER " $MMSEQS " prefilter " $INPUT " " $TARGET " " $TMP_PATH /pref_$STEP " $PREFILTER_PAR -s " $SENS " \
69+ || fail " Prefilter died"
70+ fi
3571 fi
3672
37- # call alignment module
73+ # 2. alignment module
3874 if [ " $STEPS " -eq 1 ]; then
3975 if notExists " $3 .dbtype" ; then
4076 # shellcheck disable=SC2086
0 commit comments