From d4407e817fd4024c9305b42be2567a9bd5691298 Mon Sep 17 00:00:00 2001 From: Adam Novak Date: Fri, 7 Feb 2025 14:49:50 -0800 Subject: [PATCH] Fix build --- src/algorithms/chain_items.cpp | 14 ++++++++------ src/minimizer_mapper_from_chains.cpp | 13 +++++++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/algorithms/chain_items.cpp b/src/algorithms/chain_items.cpp index d1fc9400cb..3d55c8e9d8 100644 --- a/src/algorithms/chain_items.cpp +++ b/src/algorithms/chain_items.cpp @@ -197,12 +197,14 @@ transition_iterator zip_tree_transition_iterator(const std::vector& to_chain, - const SnarlDistanceIndex& distance_index, - const HandleGraph& graph, - size_t max_indel_bases, - const transition_iteratee& callback) { - + return [&seeds, &zip_code_tree, max_graph_lookback_bases, max_read_lookback_bases]( + const VectorView& to_chain, + const SnarlDistanceIndex& distance_index, + const HandleGraph& graph, + size_t max_indel_bases, + const transition_iteratee& callback + ) { + // We need a way to map from the seeds that zip tree thinks about to the anchors that we think about. So we need to index the anchors by leading/trailing seed. // TODO: Should we make someone else do the indexing so we can make the Anchor not need to remember the seed? std::unordered_map seed_to_starting; diff --git a/src/minimizer_mapper_from_chains.cpp b/src/minimizer_mapper_from_chains.cpp index 4366e94643..24932b3652 100644 --- a/src/minimizer_mapper_from_chains.cpp +++ b/src/minimizer_mapper_from_chains.cpp @@ -632,7 +632,7 @@ vector MinimizerMapper::map_from_chains(Alignment& aln) { ZipCodeForest zip_code_forest; crash_unless(distance_index); zip_code_forest.fill_in_forest(seeds, minimizers, *distance_index, - max_lookback_bases, aln.sequence().size() * zipcode_tree_scale); + max_graph_lookback_bases, aln.sequence().size() * zipcode_tree_scale); #ifdef debug_print_forest if (show_work) { @@ -3195,6 +3195,8 @@ Alignment MinimizerMapper::find_chain_alignment( // We will measure the graph distance on the link path actually found, for work-showing. // This gets filled from either the WFA alignment we have already, or the BGA alignment we are about to compute. size_t link_graph_path_length; + // We also measure the score for work-showing. + int link_score; if (link_alignment) { // We found a link alignment @@ -3224,7 +3226,9 @@ Alignment MinimizerMapper::find_chain_alignment( link_graph_path_length = path_from_length(link_path); append_path(composed_path, std::move(link_path)); } - composed_score += link_alignment.score; + + link_score = link_alignment.score; + composed_score += link_score; } else { // The sequence to the next thing is too long, or we couldn't reach it doing connect(). // Fall back to another alignment method @@ -3289,13 +3293,14 @@ Alignment MinimizerMapper::find_chain_alignment( Path link_path(link_aln.path()); link_graph_path_length = path_from_length(link_path); append_path(composed_path, std::move(link_path)); - composed_score += link_aln.score(); + link_score = link_aln.score(); + composed_score += link_score; } if (show_work) { #pragma omp critical (cerr) { - cerr << log_name() << "Aligned and added link of " << link_length << " bp read and " << link_graph_path_length << " bp graph via " << link_alignment_source << " with score of " << link_aln.score() << std::endl; + cerr << log_name() << "Aligned and added link of " << link_length << " bp read and " << link_graph_path_length << " bp graph via " << link_alignment_source << " with score of " << link_score << std::endl; } }