vg
tools for working with variation graphs
|
#include <gbwt_extender.hpp>
Public Types | |
enum | Edit { match, mismatch, insertion, deletion } |
Public Member Functions | |
operator bool () const | |
Is this an actual alignment or a failure? More... | |
bool | empty () const |
bool | unlocalized_insertion () const |
Returns true if the alignment is an insertion without a location. More... | |
int64_t | final_offset (const gbwtgraph::GBWTGraph &graph) const |
void | flip (const gbwtgraph::GBWTGraph &graph, const std::string &sequence) |
Transforms the alignment to the other strand. More... | |
void | append (Edit edit, uint32_t length) |
void | join (const WFAAlignment &second) |
Path | to_path (const HandleGraph &graph, const std::string &sequence) const |
Convert the WFAAlignment into a Path. More... | |
std::ostream & | print (const HandleGraph &graph, std::ostream &out) const |
Prints some debug information about the alignment. More... | |
std::ostream & | print (std::ostream &out) const |
Prints some debug information about the alignment. More... | |
void | check_lengths (const HandleGraph &graph) const |
Static Public Member Functions | |
static WFAAlignment | from_extension (const GaplessExtension &extension) |
static WFAAlignment | make_unlocalized_insertion (size_t sequence_offset, size_t length, int score) |
static WFAAlignment | make_empty () |
Generate an empty WFAAlignment. More... | |
Public Attributes | |
std::vector< handle_t > | path |
Sequence of oriented nodes. More... | |
std::vector< std::pair< Edit, uint32_t > > | edits |
Sequence of edit operations and their lengths. More... | |
uint32_t | node_offset = 0 |
uint32_t | seq_offset = 0 |
Starting offset in the sequence. More... | |
uint32_t | length = 0 |
Length of the alignment in the sequence. More... | |
int32_t | score = 0 |
Alignment score. More... | |
bool | ok = false |
Is this an actual alignment or a failure? More... | |
An alignment found by WFAAligner, consisting of a sequence of nodes, a sequence of edits, and a starting offset in the initial node. The alignment score is computed using the match / mismatch / gap open / gap extend parameters in the Aligner object given to the WFAAligner. Full-length bonuses are not used.
Note: The aligner merges consecutive edit operations of the same type. Hence an edit may span multiple nodes.
This struct is an aggregate and can be aggregate-initialized with a brace-enclosed initializer list.
void vg::WFAAlignment::append | ( | Edit | edit, |
uint32_t | length | ||
) |
Appends an edit operation, merging it with the latest edit if possible. Ignores empty edits.
void vg::WFAAlignment::check_lengths | ( | const HandleGraph & | graph | ) | const |
Make sure the stored lengths, paths, and edits are accurate and consistent with each other.
|
inline |
Returns true if the alignment does not cover anything in the sequence and the graph.
int64_t vg::WFAAlignment::final_offset | ( | const gbwtgraph::GBWTGraph & | graph | ) | const |
Computes the node offset after the alignment in the final node. Will be negative if the alignment's final node(s) are not actually used by edits.
void vg::WFAAlignment::flip | ( | const gbwtgraph::GBWTGraph & | graph, |
const std::string & | sequence | ||
) |
Transforms the alignment to the other strand.
|
static |
Generate a WFAAlignment from a GaplessExtension. This can't be a constructor because then WFAAlignment wouldn't be able to be aggregate-initialized.
void vg::WFAAlignment::join | ( | const WFAAlignment & | second | ) |
Concatenate another WFAAlignment onto this one, assuming they abut in the read and the graph. Either may be empty, or an unlocalized insertion.
|
static |
Generate an empty WFAAlignment.
|
static |
Generate a WFAAlignment that is an unlocalized insertion of the given length. Can also be used to represent a softclip. Length may not be 0.
|
inline |
Is this an actual alignment or a failure?
std::ostream & vg::WFAAlignment::print | ( | const HandleGraph & | graph, |
std::ostream & | out | ||
) | const |
Prints some debug information about the alignment.
std::ostream & vg::WFAAlignment::print | ( | std::ostream & | out | ) | const |
Prints some debug information about the alignment.
Path vg::WFAAlignment::to_path | ( | const HandleGraph & | graph, |
const std::string & | sequence | ||
) | const |
Convert the WFAAlignment into a Path.
bool vg::WFAAlignment::unlocalized_insertion | ( | ) | const |
Returns true if the alignment is an insertion without a location.
std::vector<std::pair<Edit, uint32_t> > vg::WFAAlignment::edits |
Sequence of edit operations and their lengths.
uint32_t vg::WFAAlignment::length = 0 |
Length of the alignment in the sequence.
uint32_t vg::WFAAlignment::node_offset = 0 |
Starting offset in the initial node. If there is no initial node, the value stored is undefined.
bool vg::WFAAlignment::ok = false |
Is this an actual alignment or a failure?
std::vector<handle_t> vg::WFAAlignment::path |
Sequence of oriented nodes.
int32_t vg::WFAAlignment::score = 0 |
Alignment score.
uint32_t vg::WFAAlignment::seq_offset = 0 |
Starting offset in the sequence.