vg
tools for working with variation graphs
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
vg::GSSWAligner Class Referenceabstract

#include <aligner.hpp>

Inheritance diagram for vg::GSSWAligner:
vg::BaseAligner vg::Aligner vg::QualAdjAligner

Public Member Functions

 GSSWAligner (GSSWAligner &&)=default
 
GSSWAligneroperator= (GSSWAligner &&)=default
 
 GSSWAligner (const GSSWAligner &)=delete
 
GSSWAligneroperator= (const GSSWAligner &)=delete
 
virtual void align_pinned (Alignment &alignment, const HandleGraph &g, bool pin_left, bool xdrop=false, uint16_t xdrop_max_gap_length=default_xdrop_max_gap_length) const =0
 
virtual void align_pinned_multi (Alignment &alignment, vector< Alignment > &alt_alignments, const HandleGraph &g, bool pin_left, int32_t max_alt_alns) const =0
 
virtual void align_global_banded (Alignment &alignment, const HandleGraph &g, int32_t band_padding=0, bool permissive_banding=true, uint64_t max_cells=std::numeric_limits< uint64_t >::max()) const =0
 
virtual void align_global_banded_multi (Alignment &alignment, vector< Alignment > &alt_alignments, const HandleGraph &g, int32_t max_alt_alns, int32_t band_padding=0, bool permissive_banding=true, uint64_t max_cells=std::numeric_limits< uint64_t >::max()) const =0
 
virtual void align_xdrop (Alignment &alignment, const HandleGraph &g, const vector< MaximalExactMatch > &mems, bool reverse_complemented, uint16_t max_gap_length=default_xdrop_max_gap_length) const =0
 xdrop aligner More...
 
virtual void align_xdrop (Alignment &alignment, const HandleGraph &g, const vector< handle_t > &order, const vector< MaximalExactMatch > &mems, bool reverse_complemented, uint16_t max_gap_length=default_xdrop_max_gap_length) const =0
 
- Public Member Functions inherited from vg::BaseAligner
virtual void align (Alignment &alignment, const HandleGraph &g, bool traceback_aln) const =0
 

Public Attributes

std::unique_ptr< MatrixAlignmentScorerscorer
 
std::unique_ptr< MappingQualityCalculatormapq_calc
 

Protected Member Functions

 GSSWAligner (std::unique_ptr< MatrixAlignmentScorer > owned_scorer)
 
 ~GSSWAligner ()
 
gssw_graph * create_gssw_graph (const HandleGraph &g) const
 
unordered_set< id_tidentify_pinning_points (const HandleGraph &graph) const
 
void unreverse_graph_mapping (gssw_graph_mapping *gm) const
 
void unreverse_graph (gssw_graph *graph) const
 
void gssw_mapping_to_alignment (gssw_graph *graph, gssw_graph_mapping *gm, Alignment &alignment, bool pinned, bool pin_left) const
 
string graph_cigar (gssw_graph_mapping *gm) const
 

Protected Attributes

DeletionAligner deletion_aligner
 

Detailed Description

The basic GSSW-based core aligner implementation, which can then be quality-adjusted or not. Owns its scorer and MAPQ calculator; all scoring and MAPQ work goes through those, not through the aligner.

You aren't meant to instantiate this directly; you should have an Aligner or a QualAdjAligner as the concrete class instead.

Constructor & Destructor Documentation

◆ GSSWAligner() [1/3]

vg::GSSWAligner::GSSWAligner ( std::unique_ptr< MatrixAlignmentScorer owned_scorer)
protected

Build a GSSWAligner around a MatrixAlignmentScorer.

This is the protected constructor meant to be called by subclasses.

◆ ~GSSWAligner()

vg::GSSWAligner::~GSSWAligner ( )
protecteddefault

◆ GSSWAligner() [2/3]

vg::GSSWAligner::GSSWAligner ( GSSWAligner &&  )
default

◆ GSSWAligner() [3/3]

vg::GSSWAligner::GSSWAligner ( const GSSWAligner )
delete

Member Function Documentation

◆ align_global_banded()

virtual void vg::GSSWAligner::align_global_banded ( Alignment alignment,
const HandleGraph g,
int32_t  band_padding = 0,
bool  permissive_banding = true,
uint64_t  max_cells = std::numeric_limits< uint64_t >::max() 
) const
pure virtual

Store optimal global alignment against a graph within a specified band in the Alignment object. Permissive banding auto detects the width of band needed so that paths can travel through every node in the graph.

Throws BandMatricesTooBigException if the max_cells limit on DP matric size is hit.

Implemented in vg::QualAdjAligner, and vg::Aligner.

◆ align_global_banded_multi()

virtual void vg::GSSWAligner::align_global_banded_multi ( Alignment alignment,
vector< Alignment > &  alt_alignments,
const HandleGraph g,
int32_t  max_alt_alns,
int32_t  band_padding = 0,
bool  permissive_banding = true,
uint64_t  max_cells = std::numeric_limits< uint64_t >::max() 
) const
pure virtual

Store top scoring global alignments in the vector in descending score order up to a maximum number of alternate alignments (including the optimal alignment). If there are fewer than the maximum number of alignments in the return value, then the vector contains all possible alignments. The optimal alignment will be stored in both the vector and the original alignment object.

When multiple alignments have the same score, they are ordered deterministically but arbitrarily.

Throws BandMatricesTooBigException if the max_cells limit on DP matric size is hit.

Implemented in vg::QualAdjAligner, and vg::Aligner.

◆ align_pinned()

virtual void vg::GSSWAligner::align_pinned ( Alignment alignment,
const HandleGraph g,
bool  pin_left,
bool  xdrop = false,
uint16_t  xdrop_max_gap_length = default_xdrop_max_gap_length 
) const
pure virtual

store optimal alignment against a graph in the Alignment object with one end of the sequence guaranteed to align to a source/sink node. if xdrop is selected, use the xdrop heuristic, which does not guarantee an optimal alignment.

pinning left means that that the alignment starts with the first base of the read sequence and the first base of a source node sequence, pinning right means that the alignment starts with the final base of the read sequence and the final base of a sink node sequence

Gives the full length bonus only on the non-pinned end of the alignment.

Implemented in vg::QualAdjAligner, and vg::Aligner.

◆ align_pinned_multi()

virtual void vg::GSSWAligner::align_pinned_multi ( Alignment alignment,
vector< Alignment > &  alt_alignments,
const HandleGraph g,
bool  pin_left,
int32_t  max_alt_alns 
) const
pure virtual

store the top scoring pinned alignments in the vector in descending score order up to a maximum number of alignments (including the optimal one). if there are fewer than the maximum number in the return value, then it includes all alignments with a positive score. the optimal alignment will be stored in both the vector and in the main alignment object

Implemented in vg::QualAdjAligner, and vg::Aligner.

◆ align_xdrop() [1/2]

virtual void vg::GSSWAligner::align_xdrop ( Alignment alignment,
const HandleGraph g,
const vector< handle_t > &  order,
const vector< MaximalExactMatch > &  mems,
bool  reverse_complemented,
uint16_t  max_gap_length = default_xdrop_max_gap_length 
) const
pure virtual

xdrop aligner, but with a precomputed topological order on the graph, which need not include all of the graph's handles and which may contain both orientations of a handle

Implemented in vg::QualAdjAligner, and vg::Aligner.

◆ align_xdrop() [2/2]

virtual void vg::GSSWAligner::align_xdrop ( Alignment alignment,
const HandleGraph g,
const vector< MaximalExactMatch > &  mems,
bool  reverse_complemented,
uint16_t  max_gap_length = default_xdrop_max_gap_length 
) const
pure virtual

xdrop aligner

Implemented in vg::QualAdjAligner, and vg::Aligner.

◆ create_gssw_graph()

gssw_graph * vg::GSSWAligner::create_gssw_graph ( const HandleGraph g) const
protected

◆ graph_cigar()

string vg::GSSWAligner::graph_cigar ( gssw_graph_mapping *  gm) const
protected

◆ gssw_mapping_to_alignment()

void vg::GSSWAligner::gssw_mapping_to_alignment ( gssw_graph *  graph,
gssw_graph_mapping *  gm,
Alignment alignment,
bool  pinned,
bool  pin_left 
) const
protected

◆ identify_pinning_points()

unordered_set< vg::id_t > vg::GSSWAligner::identify_pinning_points ( const HandleGraph graph) const
protected

◆ operator=() [1/2]

GSSWAligner& vg::GSSWAligner::operator= ( const GSSWAligner )
delete

◆ operator=() [2/2]

GSSWAligner& vg::GSSWAligner::operator= ( GSSWAligner &&  )
default

◆ unreverse_graph()

void vg::GSSWAligner::unreverse_graph ( gssw_graph *  graph) const
protected

◆ unreverse_graph_mapping()

void vg::GSSWAligner::unreverse_graph_mapping ( gssw_graph_mapping *  gm) const
protected

Member Data Documentation

◆ deletion_aligner

DeletionAligner vg::GSSWAligner::deletion_aligner
protected

Widget for producing alignments that we know in advance will be complete deletions.

◆ mapq_calc

std::unique_ptr<MappingQualityCalculator> vg::GSSWAligner::mapq_calc

Mapping quality calculator for computing mapping qualities under the scoring scheme we use. Not used internally, but exposed so that aligner clients have easy access to a MAPQ calculator for free and don't need to build their own.

◆ scorer

std::unique_ptr<MatrixAlignmentScorer> vg::GSSWAligner::scorer

Alignment scorer that represents the scoring scheme used for computing alignments.


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