Skip to content

Commit

Permalink
Improve logging of chains we might or might not align
Browse files Browse the repository at this point in the history
  • Loading branch information
adamnovak committed Jan 29, 2025
1 parent 44ed3f0 commit 8bb09d2
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

1 comment on commit 8bb09d2

@adamnovak
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vg CI tests complete for branch better-chain-logging. View the full report here.

16 tests passed, 0 tests failed and 0 tests skipped in 17598 seconds

Please sign in to comment.