Skip to content

Commit

Permalink
disable wrapped scoring when target sequence is shorter
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnSeidel committed Jul 26, 2023
1 parent f5f780a commit 8459b6b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
9 changes: 7 additions & 2 deletions src/alignment/BandedNucleotideAligner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,15 @@ s_align BandedNucleotideAligner::align(Sequence * targetSeqObj,
int queryLen = querySeqObj->L;
int origQueryLen = queryLen;
if (wrappedScoring) {
alignment = DistanceCalculator::computeUngappedWrappedAlignment(
if (querySeqObj->L >= targetSeqObj->L * 2)
alignment = DistanceCalculator::computeUngappedWrappedAlignment(
queryCharSeqAlign, querySeqObj->L, targetSeqObj->getSeqData(), targetSeqObj->L,
diagonal, fastMatrix.matrix, Parameters::RESCORE_MODE_ALIGNMENT);
origQueryLen = queryLen/2;
else
alignment = DistanceCalculator::computeUngappedAlignment(
queryCharSeqAlign, querySeqObj->L / 2, targetSeqObj->getSeqData(), targetSeqObj->L,
diagonal, fastMatrix.matrix, Parameters::RESCORE_MODE_ALIGNMENT);
origQueryLen = queryLen / 2;
}
else {
alignment = DistanceCalculator::computeUngappedAlignment(
Expand Down
20 changes: 14 additions & 6 deletions src/alignment/rescorediagonal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,23 @@ int doRescorediagonal(Parameters &par,
}
DistanceCalculator::LocalAlignment alignment;
if (par.wrappedScoring) {
/*
if (dbLen > origQueryLen) {
Debug(Debug::WARNING) << "WARNING: target sequence " << targetId
<< " is skipped, no valid wrapped scoring possible\n";
continue;
}

alignment = DistanceCalculator::computeUngappedWrappedAlignment(
Debug(Debug::WARNING) << "WARNING: target sequence " << targetId
<< " is skipped, no valid wrapped scoring possible\n";
continue;
}
*/
if (dbLen <= origQueryLen) {
alignment = DistanceCalculator::computeUngappedWrappedAlignment(
querySeqToAlign, queryLen, targetSeq, targetLength,
results[entryIdx].diagonal, fastMatrix.matrix, par.rescoreMode);
}
else{
alignment = DistanceCalculator::computeUngappedAlignment(
querySeqToAlign, origQueryLen, targetSeq, targetLength,
results[entryIdx].diagonal, fastMatrix.matrix, par.rescoreMode);
}
}
else {
alignment = DistanceCalculator::computeUngappedAlignment(
Expand Down

0 comments on commit 8459b6b

Please sign in to comment.