Skip to content

Commit

Permalink
Add a warning to giraffe when using minimizers without distance hints
Browse files Browse the repository at this point in the history
  • Loading branch information
xchang1 committed Jun 10, 2023
1 parent bc288e8 commit 8d61ee8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/minimizer_mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,15 @@ vector<Alignment> MinimizerMapper::map_from_extensions(Alignment& aln) {
// Find the seeds and mark the minimizers that were located.
vector<Seed> seeds = this->find_seeds(minimizers, aln, funnel);

if (seeds.size() > 0 && seeds.front().minimizer_cache == MIPayload::NO_CODE){
//If there is no payload
if (!warned_about_minimizer_payload.test_and_set()) {
cerr << "warning[vg::giraffe]: Running giraffe without distance hints in the minimizers." << endl;
cerr << " Mapping will be slow." << endl;
cerr << " To include distance hints, rebuilt the minimizers with vg minimizer -d" << endl;
}
}

// Cluster the seeds. Get sets of input seed indexes that go together.
if (track_provenance) {
funnel.stage("cluster");
Expand Down
3 changes: 3 additions & 0 deletions src/minimizer_mapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ class MinimizerMapper : public AlignerClient {
/// If set, exclude overlapping minimizers
static constexpr bool default_exclude_overlapping_min = false;
bool exclude_overlapping_min = default_exclude_overlapping_min;

///Have we complained about minimizer not including distance hints?
atomic_flag warned_about_minimizer_payload = ATOMIC_FLAG_INIT;

//////////////
// Alignment-from-gapless-extension/short read Giraffe specific parameters:
Expand Down

1 comment on commit 8d61ee8

@adamnovak
Copy link
Member

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 warn-minimizers. View the full report here.

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

Please sign in to comment.