vg
tools for working with variation graphs
|
#include <banded_global_aligner.hpp>
Classes | |
class | Deflection |
Public Member Functions | |
AltTracebackStack (const HandleGraph &graph, int64_t max_multi_alns, int32_t empty_score, unordered_set< BAMatrix * > &source_node_matrices, unordered_set< BAMatrix * > &sink_node_matrices, int8_t gap_open, int8_t gap_extend, IntType min_inf) | |
~AltTracebackStack () | |
void | get_alignment_start (int64_t &node_id, matrix_t &matrix) |
Get the start position of the current alignment and advance deflection pointer to the first deflection. More... | |
bool | has_next () |
Are there any more alternate alignments in the stack? More... | |
void | next_traceback_alignment () |
Advance to the next alternate trac. More... | |
bool | next_is_empty () |
Is the next highest scoring alignment an empty path with no DP matrices? More... | |
void | next_empty_alignment (Alignment &alignment) |
Get the next empty path alignment. More... | |
void | propose_deflection (const IntType score, const int64_t from_node_id, const int64_t row_idx, const int64_t col_idx, const int64_t to_node_id, const matrix_t to_matrix) |
IntType | current_traceback_score () |
Score of the current traceback. More... | |
const list< int64_t > & | current_empty_prefix () |
The prefix of the current traceback that consists of only empty nodes. More... | |
bool | at_next_deflection (int64_t node_id, int64_t row_idx, int64_t col_idx) |
Are these the coordinates of the next deflection? More... | |
BandedGlobalAligner::matrix_t | deflect_to_matrix () |
Get the matrix to deflect to and advance to the next deflection. More... | |
BandedGlobalAligner::matrix_t | deflect_to_matrix (int64_t &to_node_id) |
Get the matrix and the node id to deflect to (for use at a node boundary) More... | |
Private Member Functions | |
void | insert_traceback (const vector< Deflection > &traceback_prefix, const IntType score, const int64_t from_node_id, const int64_t row_idx, const int64_t col_idx, const int64_t to_node_id, const matrix_t to_matrix, const list< int64_t > &empty_node_prefix) |
Internal method for propose_deflection. More... | |
Private Attributes | |
int64_t | max_multi_alns |
Maximum number of alternate alignments to keep track of (including the optimal alignment) More... | |
list< tuple< vector< Deflection >, IntType, list< int64_t > > > | alt_tracebacks |
list< list< int64_t > > | empty_full_paths |
All of the paths through the graph that take only empty nodes. More... | |
int32_t | empty_score |
const HandleGraph & | graph |
list< tuple< vector< Deflection >, IntType, list< int64_t > > >::iterator | curr_traceback |
Pointer to the traceback directions for the alignment we are currently tracing back. More... | |
vector< Deflection >::iterator | curr_deflxn |
Pointer to the next deviation from the optimal traceback we will take. More... | |
Specialized linked list stack that finds and keeps track of the top-scoring non-optimal alignments. Sub-optimal alignments are represented by the locations where their traceback deviates from the optimal traceback, with other steps of the traceback implicitly following the optimal path. New tracebacks can be discovered while performing any of the tracebacks and added to the stack.
vg::BandedGlobalAligner< IntType >::AltTracebackStack::AltTracebackStack | ( | const HandleGraph & | graph, |
int64_t | max_multi_alns, | ||
int32_t | empty_score, | ||
unordered_set< BAMatrix * > & | source_node_matrices, | ||
unordered_set< BAMatrix * > & | sink_node_matrices, | ||
int8_t | gap_open, | ||
int8_t | gap_extend, | ||
IntType | min_inf | ||
) |
vg::BandedGlobalAligner< IntType >::AltTracebackStack::~AltTracebackStack |
|
inline |
Are these the coordinates of the next deflection?
|
inline |
The prefix of the current traceback that consists of only empty nodes.
|
inline |
Score of the current traceback.
|
inline |
Get the matrix to deflect to and advance to the next deflection.
|
inline |
Get the matrix and the node id to deflect to (for use at a node boundary)
|
inline |
Get the start position of the current alignment and advance deflection pointer to the first deflection.
|
inline |
Are there any more alternate alignments in the stack?
|
inlineprivate |
Internal method for propose_deflection.
|
inline |
Get the next empty path alignment.
|
inline |
Is the next highest scoring alignment an empty path with no DP matrices?
|
inline |
Advance to the next alternate trac.
|
inline |
Check if a deflection from the current traceback is better than any alignments currently in the stack and if so insert it in the correct position
|
private |
List of tuples that contain the scores of alternate alignments, the places where their traceback deviates from the optimum (Deflections), and all empty nodes that occur at the suffix of the traceback (if any). Maintains an invariant where stack is sorted in descending score order.
|
private |
Pointer to the next deviation from the optimal traceback we will take.
|
private |
Pointer to the traceback directions for the alignment we are currently tracing back.
|
private |
All of the paths through the graph that take only empty nodes.
|
private |
|
private |
|
private |
Maximum number of alternate alignments to keep track of (including the optimal alignment)