diff --git a/Makefile b/Makefile index 9b9d4178872..9298262ea5e 100644 --- a/Makefile +++ b/Makefile @@ -589,7 +589,10 @@ $(INC_DIR)/sha1.hpp: $(SHA1_DIR)/sha1.hpp $(INC_DIR)/backward.hpp: $(BACKWARD_CPP_DIR)/backward.hpp +cp $(BACKWARD_CPP_DIR)/backward.hpp $(CWD)/$(INC_DIR)/ -$(INC_DIR)/dozeu/dozeu.h: $(DOZEU_DIR)/*.h +$(INC_DIR)/simde/x86/sse4.1.h: $(DOZEU_DIR)/simde/*.h $(DOZEU_DIR)/simde/x86/*.h + +cp -r $(DOZEU_DIR)/simde $(INC_DIR) + +$(INC_DIR)/dozeu/dozeu.h: $(DOZEU_DIR)/*.h $(INC_DIR)/simde/x86/sse4.1.h +mkdir -p $(CWD)/$(INC_DIR)/dozeu && cp $(DOZEU_DIR)/*.h $(CWD)/$(INC_DIR)/dozeu/ $(LIB_DIR)/libebl.a: $(LIB_DIR)/libelf.a diff --git a/deps/dozeu b/deps/dozeu index e084ecd5bbf..39e45db6726 160000 --- a/deps/dozeu +++ b/deps/dozeu @@ -1 +1 @@ -Subproject commit e084ecd5bbfe0af63d757735375227921cbc9bbf +Subproject commit 39e45db6726726909bdfdcc27826a4bc1e6a832c diff --git a/src/dozeu_interface.cpp b/src/dozeu_interface.cpp index ab6422007e5..745e2e558d1 100644 --- a/src/dozeu_interface.cpp +++ b/src/dozeu_interface.cpp @@ -6,7 +6,7 @@ #include #include #include - + #include "dozeu_interface.hpp" #include "algorithms/topological_sort.hpp" @@ -128,7 +128,7 @@ DozeuInterface::graph_pos_s DozeuInterface::calculate_max_position(const Ordered assert(forefronts.at(max_node_index)->mcap != nullptr); // calc max position on the node - uint64_t max_pos = (uint64_t) dz_calc_max_pos(dz, forefronts[max_node_index]); + uint64_t max_pos = (uint64_t) dz_calc_max_pos(forefronts[max_node_index]); // ref-side offset fixup int32_t rpos = (int32_t)(max_pos>>32); @@ -293,14 +293,16 @@ size_t DozeuInterface::do_poa(const OrderedGraph& graph, const dz_query_s* packe // Get max query pos assert(max_idx <= forefronts.size()); assert(forefronts[max_idx] != nullptr); - + +#ifdef DEBUG if (forefronts[max_idx]->mcap != nullptr) { - uint64_t query_max_pos = dz_calc_max_qpos(dz, forefronts[max_idx]); - uint64_t ref_node_max_pos = dz_calc_max_rpos(dz, forefronts[max_idx]); + uint64_t query_max_pos = dz_calc_max_qpos(forefronts[max_idx]); + uint64_t ref_node_max_pos = dz_calc_max_rpos(forefronts[max_idx]); debug("max(%p), score(%d), qpos(%ld), rpos(%ld)", forefronts[max_idx], forefronts[max_idx]->max, query_max_pos, ref_node_max_pos); } +#endif return max_idx; } diff --git a/src/unittest/xdrop_aligner.cpp b/src/unittest/xdrop_aligner.cpp index dffe189564c..5f377629fe6 100644 --- a/src/unittest/xdrop_aligner.cpp +++ b/src/unittest/xdrop_aligner.cpp @@ -658,7 +658,7 @@ TEST_CASE("XdropAligner doesn't crash on a case where it is hard to find a seed" aligner.align_xdrop(aln, graph, vector(), false); } -TEST_CASE("XdropAligner pinned alignment doesn't crash on an example that revealed a bug", +TEST_CASE("XdropAligner pinned alignment doesn't crash when aligning to a long stretch of mismatches", "[xdrop][alignment][mapping][pinned]") { bdsg::HashGraph graph; @@ -695,6 +695,26 @@ TEST_CASE("XdropAligner pinned alignment doesn't crash on an example that reveal aligner.align_pinned(aln, graph, false, true, 10); } + +TEST_CASE("XdropAligner pinned alignment doesn't crash when the optimal alignment column would be x-dropped if not for the full length bonus", + "[xdrop][alignment][mapping][pinned]") { + + bdsg::HashGraph graph; + + handle_t h0 = graph.create_handle("AAGGG"); + + + Alignment aln; + aln.set_sequence("AACGT"); + + TestAligner aligner_source; + aligner_source.set_alignment_scores(1, 4, 6, 1, 9); + const Aligner& aligner = *aligner_source.get_regular_aligner(); + + aligner.align_pinned(aln, graph, true, true, 0); + + REQUIRE(aln.score() == 1 + 1 + 1 - 4 - 4 + 9); +} } }