LocARNA-2.0.0
Public Types | Public Member Functions | Protected Member Functions | List of all members
LocARNA::PFScoring< T > Class Template Reference

#include <scoring.hh>

Inheritance diagram for LocARNA::PFScoring< T >:
Inheritance graph
[legend]
Collaboration diagram for LocARNA::PFScoring< T >:
Collaboration graph
[legend]

Public Types

using pf_score_t = T
 
using PFScoreVector = std::vector< pf_score_t >
 Vector of partition functions.
 
using PFScoreMatrix = Matrix< pf_score_t >
 Matrix of partition functions.
 
- Public Types inherited from LocARNA::Scoring
typedef BasePairs__Arc Arc
 arc
 

Public Member Functions

 PFScoring (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)
 construct scoring object More...
 
pf_score_t exp_basematch (size_type i, size_type j) const
 Boltzmann weight of score of a base match (without structure) More...
 
pf_score_t exp_arcmatch (const ArcMatch &am) const
 Boltzmann weight of score of arc match. More...
 
pf_score_t exp_gapA (size_type posA) const
 Boltzmann weight of score of deletion. More...
 
pf_score_t exp_gapB (size_type posB) const
 Boltzmann weight of score of insertion. More...
 
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
 
- Public Member Functions inherited from 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)
 construct scoring object More...
 
void modify_by_parameter (score_t lambda)
 modify scoring by a parameter lambda. More...
 
void apply_unpaired_penalty ()
 
score_t lambda () const
 Get factor lambda for normalized alignment. More...
 
score_t basematch (size_type i, size_type j) const
 Score of a match of bases (without structure) More...
 
score_t arcmatch (const ArcMatch &am, bool stacked=false) const
 Score of arc match, support explicit arc match scores. More...
 
score_t arcmatch (const BasePairs__Arc &arcA, const BasePairs__Arc &arcB, bool stacked=false) const
 Score of arc match, given two arcs. More...
 
const ArcMatchesarc_matches () const
 
template<bool gapAorB>
score_t arcDel (const BasePairs__Arc &arc, bool stacked=false) const
 Very basic interface, score of aligning a basepair to gap. More...
 
score_t arcmatch_stacked (const ArcMatch &am) const
 Score of stacked arc match. More...
 
template<bool gapInA>
score_t gapX (size_type alignedToGap) const
 
score_t gapA (size_type posA) const
 
score_t gapB (size_type posB) const
 
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
 
double prob_exp (size_type len) const
 Expected base pair probability. More...
 
bool stacking () const
 Query stacking flag. More...
 
bool is_stackable_arcA (const Arc &a) const
 Is arc of A stackable. More...
 
bool is_stackable_arcB (const Arc &a) const
 Is arc of B stackable. More...
 
bool is_stackable_am (const ArcMatch &am) const
 Is arc match stackable. More...
 
template<>
score_t gapX (size_type alignedToGap) const
 
template<>
score_t gapX (size_type alignedToGap) const
 

Protected Member Functions

void precompute_exp_gapcost ()
 Precompute the tables for Boltzmann weights of gapcost.
 
void precompute_exp_sigma ()
 Precompute all Boltzmann weights of base similarities. More...
 
pf_score_t boltzmann_weight (score_t s) const
 
- Protected Member Functions inherited from LocARNA::Scoring
void precompute_sequence_identities ()
 
score_t round2score (double d) const
 Round a double to score_t. More...
 
score_t sigma_ (int i, int j) const
 Compute base similarity. More...
 
void precompute_sigma ()
 Precompute all base similarities. More...
 
void precompute_gapcost ()
 Precompute the tables for gapcost.
 
void precompute_weights ()
 Precompute weights/stacked weights for all arcs in A and B.
 
void precompute_weights (const RnaData &rna_data, const BasePairs &bps, double exp_prob, std::vector< score_t > &weights, std::vector< score_t > &stack_weights)
 Helper for precompute_weights (does job for one rna) More...
 
score_t probToWeight (double p, double prob_exp) const
 convert probability to weight for scoring More...
 
double ribosum_arcmatch_prob (const Arc &arcA, const Arc &arcB) const
 
score_t riboX_arcmatch_score (const Arc &arcA, const Arc &arcB) const
 ribofit or ribosum arcmatch score contribution More...
 
void subtract (std::vector< score_t > &v, score_t x) const
 subtract from each element of a score_t vector v a value x
 
void subtract (Matrix< score_t > &m, score_t x) const
 subtract from each element of a score_t Matrix m a value x
 

Additional Inherited Members

- Protected Attributes inherited from LocARNA::Scoring
const ScoringParamsparams
 a collection of parameters for scoring
 
const ArcMatchesarc_matches_
 arc matches
 
const MatchProbsmatch_probs
 base match probabilities
 
const RnaDatarna_dataA
 rna data for RNA A
 
const RnaDatarna_dataB
 rna data for RNA B
 
const SequenceseqA
 sequence A
 
const SequenceseqB
 sequence B
 
score_t lambda_
 
Matrix< score_tsigma_tab
 precomputed table of base match similarities
 
std::vector< score_tgapcost_tabA
 table for gapcost in A
 
std::vector< score_tgapcost_tabB
 table for gapcost in B
 
std::vector< score_tweightsA
 
std::vector< score_tweightsB
 
std::vector< score_tstack_weightsA
 
std::vector< score_tstack_weightsB
 
Matrix< size_t > identity
 sequence identities in percent
 

Detailed Description

template<typename T>
class LocARNA::PFScoring< T >

Scoring for partition function alignment

Parameters
Ttype of the partition functions (like float, double, or long double)

Constructor & Destructor Documentation

◆ PFScoring()

template<typename T >
LocARNA::PFScoring< T >::PFScoring ( 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 
)

construct scoring object

Parameters
seqAfirst sequence
seqBsecond sequence
rna_dataAprobability data of first sequence
rna_dataBprobability data of second sequence
arc_matchesthe (significant) arc matches between the sequences
match_probspointer to base match probabilities (can be nullptr for non-mea scores)
paramsa collection of parameters for scoring

Member Function Documentation

◆ exp_arcmatch()

template<typename T >
pf_score_t LocARNA::PFScoring< T >::exp_arcmatch ( const ArcMatch am) const
inline

Boltzmann weight of score of arc match.

Parameters
amarc match
Returns
Boltzmann weight of score of arc match am

◆ exp_basematch()

template<typename T >
pf_score_t LocARNA::PFScoring< T >::exp_basematch ( size_type  i,
size_type  j 
) const
inline

Boltzmann weight of score of a base match (without structure)

Parameters
iposition in A
jposition in B
Returns
Boltzmann weight of score of base match i~j

◆ exp_gapA()

template<typename T >
pf_score_t LocARNA::PFScoring< T >::exp_gapA ( size_type  posA) const
inline

Boltzmann weight of score of deletion.

Parameters
posAposition in A
Returns
Boltzmann weight of score of deletion of posA after posB

◆ exp_gapB()

template<typename T >
pf_score_t LocARNA::PFScoring< T >::exp_gapB ( size_type  posB) const
inline

Boltzmann weight of score of insertion.

Parameters
posBposition in B
Returns
Boltzmann weight of score of insertion of posB after posA

◆ precompute_exp_sigma()

template<typename T >
void LocARNA::PFScoring< T >::precompute_exp_sigma
protected

Precompute all Boltzmann weights of base similarities.

Precomputed similarities are stored in the exp_sigma table.


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