Skip to content

Commit

Permalink
add new example files
Browse files Browse the repository at this point in the history
  • Loading branch information
Woosub-Kim committed Aug 24, 2023
1 parent b1abd2a commit e8c7f3c
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 21 deletions.
Binary file added example/1tim.pdb.gz
Binary file not shown.
Binary file added example/8tim.pdb.gz
Binary file not shown.
4 changes: 3 additions & 1 deletion src/commons/LocalParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ LocalParameters::LocalParameters() :

//rewrite param vals.
// PARAM_FORMAT_OUTPUT.description = "Choose comma separated list of output columns from: query,target,evalue,gapopen,pident,fident,nident,qstart,qend,qlen\ntstart,tend,tlen,alnlen,raw,bits,cigar,qseq,tseq,qheader,theader,qaln,taln,mismatch,qcov,tcov\nqset,qsetid,tset,tsetid,taxid,taxname,taxlineage,\nlddt,lddtfull,qca,tca,t,u,qtmscore,ttmscore,alntmscore,rmsd,prob\n";
PARAM_FORMAT_OUTPUT.description = "Choose comma separated list of output columns from: query,target,evalue,gapopen,pident,fident,nident,qstart,qend,qlen\ntstart,tend,tlen,alnlen,raw,bits,cigar,qseq,tseq,qheader,theader,qaln,taln,mismatch,qcov,tcov\nqset,qsetid,tset,tsetid,taxid,taxname,taxlineage,\nlddt,lddtfull,qca,tca,t,u,qtmscore,ttmscore,alntmscore,rmsd,prob\nqcomplextmscore,tcomplextmscore,assignid\n";
PARAM_FORMAT_OUTPUT.description = "Choose comma separated list of output columns from: query,target,evalue,gapopen,pident,fident,nident,qstart,qend,qlen\ntstart,tend,tlen,alnlen,raw,bits,cigar,qseq,tseq,qheader,theader,qaln,taln,mismatch,qcov,tcov\nqset,qsetid,tset,tsetid,taxid,taxname,taxlineage,\nlddt,lddtfull,qca,tca,t,u,qtmscore,ttmscore,alntmscore,rmsd,prob\nqcomplextmscore,tcomplextmscore,assignid\n"; //"complext,complexu"
}


Expand Down Expand Up @@ -263,6 +263,8 @@ std::vector<int> LocalParameters::getOutputFormat(int formatMode, const std::str
else if (outformatSplit[i].compare("qcomplextmscore")==0){code=LocalParameters::OUTFMT_Q_COMPLEX_TMSCORE; }
else if (outformatSplit[i].compare("tcomplextmscore")==0){code=LocalParameters::OUTFMT_T_COMPLEX_TMSCORE;}
else if (outformatSplit[i].compare("assignid")==0){code=LocalParameters::OUTFMT_ASSIGN_ID;}
// else if (outformatSplit[i].compare("complext")==0){code=LocalParameters::OUTFMT_COMPLEX_T;}
// else if (outformatSplit[i].compare("complexu")==0){code=LocalParameters::OUTFMT_COMPLEX_U;}
else {
Debug(Debug::ERROR) << "Format code " << outformatSplit[i] << " does not exist.";
EXIT(EXIT_FAILURE);
Expand Down
2 changes: 2 additions & 0 deletions src/commons/LocalParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class LocalParameters : public Parameters {
static const int OUTFMT_Q_COMPLEX_TMSCORE = 53;
static const int OUTFMT_T_COMPLEX_TMSCORE = 54;
static const int OUTFMT_ASSIGN_ID = 55;
// static const int OUTFMT_COMPLEX_T = 56;
// static const int OUTFMT_COMPLEX_U = 57;

static const int COORD_STORE_MODE_CA_FLOAT = 1;
static const int COORD_STORE_MODE_CA_DIFF = 2;
Expand Down
2 changes: 1 addition & 1 deletion src/strucclustutils/createcomplexreport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ int createcomplexreport(int argc, const char **argv, const Command &command) {
if (currIdx == complexAlignmentKeys.size()) {
complexAlignmentKeys.emplace_back(key);
complexAlignments.emplace_back(
ComplexAlignment(queryId,targetId,retComplex.qTmScore,retComplex.tTmScore,retComplex.t,retComplex.u)
ComplexAlignment(queryId,targetId,retComplex.qTmScore,retComplex.tTmScore,retComplex.tString, retComplex.uString)
);
} else {
complexAlignments[currIdx].qChainVector.emplace_back(queryId);
Expand Down
14 changes: 7 additions & 7 deletions src/strucclustutils/createcomplexreport.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ static bool compareComplexResult(const ComplexResult &first, const ComplexResult
struct ComplexDataHandler {
ComplexDataHandler(): assId(UINT_MAX), qTmScore(0.0f), tTmScore(0.0f) {}
ComplexDataHandler(bool isValid): assId(UINT_MAX), qTmScore(0.0f), tTmScore(0.0f), isValid(isValid) {}
ComplexDataHandler(unsigned int assId, double qTmScore, double tTmScore, std::string t, std::string u, bool isValid)
: assId(assId), qTmScore(qTmScore), tTmScore(tTmScore), t(t), u(u), isValid(isValid) {}
ComplexDataHandler(unsigned int assId, double qTmScore, double tTmScore, std::string tString, std::string uString, bool isValid)
: assId(assId), qTmScore(qTmScore), tTmScore(tTmScore), tString(tString), uString(uString), isValid(isValid) {}
unsigned int assId;
double qTmScore;
double tTmScore;
std::string t;
std::string u;
std::string tString;
std::string uString;
bool isValid;
};

Expand Down Expand Up @@ -99,11 +99,11 @@ static ComplexDataHandler parseScoreComplexResult(const char *data, Matcher::res
size_t alnLength = Matcher::computeAlnLength(adjustQstart, qEndPos, adjustDBstart, dbEndPos);
double qTmScore = std::stod(entry[11]);
double tTmScore = std::stod(entry[12]);
std::string t = std::string(entry[13], entry[14] - entry[13]-1);
std::string u = std::string(entry[14], entry[15] - entry[14]-1);
std::string tString = std::string(entry[13], entry[14] - entry[13]-1);
std::string uString = std::string(entry[14], entry[15] - entry[14]-1);
unsigned int assId = Util::fast_atoi<unsigned int>(entry[15]);
res = Matcher::result_t(dbKey, score, qCov, dbCov, seqId, eval, alnLength, qStartPos, qEndPos, qLen, dbStartPos, dbEndPos, dbLen, -1, -1, -1, -1, backtrace);
return ComplexDataHandler(assId, qTmScore, tTmScore, t, u, true);
return ComplexDataHandler(assId, qTmScore, tTmScore, tString, uString, true);
}

#endif //FOLDSEEK_CREATECOMPLEXREPORT_H
30 changes: 18 additions & 12 deletions src/strucclustutils/structureconvertalis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ int structureconvertalis(int argc, const char **argv, const Command &command) {
bool needTaxonomyMapping = false;
bool needTMaligner = false;
bool needLDDT = false;
bool isScoreComplexDB = false;
std::vector<int> outcodes = LocalParameters::getOutputFormat(format, par.outfmt, needSequenceDB, needBacktrace, needFullHeaders,
needLookup, needSource, needTaxonomyMapping, needTaxonomy, needCA, needTMaligner, needLDDT);

Expand Down Expand Up @@ -433,11 +432,8 @@ int structureconvertalis(int argc, const char **argv, const Command &command) {
}

Debug::Progress progress(alnDbr.getSize());
// std::vector<ComplexResult> complexResVec;
// unsigned int prevAssId;
std::vector<std::string> qChains;
std::vector<std::string> tChains;
// std::pair<double, double> complexTMScores;
#pragma omp parallel num_threads(localThreads)
{
unsigned int thread_idx = 0;
Expand Down Expand Up @@ -552,8 +548,7 @@ int structureconvertalis(int argc, const char **argv, const Command &command) {
const char *entry[255];
Util::getWordsOfLine(data, entry, 255);
ComplexDataHandler retComplex = parseScoreComplexResult(data, res);
isScoreComplexDB = retComplex.isValid;
if (isScoreComplexDB == false) {
if (!retComplex.isValid) {
res = Matcher::parseAlignmentRecord(data, true);
}
data = Util::skipLine(data);
Expand Down Expand Up @@ -878,29 +873,40 @@ int structureconvertalis(int argc, const char **argv, const Command &command) {
result.append(SSTR(CalcProbTP::calculate(res.score)));
break;
case LocalParameters::OUTFMT_Q_COMPLEX_TMSCORE:
if (!isScoreComplexDB) {
// TODO
if (!retComplex.isValid) {
Debug(Debug::ERROR) << "The column qcomplextmscore is only for scorecomplex result.\n";
EXIT(EXIT_FAILURE);
}
result.append(SSTR(retComplex.qTmScore));
break;
case LocalParameters::OUTFMT_T_COMPLEX_TMSCORE:
if (!isScoreComplexDB) {
// TODO
if (!retComplex.isValid) {
Debug(Debug::ERROR) << "The column tcomplextmscore is only for scorecomplex result.\n";
EXIT(EXIT_FAILURE);
}
result.append(SSTR(retComplex.tTmScore));
break;
case LocalParameters::OUTFMT_ASSIGN_ID:
if (!isScoreComplexDB) {
// TODO
if (!retComplex.isValid) {
Debug(Debug::ERROR) << "The column assignid is only for scorecomplex result.\n";
EXIT(EXIT_FAILURE);
}
result.append(SSTR(retComplex.assId));
break;
// case LocalParameters::OUTFMT_COMPLEX_T:
// if (!retComplex.isValid) {
// Debug(Debug::ERROR) << "The column complext is only for scorecomplex result.\n";
// EXIT(EXIT_FAILURE);
// }
// result.append(retComplex.tString);
// break;
// case LocalParameters::OUTFMT_COMPLEX_U:
// if (!retComplex.isValid) {
// Debug(Debug::ERROR) << "The column complexu is only for scorecomplex result.\n";
// EXIT(EXIT_FAILURE);
// }
// result.append(retComplex.uString);
// break;
}
if (i < outcodes.size() - 1) {
result.push_back('\t');
Expand Down

0 comments on commit e8c7f3c

Please sign in to comment.