Skip to content

Commit

Permalink
Get rid of tries
Browse files Browse the repository at this point in the history
use high_scores.size() instead.
  • Loading branch information
marcelm committed Aug 26, 2023
1 parent 5eac24e commit d6019d3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/aln.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ inline void align_PE(
std::array<Details, 2>& details,
float dropoff,
i_dist_est &isize_est,
int max_tries,
unsigned max_tries,
size_t max_secondary
) {
const auto mu = isize_est.mu;
Expand Down Expand Up @@ -851,11 +851,11 @@ inline void align_PE(

// Turn pairs of high-scoring NAMs into pairs of alignments
std::vector<ScoredAlignmentPair> high_scores;
int tries = 0;
auto max_score = joint_nam_scores[0].score;
for (auto &[score_, n1, n2] : joint_nam_scores) {
float score_dropoff = (float) score_ / max_score;
if (tries >= max_tries || score_dropoff < dropoff) {

if (high_scores.size() >= max_tries || score_dropoff < dropoff) {
break;
}

Expand Down Expand Up @@ -921,8 +921,6 @@ inline void align_PE(

ScoredAlignmentPair aln_pair{combined_score, a1, a2};
high_scores.push_back(aln_pair);

tries++;
}

// Finally, add highest scores of both mates as individually mapped
Expand Down

0 comments on commit d6019d3

Please sign in to comment.