diff --git a/src/minimizer_mapper.cpp b/src/minimizer_mapper.cpp index 9363ad90f08..ecc1602a32e 100644 --- a/src/minimizer_mapper.cpp +++ b/src/minimizer_mapper.cpp @@ -598,11 +598,25 @@ vector MinimizerMapper::map_from_extensions(Alignment& aln) { if (seeds.size() > 0 && seeds.front().minimizer_cache == MIPayload::NO_CODE){ //If there is no payload - if (!warned_about_minimizer_payload.test_and_set()) { + bool found_minimizer = found_minimizer_payload.test_and_set(); + if (!found_minimizer && + !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; } + + //TODO: C++ 20 will let us use found_minimizer_payload.test(), + //which won't set the value to true. + //For now, check if it was false before getting set to true + //and reset it if necessary + if (!found_minimizer) { + found_minimizer_payload.clear(); + } + } else { + //If we found a payload, make sure we remember it so we don't + //warn about it later + found_minimizer_payload.test_and_set(); } // Cluster the seeds. Get sets of input seed indexes that go together. diff --git a/src/minimizer_mapper.hpp b/src/minimizer_mapper.hpp index a86ca36e5a3..583555c79ab 100644 --- a/src/minimizer_mapper.hpp +++ b/src/minimizer_mapper.hpp @@ -127,6 +127,15 @@ class MinimizerMapper : public AlignerClient { ///Have we complained about minimizer not including distance hints? atomic_flag warned_about_minimizer_payload = ATOMIC_FLAG_INIT; + + //Some minimizer payloads are too big and don't get stored, so + //we might encounter empty ones even though we have the rest. + //Remember if we've seen any payloads so we don't complain about + //an anomalous empty one. This isn't perfect since it might warn + //about empty payloads if the first one is empty, but this is + //unlikely + ///Have we found a minimizer payload yet? + atomic_flag found_minimizer_payload = ATOMIC_FLAG_INIT; ////////////// // Alignment-from-gapless-extension/short read Giraffe specific parameters: