Skip to content

Commit

Permalink
don't use new for pair lddtcalculator
Browse files Browse the repository at this point in the history
  • Loading branch information
gamcil committed Sep 13, 2024
1 parent 76198c1 commit 8a90d6b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/strucclustutils/msa2lddt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,22 +160,22 @@ double calculate_lddt_pair(
// full alignment length, not just aligned region
// also required for averaging LDDT at end
size_t alnLength = result.alnLength + result.qStartPos + result.dbStartPos + (result.qLen - result.qEndPos) + (result.dbLen - result.dbEndPos);
LDDTCalculator *lddtcalculator = new LDDTCalculator(alnLength, alnLength);
LDDTCalculator lddtcalculator(alnLength, alnLength);

Coordinate16 qcoords;
size_t q_id = seqDbrCA->getId(q_key);
char *qcadata = seqDbrCA->getData(q_id, thread_idx);
size_t qCaLength = seqDbrCA->getEntryLen(q_id);
float *queryCaData = qcoords.read(qcadata, result.qLen, qCaLength);
lddtcalculator->initQuery(result.qLen, queryCaData, &queryCaData[result.qLen], &queryCaData[result.qLen * 2]);
lddtcalculator.initQuery(result.qLen, queryCaData, &queryCaData[result.qLen], &queryCaData[result.qLen * 2]);

Coordinate16 tcoords;
size_t t_id = seqDbrCA->getId(t_key);
char *tcadata = seqDbrCA->getData(t_id, thread_idx);
size_t tCaLength = seqDbrCA->getEntryLen(t_id);
float *targetCaData = tcoords.read(tcadata, result.dbLen, tCaLength);

LDDTCalculator::LDDTScoreResult lddtres = lddtcalculator->computeLDDTScore(
LDDTCalculator::LDDTScoreResult lddtres = lddtcalculator.computeLDDTScore(
result.dbLen,
result.qStartPos,
result.dbStartPos,
Expand All @@ -184,7 +184,6 @@ double calculate_lddt_pair(
&targetCaData[result.dbLen],
&targetCaData[result.dbLen * 2]
);
delete lddtcalculator;

double sum = 0.0;
for (int i = 0; i < lddtres.scoreLength; i++) {
Expand Down

0 comments on commit 8a90d6b

Please sign in to comment.