Skip to content

Commit

Permalink
left align better
Browse files Browse the repository at this point in the history
  • Loading branch information
jeizenga committed Aug 6, 2024
1 parent 9dd2997 commit 40f015a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/banded_global_aligner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "banded_global_aligner.hpp"
#include "vg/io/json2pb.h"

#include <array>

//#define debug_banded_aligner_objects
//#define debug_banded_aligner_graph_processing
//#define debug_banded_aligner_fill_matrix
Expand Down Expand Up @@ -223,7 +225,7 @@ BandedGlobalAligner<IntType>::BAMatrix::BAMatrix(Alignment& alignment, handle_t
{
// nothing to do
#ifdef debug_banded_aligner_objects
cerr << "[BAMatrix]: constructor for node " << as_integer(node) << " and band from " << top_diag << " to " << bottom_diag << endl;;
cerr << "[BAMatrix]: constructor for node " << as_integer(node) << " and band from " << top_diag << " to " << bottom_diag << " with left alignment strand " << left_alignment_strand << endl;;
#endif
}

Expand Down Expand Up @@ -811,7 +813,7 @@ void BandedGlobalAligner<IntType>::BAMatrix::traceback(const HandleGraph& graph,
continue;
}

vector<matrix_t> prev_mats{InsertCol, Match, InsertRow};
array<matrix_t, 3> prev_mats{Match, InsertCol, InsertRow};
if (left_alignment_strand) {
std::swap(prev_mats[0], prev_mats[2]);
}
Expand Down Expand Up @@ -1417,7 +1419,7 @@ void BandedGlobalAligner<IntType>::BAMatrix::traceback_over_edge(const HandleGra
#ifdef debug_banded_aligner_traceback
cerr << "[BAMatrix::traceback_over_edge] checking seed rectangular coordinates (" << seed_row << ", " << seed_col << "), with indices calculated from current diagonal " << curr_diag << " (top diag " << top_diag << " + offset " << i << "), seed top diagonal " << seed->top_diag << ", seed seq length " << seed_ncols << " with insert column offset " << (mat == InsertCol) << endl;
#endif
vector<matrix_t> prev_mats{InsertCol, Match, InsertRow};
array<matrix_t, 3> prev_mats{Match, InsertCol, InsertRow};
if (left_alignment_strand) {
std::swap(prev_mats[0], prev_mats[2]);
}
Expand Down Expand Up @@ -2487,7 +2489,7 @@ BandedGlobalAligner<IntType>::AltTracebackStack::AltTracebackStack(const HandleG
}
else {
// let the insert routine figure out which one is the best and which ones to keep in the stack
vector<matrix_t> mats{InsertCol, Match, InsertRow};
array<matrix_t, 3> mats{Match, InsertCol, InsertRow};
if (band_matrix->left_alignment_strand) {
std::swap(mats[0], mats[2]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/multipath_alignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace vg {
return *this;
}

multipath_alignment_t::~multipath_alignment_t() noexcept {
multipath_alignment_t::~multipath_alignment_t() {
while (!_annotation.empty()) {
clear_annotation(_annotation.begin()->first);
}
Expand Down
6 changes: 5 additions & 1 deletion src/surjector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4036,7 +4036,11 @@ using namespace std;

if (prune_suspicious_anchors) {
#ifdef debug_anchored_surject
cerr << "pruning suspicious anchors" << endl;
cerr << "pruning suspicious anchors";
if (!step_ranges.empty()) {
cerr << " on path " << graph->get_path_name(graph->get_path_handle_of_step(step_ranges.front().first));
}
cerr << endl;
#endif
for (int i = 0; i < path_chunks.size(); ++i) {
auto& chunk = path_chunks[i];
Expand Down

1 comment on commit 40f015a

@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 left-align-better. View the full report here.

15 tests passed, 0 tests failed and 0 tests skipped in 13408 seconds

Please sign in to comment.