Skip to content

Commit

Permalink
Rework result2structprofile to work correctly with precomputed index
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Jan 14, 2025
1 parent 4c1d036 commit 4c2092a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 32 deletions.
22 changes: 13 additions & 9 deletions data/result2structprofile.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion data/structureiterativesearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 22 additions & 22 deletions src/strucclustutils/result2structprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c2092a

Please sign in to comment.