diff --git a/data/result2structprofile.sh b/data/result2structprofile.sh index 37668d39..41883a07 100644 --- a/data/result2structprofile.sh +++ b/data/result2structprofile.sh @@ -1,29 +1,33 @@ #!/bin/sh -e -if [ -e "${IN1}.dbtype" ]; then +INPUT="$1" +RESULT="$3" +OUT="$4" + +if [ -e "${INPUT}.dbtype" ]; then # shellcheck disable=SC2086 - "$MMSEQS" base:result2profile "${IN1}" "${IN2}" "${RESULT}" "${OUT}" ${PROFILE_PAR} \ + $RUNNER "$MMSEQS" base:result2profile "${INPUT}" "${TARGET}${INDEXEXT}" "${RESULT}" "${OUT}" ${PROFILE_PAR} \ || fail "result2profile died" fi -if [ -e "${IN1}_ss.dbtype" ]; then +if [ -e "${INPUT}_ss.dbtype" ]; then # shellcheck disable=SC2086 - "$MMSEQS" base:result2profile "${IN1}_ss" "${IN2}_ss" "${RESULT}" "${OUT}_ss" ${PROFILE_SS_PAR} \ + $RUNNER "$MMSEQS" base:result2profile "${INPUT}_ss" "${TARGET}_ss${INDEXEXT}" "${RESULT}" "${OUT}_ss" ${PROFILE_SS_PAR} \ || fail "result2profile died" fi -if [ -e "${IN1}_ca.dbtype" ]; then +if [ -e "${INPUT}_ca.dbtype" ]; then # shellcheck disable=SC2086 - "$MMSEQS" lndb "${IN1}_ca" "${OUT}_ca" ${VERBOSITY} \ + "$MMSEQS" lndb "${INPUT}_ca" "${OUT}_ca" ${VERBOSITY} \ || fail "Create lndb died" fi -if [ -e "${IN1}_h.dbtype" ]; then +if [ -e "${INPUT}_h.dbtype" ]; then # shellcheck disable=SC2086 - "$MMSEQS" lndb "${IN1}_h" "${OUT}_h" ${VERBOSITY} \ + "$MMSEQS" lndb "${INPUT}_h" "${OUT}_h" ${VERBOSITY} \ || fail "Create lndb died" fi -if [ -e "${OUT}.sh" ]; then +if [ -e "${INPUT}.sh" ]; then rm -f -- "${OUT}.sh" fi diff --git a/data/structureiterativesearch.sh b/data/structureiterativesearch.sh index a6ba1d66..b2e81931 100644 --- a/data/structureiterativesearch.sh +++ b/data/structureiterativesearch.sh @@ -92,7 +92,7 @@ while [ "$STEP" -lt "$NUM_IT" ]; do if [ $STEP -ne $((NUM_IT - 1)) ]; then if notExists "$TMP_PATH/profile_${STEP}.dbtype"; then # shellcheck disable=SC2086 - $RUNNER "$MMSEQS" result2profile "${QUERYDB}" "${TARGET_ALIGNMENT}${INDEXEXT}" "$TMP_PATH/aln_${STEP}" "$TMP_PATH/profile_${STEP}" ${PROFILE_PAR} \ + "$MMSEQS" result2profile "${QUERYDB}" "${TARGET_ALIGNMENT}${INDEXEXT}" "$TMP_PATH/aln_${STEP}" "$TMP_PATH/profile_${STEP}" ${PROFILE_PAR} \ || fail "Create profile died" fi fi diff --git a/src/strucclustutils/result2structprofile.cpp b/src/strucclustutils/result2structprofile.cpp index 78a90742..b68c419f 100644 --- a/src/strucclustutils/result2structprofile.cpp +++ b/src/strucclustutils/result2structprofile.cpp @@ -4,41 +4,41 @@ #include "CommandCaller.h" #include "Util.h" #include "LocalParameters.h" +#include "PrefilteringIndexReader.h" #include "result2structprofile.sh.h" int result2structprofile(int argc, const char **argv, const Command &command) { LocalParameters &par = LocalParameters::getLocalInstance(); par.parseParameters(argc, argv, command, true, Parameters::PARSE_VARIADIC, 0); - std::string program = par.db4 + ".sh"; - - FileUtil::writeFile(program, result2structprofile_sh, result2structprofile_sh_len); CommandCaller cmd; - cmd.addVariable("OUT", par.filenames.back().c_str()); - par.filenames.pop_back(); - cmd.addVariable("RESULT", par.filenames.back().c_str()); - par.filenames.pop_back(); - cmd.addVariable("IN2", par.filenames.back().c_str()); - par.filenames.pop_back(); - cmd.addVariable("IN1", par.filenames.back().c_str()); - par.filenames.pop_back(); - + std::string db2NoIndexName = PrefilteringIndexReader::dbPathWithoutIndex(par.db2); + if (db2NoIndexName != par.db2) { + cmd.addVariable("TARGET", db2NoIndexName.c_str()); + cmd.addVariable("INDEXEXT", ".idx"); + } else { + cmd.addVariable("TARGET", par.db2.c_str()); + cmd.addVariable("INDEXEXT", ""); + } par.scoringMatrixFile = "blosum62.out"; par.seedScoringMatrixFile = "blosum62.out"; cmd.addVariable("PROFILE_PAR", par.createParameterString(par.result2structprofile).c_str()); - par.pca = 1.4; - par.pcb = 1.5; - par.scoringMatrixFile = "3di.out"; - par.seedScoringMatrixFile = "3di.out"; - par.maskProfile = 0; - par.compBiasCorrection = 0; - if(par.PARAM_E_PROFILE.wasSet == false){ - par.evalProfile = 0.1; - par.evalThr = 0.1; - } + par.pca = 1.4; + par.pcb = 1.5; + par.scoringMatrixFile = "3di.out"; + par.seedScoringMatrixFile = "3di.out"; + par.maskProfile = 0; + par.compBiasCorrection = 0; + if (par.PARAM_E_PROFILE.wasSet == false) { + par.evalProfile = 0.1; + par.evalThr = 0.1; + } cmd.addVariable("PROFILE_SS_PAR", par.createParameterString(par.result2structprofile).c_str()); cmd.addVariable("VERBOSITY", par.createParameterString(par.onlyverbosity).c_str()); + + std::string program = par.db4 + ".sh"; + FileUtil::writeFile(program, result2structprofile_sh, result2structprofile_sh_len); cmd.execProgram(FileUtil::getRealPathFromSymLink(program).c_str(), par.filenames); // Should never get here