Skip to content

Commit

Permalink
Fix PPOS code in convertalis
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-steinegger committed Jul 26, 2024
1 parent a146887 commit fb38b7d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/util/convertalignments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,28 +643,31 @@ int convertalignments(int argc, const char **argv, const Command &command) {
float pPositive = 0;
int matchCount = 0;
if (res.backtrace.empty() == false) {
int qPos = 0;
int tPos = 0;
for (size_t pos = 0; pos < res.backtrace.size(); pos++) {
switch (res.backtrace[pos]) {
int qPos = res.qStartPos;
int tPos = res.dbStartPos;
std::string unpackedBt = Matcher::uncompressAlignment(res.backtrace);
for (size_t pos = 0; pos < unpackedBt.size(); pos++) {
switch (unpackedBt[pos]) {
case 'M': {
char qRes = queryProfile ? queryProfData[qPos] : querySeqData[qPos];
char tRes = targetProfile ? targetProfData[tPos] : targetSeqData[tPos];
std::cout << qRes << " " << tRes << std::endl;
pPositive += (subMat->subMatrix[subMat->aa2num[(int)qRes]][subMat->aa2num[(int)tRes]] > 0);
matchCount += 1;
qPos++;
tPos++;
break;
}
case 'D':
qPos++;
tPos++;
break;
case 'I':
tPos++;
qPos++;
break;
}
}
pPositive /= matchCount;
std::cout << res.backtrace << " " << pPositive << " " << matchCount << std::endl;
pPositive /= static_cast<float>(matchCount);
}
result.append(SSTR(pPositive));
break;
Expand Down

0 comments on commit fb38b7d

Please sign in to comment.