Skip to content

Commit

Permalink
Merge pull request #4514 from vgteam/better-chain-logging
Browse files Browse the repository at this point in the history
Improve logging of chains we might or might not align
  • Loading branch information
adamnovak authored Jan 31, 2025
2 parents 44ed3f0 + 8bb09d2 commit 5e13d76
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/minimizer_mapper_from_chains.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2216,6 +2216,10 @@ void MinimizerMapper::do_alignment_on_chains(Alignment& aln, const std::vector<S
if (!read_group.empty()) {
aln.set_read_group(read_group);
}

// Compute lower limit on chain score to actually investigate
int chain_min_score = std::min((int) (min_chain_score_per_base * aln.sequence().size()), max_min_chain_score);
// Remember we also have chain_score_threshold, which counts down from best chain score

// We need to be able to discard a chain because its score isn't good enough.
// We have more components to the score filter than process_until_threshold_b supports.
Expand All @@ -2228,17 +2232,14 @@ void MinimizerMapper::do_alignment_on_chains(Alignment& aln, const std::vector<S
if (show_work) {
#pragma omp critical (cerr)
{
cerr << log_name() << "chain " << processed_num << " failed because its score was not good enough (score=" << chain_score_estimates[processed_num] << ")" << endl;
cerr << log_name() << "chain " << processed_num << " failed because its score was not good enough (score=" << chain_score_estimates[processed_num] << ", min=" << chain_min_score << ", threshold " << chain_score_threshold << " off best)" << endl;
if (track_correctness && funnel.was_correct(processed_num)) {
cerr << log_name() << "\tCORRECT!" << endl;
}
}
}
};

// Compute lower limit on chain score to actually investigate
int chain_min_score = std::min((int) (min_chain_score_per_base * aln.sequence().size()), max_min_chain_score);

// Track how many tree chains were used
std::unordered_map<size_t, size_t> chains_per_tree;

Expand All @@ -2265,7 +2266,7 @@ void MinimizerMapper::do_alignment_on_chains(Alignment& aln, const std::vector<S
if (show_work) {
#pragma omp critical (cerr)
{
cerr << log_name() << "Chain " << processed_num << " is good enough (score=" << chain_score_estimates[processed_num] << "/" << chain_min_score << ")" << endl;
cerr << log_name() << "Chain " << processed_num << " is good enough (score=" << chain_score_estimates[processed_num] << ", min=" << chain_min_score << ", threshold " << chain_score_threshold << " off best)" << endl;
if (track_correctness && funnel.was_correct(processed_num)) {
cerr << log_name() << "\tCORRECT!" << endl;
}
Expand Down

0 comments on commit 5e13d76

Please sign in to comment.