Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
hmusta committed Sep 7, 2023
1 parent 96a875c commit 2684005
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions metagraph/src/graph/alignment/aligner_chainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,10 @@ void chain_alignments(const IDBGAligner &aligner,
preprocess_range(anchors.begin() + orientation_change, anchors.end());

const auto *labeled_aligner = dynamic_cast<const ILabeledAligner*>(&aligner);
AnnotationBuffer *anno_buffer = nullptr;

if (labeled_aligner) {
anno_buffer = &labeled_aligner->get_annotation_buffer();
std::vector<Anchor> split_anchors;
for (auto &a : anchors) {
if (a.index != std::numeric_limits<uint64_t>::max()) {
Expand Down Expand Up @@ -783,7 +786,11 @@ void chain_alignments(const IDBGAligner &aligner,

#ifndef NDEBUG
auto cur = full_j;
cur.insert_gap_prefix(cur.get_query_view().begin() - full_i.get_query_view().end(), graph.get_k() - 1, config);
cur.insert_gap_prefix(
cur.get_query_view().begin() - full_i.get_query_view().end(),
graph.get_k() - 1,
config
);
assert(cur.get_score() == full_j.get_score() + gap_cost);
#endif

Expand Down Expand Up @@ -821,8 +828,10 @@ void chain_alignments(const IDBGAligner &aligner,

#ifndef NDEBUG
auto cur = full_j;
cur.extend_offset(std::vector<node_index>(graph.get_k() - 1 - cur.get_offset(),
DeBruijnGraph::npos));
cur.extend_offset(
std::vector<node_index>(graph.get_k() - 1 - cur.get_offset(),
DeBruijnGraph::npos)
);
cur.insert_gap_prefix(-seed_size, graph.get_k() - 1, config);
assert(cur.get_score() == full_j.get_score() + node_insert);
#endif
Expand Down Expand Up @@ -869,11 +878,8 @@ void chain_alignments(const IDBGAligner &aligner,
chain_score = score;
DEBUG_LOG("Chain: {}", score);
last_anchor = chain.back().first;
if (labeled_aligner) {
col_idx = labeled_aligner->get_annotation_buffer().cache_column_set(
1, last_anchor->col
);
}
if (labeled_aligner)
col_idx = anno_buffer->cache_column_set(1, last_anchor->col);

return true;
} else {
Expand Down

0 comments on commit 2684005

Please sign in to comment.