Provides methods for the scoring of alignments. More...
#include <scoring.hh>
Public Types | |
typedef BasePairs__Arc | Arc |
arc | |
Public Member Functions | |
Scoring (const Sequence &seqA, const Sequence &seqB, const RnaData &rna_dataA, const RnaData &rna_dataB, const ArcMatches &arc_matches, const MatchProbs *match_probs, const ScoringParams ¶ms, bool exp_scores=false) | |
construct scoring object | |
void | modify_by_parameter (score_t lambda) |
void | apply_unpaired_penalty () |
score_t | lambda () const |
Get factor lambda for normalized alignment. | |
score_t | basematch (size_type i, size_type j) const |
Score of a match of bases (without structure) | |
pf_score_t | exp_basematch (size_type i, size_type j) const |
Boltzmann weight of score of a base match (without structure) | |
score_t | arcmatch (const ArcMatch &am, bool stacked=false) const |
Score of arc match, support explicit arc match scores. | |
score_t | arcmatch (const BasePairs__Arc &arcA, const BasePairs__Arc &arcB, bool stacked=false) const |
Score of arc match, given two arcs. | |
template<bool gapAorB> | |
score_t | arcDel (const BasePairs__Arc &arc, bool stacked=false) const |
Very basic interface, score of aligning a basepair to gap. | |
pf_score_t | exp_arcmatch (const ArcMatch &am) const |
Boltzmann weight of score of arc match. | |
score_t | arcmatch_stacked (const ArcMatch &am) const |
Score of stacked arc match. | |
template<bool gapInA> | |
score_t | gapX (size_type alignedToGap) const |
score_t | gapA (size_type posA) const |
pf_score_t | exp_gapA (size_type posA) const |
Boltzmann weight of score of deletion. | |
score_t | gapB (size_type posB) const |
pf_score_t | exp_gapB (size_type posB) const |
Boltzmann weight of score of insertion. | |
score_t | exclusion () const |
cost of an exclusion | |
score_t | indel_opening () const |
cost to begin a new indel | |
score_t | loop_indel_score (const score_t score) const |
multiply an score by the ratio of indel_loop/indel | |
score_t | indel_opening_loop () const |
cost to begin a new indel | |
pf_score_t | exp_indel_opening () const |
exp of cost to begin a new indel | |
pf_score_t | exp_indel_opening_loop () const |
exp of cost to begin a new indel in loops | |
double | prob_exp (size_type len) const |
Expected base pair probability. | |
bool | stacking () const |
Query stacking flag. | |
bool | is_stackable_arcA (const Arc &a) const |
Is arc of A stackable. | |
bool | is_stackable_arcB (const Arc &a) const |
Is arc of B stackable. | |
bool | is_stackable_am (const ArcMatch &am) const |
Is arc match stackable. |
Provides methods for the scoring of alignments.
Maintains and provides the scores for the alignment of two specific Rnas. Configurable via class ScoringParams, supports the classic LocARNA-score as well as the LocARNA MEA-Score. for "Classic Score" it supports * match/mismatch cost or RIBOSUM for bases * linear or affine gap cost * arc match scores build of arc probabilitiesmatch_probs and optionally base match contribution or RIBOSUM for the "MEA Score" it supports * base match/mismatch scores derived from base match probabilities * RIBOSUM for base and arc match contribution * arc match score contributions from arc probabilities * weighting of single score contributions
The scoring class supports only characters ACGU, gap -, and N for ribosum scoring. ALL other characters are treated as unknown characters and are basically ignored. In consequence, IUPAC codes are handled badly. Even more important, for ribosum scoring, sequences have to be upper case and Ts should be converted to Us!!!
LocARNA::Scoring::Scoring | ( | const Sequence & | seqA, |
const Sequence & | seqB, | ||
const RnaData & | rna_dataA, | ||
const RnaData & | rna_dataB, | ||
const ArcMatches & | arc_matches, | ||
const MatchProbs * | match_probs, | ||
const ScoringParams & | params, | ||
bool | exp_scores = false |
||
) |
construct scoring object
seqA | first sequence |
seqB | second sequence |
rna_dataA | probability data of first sequence |
rna_dataB | probability data of second sequence |
arc_matches | the (significant) arc matches between the sequences |
match_probs | pointer to base match probabilities (can be 0L for non-mea scores) |
params | a collection of parameters for scoring |
exp_scores | only if true, the results of the exp_* scoring functions are defined, otherwise precomputations can be ommitted. |
subtract the fixed unpaired_penalty from base match and base indel scores it is similar to method Please note that the base match and gap scores of ALL bases including the paired ones will be modified!
score_t LocARNA::Scoring::arcDel | ( | const BasePairs__Arc & | arc, |
bool | stacked = false |
||
) | const |
Very basic interface, score of aligning a basepair to gap.
arc | the base pair |
stacked | whether the base pair is stacked |
score_t LocARNA::Scoring::arcmatch | ( | const ArcMatch & | am, |
bool | stacked = false |
||
) | const |
Score of arc match, support explicit arc match scores.
am | arc match |
stacked | is stacked? (optional parameter) |
score_t LocARNA::Scoring::arcmatch | ( | const BasePairs__Arc & | arcA, |
const BasePairs__Arc & | arcB, | ||
bool | stacked = false |
||
) | const |
Score of arc match, given two arcs.
arcA | base pair in A |
arcB | base pair in B |
stacked | is stacked? (optional parameter) |
score_t LocARNA::Scoring::arcmatch_stacked | ( | const ArcMatch & | am | ) | const [inline] |
Score of stacked arc match.
am | arc match |
score_t LocARNA::Scoring::basematch | ( | size_type | i, |
size_type | j | ||
) | const [inline] |
Score of a match of bases (without structure)
i | position in A |
j | position in B |
pf_score_t LocARNA::Scoring::exp_arcmatch | ( | const ArcMatch & | am | ) | const [inline] |
Boltzmann weight of score of arc match.
am | arc match |
pf_score_t LocARNA::Scoring::exp_basematch | ( | size_type | i, |
size_type | j | ||
) | const [inline] |
Boltzmann weight of score of a base match (without structure)
i | position in A |
j | position in B |
pf_score_t LocARNA::Scoring::exp_gapA | ( | size_type | posA | ) | const [inline] |
Boltzmann weight of score of deletion.
posA | position in A |
pf_score_t LocARNA::Scoring::exp_gapB | ( | size_type | posB | ) | const [inline] |
Boltzmann weight of score of insertion.
posB | position in B |
score_t LocARNA::Scoring::gapA | ( | size_type | posA | ) | const [inline] |
Score of deletion
posA | position in A |
score_t LocARNA::Scoring::gapB | ( | size_type | posB | ) | const [inline] |
Score of insertion
posB | position in B |
score_t LocARNA::Scoring::gapX< false > | ( | size_type | alignedToGap | ) | const [inline] |
Score of deletion
alignedToGap | position in A or B |
gapInA | whether symbol in A (true) or B (false) is aligned to gap |
bool LocARNA::Scoring::is_stackable_am | ( | const ArcMatch & | am | ) | const |
Is arc match stackable.
am | Arc match |
bool LocARNA::Scoring::is_stackable_arcA | ( | const Arc & | a | ) | const |
Is arc of A stackable.
a | Arc |
bool LocARNA::Scoring::is_stackable_arcB | ( | const Arc & | a | ) | const |
Is arc of B stackable.
a | Arc |
score_t LocARNA::Scoring::lambda | ( | ) | const [inline] |
Get factor lambda for normalized alignment.
void LocARNA::Scoring::modify_by_parameter | ( | score_t | lambda | ) |
modify scoring by a parameter lambda. Used in the computational of normalized local alignment by fractional programming in the form of the Dinkelbach algorithm. The modification is destructive. modify_by_parameter(0) results in unmodified scoring. Repeated modifications are valid. The Outcome is *undefined* when the Scoring object is used to obtain exponentiated scores (methods exp_...) as in partition function alignment.
lambda | the parameter |
double LocARNA::Scoring::prob_exp | ( | size_type | len | ) | const |
Expected base pair probability.
len | length of RNA sequence |
bool LocARNA::Scoring::stacking | ( | ) | const [inline] |
Query stacking flag.