Skip to content

Commit

Permalink
Fix appenddbtoindex check for existence by replacing grep with awk call
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Sep 9, 2023
1 parent e5339e1 commit ef4e960
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/structureindex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ fi
|| fail "createindex died"

if [ -n "$INCLUDE_CA" ]; then
if ! grep -q "^${INDEX_DB_CA_KEY_DB1}\t" "${DB}.idx.index"; then
if [ -z "$(awk -v key="${INDEX_DB_CA_KEY_DB1}" '$1 == key;' "${DB}.idx.index")" ]; then
# shellcheck disable=SC2086
"$MMSEQS" appenddbtoindex "${DB}_ca" "${DB}.idx" --id-list ${INDEX_DB_CA_KEY_DB1} ${VERBOSITY_PAR} \
|| fail "appenddbtoindex died"
fi
if [ -f "${DB}_seq_ca.dbtype" ] && [ "$IS_CLUDDB" = "1" ]; then
if ! grep -q "^${INDEX_DB_CA_KEY_DB2}\t" "${DB}.idx.index"; then
if [ -z "$(awk -v key="${INDEX_DB_CA_KEY_DB2}" '$1 == key;' "${DB}.idx.index")" ]; then
# shellcheck disable=SC2086
"$MMSEQS" appenddbtoindex "${DB}_seq_ca" "${DB}.idx" --id-list ${INDEX_DB_CA_KEY_DB2} ${VERBOSITY_PAR} \
|| fail "appenddbtoindex died"
Expand Down

0 comments on commit ef4e960

Please sign in to comment.