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

#include <alignment_scorer.hpp>

Inheritance diagram for vg::QualAdjAlignmentScorer:
vg::MatrixAlignmentScorer vg::EditAlignmentScorer vg::AlignmentScorer

Public Member Functions

 QualAdjAlignmentScorer (const int8_t *score_matrix_4x4=default_score_matrix, int8_t gap_open=default_gap_open, int8_t gap_extension=default_gap_extension, int8_t full_length_bonus=default_full_length_bonus, double gc_content=default_gc_content)
 
 ~QualAdjAlignmentScorer () override
 
int32_t score_exact_match (const Alignment &aln, size_t read_offset, size_t length) const override
 
int32_t score_exact_match (const std::string &sequence, const std::string &base_quality) const override
 
int32_t score_exact_match (std::string::const_iterator seq_begin, std::string::const_iterator seq_end, std::string::const_iterator base_qual_begin) const override
 
int32_t score_mismatch (std::string::const_iterator seq_begin, std::string::const_iterator seq_end, std::string::const_iterator base_qual_begin) const override
 
int32_t score_full_length_bonus (bool left_side, std::string::const_iterator seq_begin, std::string::const_iterator seq_end, std::string::const_iterator base_qual_begin) const override
 
int32_t score_full_length_bonus (bool left_side, const Alignment &alignment) const override
 
int32_t score_partial_alignment (const Alignment &alignment, const HandleGraph &graph, const path_t &path, std::string::const_iterator seq_begin, bool no_read_end_scoring=false) const override
 
- Public Member Functions inherited from vg::MatrixAlignmentScorer
 MatrixAlignmentScorer (const int8_t *score_matrix_4x4=default_score_matrix, int8_t gap_open=default_gap_open, int8_t gap_extension=default_gap_extension, int8_t full_length_bonus=default_full_length_bonus, double gc_content=default_gc_content)
 
 ~MatrixAlignmentScorer () override
 
 MatrixAlignmentScorer (const MatrixAlignmentScorer &)=delete
 
MatrixAlignmentScoreroperator= (const MatrixAlignmentScorer &)=delete
 
double get_log_base () const override
 Retrieve the log base value that was computed at construction. More...
 
int32_t score_exact_match (const std::string &sequence) const
 Score an exact match of unspecified sequence and the given length. More...
 
int32_t score_exact_match (std::string::const_iterator seq_begin, std::string::const_iterator seq_end) const
 
int32_t score_mismatch (size_t length) const
 
- Public Member Functions inherited from vg::EditAlignmentScorer
 EditAlignmentScorer (int8_t match=default_match, int8_t mismatch=default_mismatch, int8_t gap_open=default_gap_open, int8_t gap_extension=default_gap_extension, int8_t full_length_bonus=default_full_length_bonus)
 
int32_t score_alignment (const Alignment &aln) const override
 Score an alignment as a contiguous alignment, including full-length bonuses. More...
 
virtual int32_t score_gap (size_t gap_length) const
 Returns the score of an insert or deletion of the given length. More...
 
virtual int32_t score_discontiguous_alignment (const Alignment &aln, const std::function< size_t(pos_t, pos_t, size_t)> &estimate_distance, bool allow_left_bonus=true, bool allow_right_bonus=true) const
 
virtual int32_t score_contiguous_alignment (const Alignment &aln, bool allow_left_bonus=true, bool allow_right_bonus=true) const
 Score the given alignment assuming there are no gaps between Mappings. More...
 
virtual int32_t remove_bonuses (const Alignment &aln, bool pinned=false, bool pin_left=false) const
 
size_t longest_detectable_gap (const Alignment &alignment, const std::string::const_iterator &read_pos) const
 The longest gap detectable from a read position without soft-clipping. More...
 
size_t longest_detectable_gap (size_t read_length, size_t read_pos) const
 The longest gap detectable from a read position without soft-clipping, for a generic read. More...
 
size_t longest_detectable_gap (const Alignment &alignment) const
 The longest gap detectable from any read position without soft-clipping. More...
 
size_t longest_detectable_gap (size_t read_length) const
 The longest gap detectable from any read position without soft-clipping, for a generic read. More...
 
- Public Member Functions inherited from vg::AlignmentScorer
virtual ~AlignmentScorer ()=default
 

Protected Member Functions

int8_t * qual_adjusted_matrix (const int8_t *score_matrix_4x4, double gc_content, double log_base, uint32_t max_qual) const
 
int8_t * qual_adjusted_bonuses (int8_t base_full_length_bonus, double log_base, uint32_t max_qual) const
 

Protected Attributes

int8_t * qual_adj_full_length_bonuses = nullptr
 Per-quality full-length bonus table. Owned by this class. More...
 
- Protected Attributes inherited from vg::MatrixAlignmentScorer
double log_base
 We remember our computed log base. More...
 

Additional Inherited Members

- Public Attributes inherited from vg::MatrixAlignmentScorer
int8_t * score_matrix
 
int8_t * nt_table
 Char->int nt translation. Owned by this class. More...
 
- Public Attributes inherited from vg::EditAlignmentScorer
int8_t match
 
int8_t mismatch
 
int8_t gap_open
 
int8_t gap_extension
 
int8_t full_length_bonus
 
- Static Protected Member Functions inherited from vg::AlignmentScorer
static double recover_log_base (const double matrix[16], double gc_content, double tol=1e-12)
 

Detailed Description

AlignmentScorer that scores alignments using quality-adjusted scoring.

Handles adjusting a 4x4 input scoring matrix for base quality.

Constructor & Destructor Documentation

◆ QualAdjAlignmentScorer()

vg::QualAdjAlignmentScorer::QualAdjAlignmentScorer ( const int8_t *  score_matrix_4x4 = default_score_matrix,
int8_t  gap_open = default_gap_open,
int8_t  gap_extension = default_gap_extension,
int8_t  full_length_bonus = default_full_length_bonus,
double  gc_content = default_gc_content 
)

◆ ~QualAdjAlignmentScorer()

vg::QualAdjAlignmentScorer::~QualAdjAlignmentScorer ( )
override

Member Function Documentation

◆ qual_adjusted_bonuses()

int8_t * vg::QualAdjAlignmentScorer::qual_adjusted_bonuses ( int8_t  base_full_length_bonus,
double  log_base,
uint32_t  max_qual 
) const
protected

◆ qual_adjusted_matrix()

int8_t * vg::QualAdjAlignmentScorer::qual_adjusted_matrix ( const int8_t *  score_matrix_4x4,
double  gc_content,
double  log_base,
uint32_t  max_qual 
) const
protected

◆ score_exact_match() [1/3]

int32_t vg::QualAdjAlignmentScorer::score_exact_match ( const Alignment aln,
size_t  read_offset,
size_t  length 
) const
overridevirtual

Compute the score of an exact match in the given alignment, from the given offset, of the given length.

Reimplemented from vg::MatrixAlignmentScorer.

◆ score_exact_match() [2/3]

int32_t vg::QualAdjAlignmentScorer::score_exact_match ( const std::string &  sequence,
const std::string &  base_quality 
) const
overridevirtual

Compute the score of an exact match of the given sequence with the given qualities. Qualities may be ignored by some implementations.

Reimplemented from vg::MatrixAlignmentScorer.

◆ score_exact_match() [3/3]

int32_t vg::QualAdjAlignmentScorer::score_exact_match ( std::string::const_iterator  seq_begin,
std::string::const_iterator  seq_end,
std::string::const_iterator  base_qual_begin 
) const
overridevirtual

Compute the score of an exact match of the given range of sequence with the given qualities. Qualities may be ignored by some implementations.

Reimplemented from vg::MatrixAlignmentScorer.

◆ score_full_length_bonus() [1/2]

int32_t vg::QualAdjAlignmentScorer::score_full_length_bonus ( bool  left_side,
const Alignment alignment 
) const
overridevirtual

Compute the score bonus that would be achieved by a full-length alignment of the given end of the given read. Does not check whether that end actually has a full-lenght alignment.

Reimplemented from vg::MatrixAlignmentScorer.

◆ score_full_length_bonus() [2/2]

int32_t vg::QualAdjAlignmentScorer::score_full_length_bonus ( bool  left_side,
std::string::const_iterator  seq_begin,
std::string::const_iterator  seq_end,
std::string::const_iterator  base_qual_begin 
) const
overridevirtual

Compute the score bonus that would be achieved by a full-length alignment of the given end of the given read.

Reimplemented from vg::MatrixAlignmentScorer.

◆ score_mismatch()

int32_t vg::QualAdjAlignmentScorer::score_mismatch ( std::string::const_iterator  seq_begin,
std::string::const_iterator  seq_end,
std::string::const_iterator  base_qual_begin 
) const
overridevirtual

Compute the score of a mismatch of the given range of sequence with the given qualities. Qualities may be ignored by some implementations. Note that the return value is SIGNED, and almost certainly NEGATIVE, because mismatches are bad.

Reimplemented from vg::MatrixAlignmentScorer.

◆ score_partial_alignment()

int32_t vg::QualAdjAlignmentScorer::score_partial_alignment ( const Alignment alignment,
const HandleGraph graph,
const path_t path,
std::string::const_iterator  seq_begin,
bool  no_read_end_scoring = false 
) const
overridevirtual

Compute the score of a path against the given range of subsequence with the given qualities. The Alignment is just to find the sequence begin and end to compare to seq_begin. seq_begin is the first read base involved in the provided path to be scored.

Reimplemented from vg::MatrixAlignmentScorer.

Member Data Documentation

◆ qual_adj_full_length_bonuses

int8_t* vg::QualAdjAlignmentScorer::qual_adj_full_length_bonuses = nullptr
protected

Per-quality full-length bonus table. Owned by this class.


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