From d4a4a7d0c6bef72a8d2160e1b60427e80a7095ad Mon Sep 17 00:00:00 2001 From: Woosub-Kim Date: Tue, 22 Aug 2023 16:19:59 +0900 Subject: [PATCH] bug fixed --- lib/tmalign/TMalign.cpp | 1 - src/commons/LocalParameters.cpp | 3 +- src/commons/LocalParameters.h | 2 - src/strucclustutils/scorecomplex.cpp | 9 ++--- src/strucclustutils/structureconvertalis.cpp | 40 -------------------- src/workflow/EasyComplexSearch.cpp | 31 +++++---------- 6 files changed, 14 insertions(+), 72 deletions(-) diff --git a/lib/tmalign/TMalign.cpp b/lib/tmalign/TMalign.cpp index fdfa4b0e..78d0a497 100644 --- a/lib/tmalign/TMalign.cpp +++ b/lib/tmalign/TMalign.cpp @@ -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 diff --git a/src/commons/LocalParameters.cpp b/src/commons/LocalParameters.cpp index 287d359d..fadac4d9 100644 --- a/src/commons/LocalParameters.cpp +++ b/src/commons/LocalParameters.cpp @@ -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; diff --git a/src/commons/LocalParameters.h b/src/commons/LocalParameters.h index dccdaf4f..e57cc87e 100644 --- a/src/commons/LocalParameters.h +++ b/src/commons/LocalParameters.h @@ -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; @@ -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 strucclust; std::vector tmalign; std::vector structurealign; diff --git a/src/strucclustutils/scorecomplex.cpp b/src/strucclustutils/scorecomplex.cpp index a343601f..180cfff8 100644 --- a/src/strucclustutils/scorecomplex.cpp +++ b/src/strucclustutils/scorecomplex.cpp @@ -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; } @@ -776,13 +776,12 @@ int scorecomplex(int argc, const char **argv, const Command &command) { std::vector 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( diff --git a/src/strucclustutils/structureconvertalis.cpp b/src/strucclustutils/structureconvertalis.cpp index 9b8abc9e..eb290ade 100644 --- a/src/strucclustutils/structureconvertalis.cpp +++ b/src/strucclustutils/structureconvertalis.cpp @@ -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(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); diff --git a/src/workflow/EasyComplexSearch.cpp b/src/workflow/EasyComplexSearch.cpp index 9cb1f298..5970ca1b 100644 --- a/src/workflow/EasyComplexSearch.cpp +++ b/src/workflow/EasyComplexSearch.cpp @@ -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); @@ -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; @@ -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();