|
vg
tools for working with variation graphs
|
#include <alignment_scorer.hpp>
Public Member Functions | |
| 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_exact_match (const Alignment &aln, size_t read_offset, size_t length) const =0 |
| virtual int32_t | score_exact_match (const std::string &sequence, const std::string &base_quality) const =0 |
| virtual 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 =0 |
| virtual int32_t | score_mismatch (std::string::const_iterator seq_begin, std::string::const_iterator seq_end, std::string::const_iterator base_qual_begin) const =0 |
| virtual 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 =0 |
| virtual int32_t | score_full_length_bonus (bool left_side, const Alignment &alignment) const =0 |
| virtual 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 =0 |
| 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 |
| virtual double | get_log_base () const =0 |
Public Attributes | |
| int8_t | match |
| int8_t | mismatch |
| int8_t | gap_open |
| int8_t | gap_extension |
| int8_t | full_length_bonus |
Additional Inherited Members | |
Static Protected Member Functions inherited from vg::AlignmentScorer | |
| static double | recover_log_base (const double matrix[16], double gc_content, double tol=1e-12) |
An abstract AlignmentScorer that can score individual edits independently.
| 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 |
||
| ) |
| size_t vg::EditAlignmentScorer::longest_detectable_gap | ( | const Alignment & | alignment | ) | const |
The longest gap detectable from any read position without soft-clipping.
| size_t vg::EditAlignmentScorer::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.
| size_t vg::EditAlignmentScorer::longest_detectable_gap | ( | size_t | read_length | ) | const |
The longest gap detectable from any read position without soft-clipping, for a generic read.
| size_t vg::EditAlignmentScorer::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.
|
virtual |
Without necessarily rescoring the entire alignment, return the score of the given alignment with bonuses removed. Assumes that bonuses are actually included in the score. Needs to know if the alignment was pinned-end or not, and, if so, which end was pinned.
|
overridevirtual |
Score an alignment as a contiguous alignment, including full-length bonuses.
Implements vg::AlignmentScorer.
|
virtual |
Score the given alignment assuming there are no gaps between Mappings.
|
virtual |
Use the score values in the scorer to score the given alignment, scoring gaps caused by jumping between nodes using a custom gap length estimation function (which takes the from position, the to position, and a search limit in bp that happens to be the read length).
May include full length bonus or not. TODO: bool flags are bad..
|
pure virtual |
Compute the score of an exact match in the given alignment, from the given offset, of the given length.
Implemented in vg::QualAdjAlignmentScorer, and vg::MatrixAlignmentScorer.
|
pure virtual |
Compute the score of an exact match of the given sequence with the given qualities. Qualities may be ignored by some implementations.
Implemented in vg::QualAdjAlignmentScorer, and vg::MatrixAlignmentScorer.
|
pure virtual |
Compute the score of an exact match of the given range of sequence with the given qualities. Qualities may be ignored by some implementations.
Implemented in vg::QualAdjAlignmentScorer, and vg::MatrixAlignmentScorer.
|
pure virtual |
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.
Implemented in vg::QualAdjAlignmentScorer, and vg::MatrixAlignmentScorer.
|
pure virtual |
Compute the score bonus that would be achieved by a full-length alignment of the given end of the given read.
Implemented in vg::QualAdjAlignmentScorer, and vg::MatrixAlignmentScorer.
|
virtual |
Returns the score of an insert or deletion of the given length.
|
pure virtual |
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.
Implemented in vg::QualAdjAlignmentScorer, and vg::MatrixAlignmentScorer.
|
pure virtual |
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.
Implemented in vg::QualAdjAlignmentScorer, and vg::MatrixAlignmentScorer.
| int8_t vg::EditAlignmentScorer::full_length_bonus |
| int8_t vg::EditAlignmentScorer::gap_extension |
| int8_t vg::EditAlignmentScorer::gap_open |
| int8_t vg::EditAlignmentScorer::match |
| int8_t vg::EditAlignmentScorer::mismatch |
1.9.1