vg
tools for working with variation graphs
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
vg::WFAAlignment Struct Reference

#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_tpath
 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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ Edit

Enumerator
match 
mismatch 
insertion 
deletion 

Member Function Documentation

◆ append()

void vg::WFAAlignment::append ( Edit  edit,
uint32_t  length 
)

Appends an edit operation, merging it with the latest edit if possible. Ignores empty edits.

◆ check_lengths()

void vg::WFAAlignment::check_lengths ( const HandleGraph graph) const

Make sure the stored lengths, paths, and edits are accurate and consistent with each other.

◆ empty()

bool vg::WFAAlignment::empty ( ) const
inline

Returns true if the alignment does not cover anything in the sequence and the graph.

◆ final_offset()

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.

◆ flip()

void vg::WFAAlignment::flip ( const gbwtgraph::GBWTGraph &  graph,
const std::string &  sequence 
)

Transforms the alignment to the other strand.

◆ from_extension()

WFAAlignment vg::WFAAlignment::from_extension ( const GaplessExtension extension)
static

Generate a WFAAlignment from a GaplessExtension. This can't be a constructor because then WFAAlignment wouldn't be able to be aggregate-initialized.

◆ join()

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.

◆ make_empty()

WFAAlignment vg::WFAAlignment::make_empty ( )
static

Generate an empty WFAAlignment.

◆ make_unlocalized_insertion()

WFAAlignment vg::WFAAlignment::make_unlocalized_insertion ( size_t  sequence_offset,
size_t  length,
int  score 
)
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.

◆ operator bool()

vg::WFAAlignment::operator bool ( ) const
inline

Is this an actual alignment or a failure?

◆ print() [1/2]

std::ostream & vg::WFAAlignment::print ( const HandleGraph graph,
std::ostream &  out 
) const

Prints some debug information about the alignment.

◆ print() [2/2]

std::ostream & vg::WFAAlignment::print ( std::ostream &  out) const

Prints some debug information about the alignment.

◆ to_path()

Path vg::WFAAlignment::to_path ( const HandleGraph graph,
const std::string &  sequence 
) const

Convert the WFAAlignment into a Path.

◆ unlocalized_insertion()

bool vg::WFAAlignment::unlocalized_insertion ( ) const

Returns true if the alignment is an insertion without a location.

Member Data Documentation

◆ edits

std::vector<std::pair<Edit, uint32_t> > vg::WFAAlignment::edits

Sequence of edit operations and their lengths.

◆ length

uint32_t vg::WFAAlignment::length = 0

Length of the alignment in the sequence.

◆ node_offset

uint32_t vg::WFAAlignment::node_offset = 0

Starting offset in the initial node. If there is no initial node, the value stored is undefined.

◆ ok

bool vg::WFAAlignment::ok = false

Is this an actual alignment or a failure?

◆ path

std::vector<handle_t> vg::WFAAlignment::path

Sequence of oriented nodes.

◆ score

int32_t vg::WFAAlignment::score = 0

Alignment score.

◆ seq_offset

uint32_t vg::WFAAlignment::seq_offset = 0

Starting offset in the sequence.


The documentation for this struct was generated from the following files: