Skip to content

Commit

Permalink
bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Woosub-Kim committed Aug 22, 2023
1 parent bfe3ca2 commit d4a4a7d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 72 deletions.
1 change: 0 additions & 1 deletion lib/tmalign/TMalign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,6 @@ double standard_TMscore(Coordinates &r1, Coordinates &r2, Coordinates &xtm, Coor
float score_d8, float t[3], float u[3][3], float * mem)
{
D0_MIN = 0.5;
Lnorm = ylen;
if (Lnorm > 21)
d0 = (1.24*pow((Lnorm*1.0 - 15), 1.0 / 3) - 1.8);
else
Expand Down
3 changes: 1 addition & 2 deletions src/commons/LocalParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ LocalParameters::LocalParameters() :
"1: SAM\n2: BLAST-TAB + query/db length\n"
"3: Pretty HTML\n4: BLAST-TAB + column headers\n"
"5: Calpha only PDB super-posed to query\n"
"6: BLAST-TAB + q/db complex tm (only for scorecomplex result)\n"
"BLAST-TAB (0) and BLAST-TAB + column headers (4)"
"support custom output formats (--format-output)\n"
"(5) Superposed PDB files (Calpha only)";

// TODO
PARAM_FORMAT_MODE.regex = "^[0-6]{1}$";
PARAM_FORMAT_MODE.regex = "^[0-5]{1}$";
PARAM_SEARCH_TYPE.category = MMseqsParameter::COMMAND_HIDDEN;
PARAM_TRANSLATION_TABLE.category = MMseqsParameter::COMMAND_HIDDEN;
PARAM_TRANSLATION_TABLE.category = MMseqsParameter::COMMAND_HIDDEN;
Expand Down
2 changes: 0 additions & 2 deletions src/commons/LocalParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class LocalParameters : public Parameters {
static const int OUTFMT_QTMSCORE = 49;
static const int OUTFMT_TTMSCORE = 50;
// for scorecomplex
// static const int DBTYPE_SCORE_COMPRLEX_RES = 21;
static const int OUTFMT_QUERY_COMPLEX = 51;
static const int OUTFMT_TARGET_COMPLEX = 52;
static const int OUTFMT_Q_COMPLEX_TMSCORE = 53;
Expand All @@ -77,7 +76,6 @@ class LocalParameters : public Parameters {

// TODO
static const unsigned int FORMAT_ALIGNMENT_PDB_SUPERPOSED = 5;
static const unsigned int FORMAT_SCORE_COMPLEX_DEFAULT = 6;
std::vector<MMseqsParameter *> strucclust;
std::vector<MMseqsParameter *> tmalign;
std::vector<MMseqsParameter *> structurealign;
Expand Down
9 changes: 4 additions & 5 deletions src/strucclustutils/scorecomplex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ struct ComplexToComplexAln {
void getTmScore(TMaligner &tmAligner) {
std::string backtrace(matches, 'M');
unsigned int normLen = std::min(qResidueLength, dbResidueLength);
tmAligner.initQuery(&qCaXVec[0], &qCaYVec[0], &qCaZVec[0], NULL, normLen);
tmAligner.initQuery(&qCaXVec[0], &qCaYVec[0], &qCaZVec[0], NULL, matches);
TMaligner::TMscoreResult tmResult= tmAligner.computeTMscore(&dbCaXVec[0], &dbCaYVec[0], &dbCaZVec[0],
normLen,0,0, backtrace,normLen);
matches,0,0, backtrace,normLen);
qTmScore = tmResult.tmscore * normLen / qResidueLength;
dbTmScore = tmResult.tmscore * normLen / dbResidueLength;
}
Expand Down Expand Up @@ -776,13 +776,12 @@ int scorecomplex(int argc, const char **argv, const Command &command) {
std::vector<Complex> qComplexes = complexScorer.getQComplexes(qComplexId, qChainKeys);
// for each db complex
for (size_t qComplexIdx = 0; qComplexIdx < qComplexes.size(); qComplexIdx++) {
Complex qComplex = qComplexes[qComplexIdx];
complexScorer.getComplexAlns(qComplex, assignments);
complexScorer.getComplexAlns(qComplexes[qComplexIdx], assignments);
}
SORT_SERIAL(assignments.begin(), assignments.end(), compareComplexToComplexAln);
// for each assignment
for (unsigned int assignmentId=0; assignmentId < assignments.size(); assignmentId++){
ComplexToComplexAln assignment = assignments[assignmentId];
ComplexToComplexAln &assignment = assignments[assignmentId];
// for each output line from this assignment
for (size_t alnIdx=0; alnIdx < assignment.alnResVec.size(); alnIdx++) {
snprintf(
Expand Down
40 changes: 0 additions & 40 deletions src/strucclustutils/structureconvertalis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1049,46 +1049,6 @@ int structureconvertalis(int argc, const char **argv, const Command &command) {
result.append("\" },\n");
break;
}

case LocalParameters::FORMAT_SCORE_COMPLEX_DEFAULT: {
if (!isScoreComplexDB){
// TODO
Debug(Debug::ERROR) << "This mode is only for scorecomplex result.\n";
EXIT(EXIT_FAILURE);
}
unsigned int assId = complexDataHandler.assId;
double qComplexTm = complexDataHandler.qTmScore;
double tComplexTm = complexDataHandler.tTmScore;
int count = snprintf(
buffer,
sizeof(buffer),
"%s\t%s\t%1.3f\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%.2E\t%d\t%d\t%d\t%1.5f\t%1.5f\t%d\n",
queryId.c_str(),
targetId.c_str(),
res.seqId,
alnLen,
missMatchCount,
gapOpenCount,
res.qStartPos + 1,
res.qEndPos + 1,
res.dbStartPos + 1,
res.dbEndPos + 1,
res.eval,
res.score,
res.qLen,
res.dbLen,
qComplexTm,
tComplexTm,
assId
);

if (count < 0 || static_cast<size_t>(count) >= sizeof(buffer)) {
Debug(Debug::WARNING) << "Truncated line in entry" << i << "!\n";
continue;
}
result.append(buffer, count);
break;
}
default:
Debug(Debug::ERROR) << "Not implemented yet";
EXIT(EXIT_FAILURE);
Expand Down
31 changes: 9 additions & 22 deletions src/workflow/EasyComplexSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ int easycomplexsearch(int argc, const char **argv, const Command &command) {
par.PARAM_ZDROP.addCategory(MMseqsParameter::COMMAND_EXPERT);
par.PARAM_DB_OUTPUT.addCategory(MMseqsParameter::COMMAND_EXPERT);
par.PARAM_OVERLAP.addCategory(MMseqsParameter::COMMAND_EXPERT);
par.PARAM_DB_OUTPUT.addCategory(MMseqsParameter::COMMAND_EXPERT);
par.PARAM_RESCORE_MODE.addCategory(MMseqsParameter::COMMAND_EXPERT);
for (size_t i = 0; i < par.createdb.size(); i++){
par.createdb[i]->addCategory(MMseqsParameter::COMMAND_EXPERT);
Expand All @@ -25,7 +24,13 @@ int easycomplexsearch(int argc, const char **argv, const Command &command) {
par.PARAM_THREADS.removeCategory(MMseqsParameter::COMMAND_EXPERT);
par.PARAM_V.removeCategory(MMseqsParameter::COMMAND_EXPERT);

par.parseParameters(argc, argv, command, true, Parameters::PARSE_VARIADIC, 0);
par.parseParameters(argc, argv, command, false, Parameters::PARSE_VARIADIC, 0);
if(par.PARAM_FORMAT_OUTPUT.wasSet == false){
par.outfmt = "query,target,fident,alnlen,mismatch,gapopen,qstart,qend,tstart,tend,evalue,bits,assignid";
}
par.addBacktrace = true;
par.PARAM_ADD_BACKTRACE.wasSet = true;
par.printParameters(command.cmd, argc, argv, par.searchworkflow);

bool needBacktrace = false;
bool needTaxonomy = false;
Expand Down Expand Up @@ -66,26 +71,8 @@ int easycomplexsearch(int argc, const char **argv, const Command &command) {
par.filenames.pop_back();
CommandCaller cmd;
cmd.addVariable("TMP_PATH", tmpDir.c_str());
switch (par.formatAlignmentMode) {
case Parameters::FORMAT_ALIGNMENT_BLAST_TAB: // 0
case Parameters::FORMAT_ALIGNMENT_BLAST_TAB_WITH_HEADERS: // 4
cmd.addVariable("OUTPUT", (par.filenames.back()+".m8").c_str());
break;
case Parameters::FORMAT_ALIGNMENT_BLAST_WITH_LEN: // 2
case LocalParameters::FORMAT_SCORE_COMPLEX_DEFAULT: // 6
cmd.addVariable("OUTPUT", (par.filenames.back()+".csv").c_str());
break;
case Parameters::FORMAT_ALIGNMENT_SAM: // 1
cmd.addVariable("OUTPUT", (par.filenames.back()+".sam").c_str());
break;
case Parameters::FORMAT_ALIGNMENT_HTML: // 3
cmd.addVariable("OUTPUT", (par.filenames.back()+".html").c_str());
break;
case LocalParameters::FORMAT_ALIGNMENT_PDB_SUPERPOSED: // 5
cmd.addVariable("OUTPUT", (par.filenames.back()+"_").c_str());
break;
}
cmd.addVariable("REPORT", (par.filenames.back()+"_report.tsv").c_str());
cmd.addVariable("OUTPUT", par.filenames.back().c_str());
cmd.addVariable("REPORT", (par.filenames.back()+"_report").c_str());
par.filenames.pop_back();
cmd.addVariable("TARGET", par.filenames.back().c_str());
par.filenames.pop_back();
Expand Down

0 comments on commit d4a4a7d

Please sign in to comment.