ppALIGN API documentation
BoltzmannWeight Class Reference
#include <weights.hpp>
Public Member Functions | |
| BoltzmannWeight (const ScoreMatrix &s, double _scale, double temperature, double gap_open, double gap_extension, AlignmentType t, bool allow_DI=true, bool allow_ID=false) | |
| BoltzmannWeight (const Alphabet &alphabet1, const Alphabet &alphabet2, const std::string &matrix_name, double temperature, double gap_open, double gap_extension, AlignmentType t, bool allow_DI=true, bool allow_ID=false) | |
| virtual | ~BoltzmannWeight () |
| xdouble | Average (const Frequencies &freq1, const Frequencies &freq2) const |
| double | Temperature () const |
| virtual bool | IsBoltzmann () const |
Public Attributes | |
| double | temper |
| double | alpha |
| double | beta |
| xdouble | exp_alpha |
| xdouble | exp_beta |
Detailed Description
Boltzmannweights of the score matrix. Each pair of letters a and b is assigned a weight
where s is a score matrix and T the temperature. The relationship between the log-likelihood ratio and the score is given by
.
is stored in the field Weight::scale.
- BoltzmannWeight::BoltzmannWeight(const ScoreMatrix & s,double,double, double,AlignmentType,bool,bool) Constructor from a integer valued score matrix with scale
. - BoltzmannWeight::BoltzmannWeight(const Alphabet &, const Alphabet &, const std::string &, double,double, double,AlignmentType,bool,bool). Construcotr from a matrix name. The scale
is set accordingly, e.g.
for the blosum matrix. In this case the canonical temperature where finite temperature alignment approximates the pair HMM is 1.
The free score is defined as
and the expected score as
with
. The image below shows how the free score and the expected score variies with temperature. In the limit
both values approach the value of the optimal score.
- Examples:
-
alternative_alignments.cpp, freescore.cpp, and pairprobmap.cpp.
Definition at line 232 of file weights.hpp.
Constructor & Destructor Documentation
| BoltzmannWeight::BoltzmannWeight | ( | const ScoreMatrix & | s, | |
| double | _scale, | |||
| double | temperature, | |||
| double | gap_open, | |||
| double | gap_extension, | |||
| AlignmentType | t, | |||
| bool | allow_DI = true, |
|||
| bool | allow_ID = false | |||
| ) |
Construct the weights from the score matrix and temperature.
Assume that the score matrix is given by the integer values stored in s[a][b]. The weights are given by
. If the scale is not known use the method ScoreMatrix::GetScale(). It is stored in Weight::scale. Gaps are given the weight
and
, where
= gap_open + gap_extension.
= gap_extension. - Parameters:
-
s score matrix (integer valued) scale scale of the matrix temperature temperature gap_open gap open penalty gap_extension gap extension penalty t type of the alignment allow_DI transitions from deletion to insertion possible allow_ID transitions from insertion to deletion possible
| BoltzmannWeight::BoltzmannWeight | ( | const Alphabet & | alphabet1, | |
| const Alphabet & | alphabet2, | |||
| const std::string & | matrix_name, | |||
| double | temperature, | |||
| double | gap_open, | |||
| double | gap_extension, | |||
| AlignmentType | t, | |||
| bool | allow_DI = true, |
|||
| bool | allow_ID = false | |||
| ) |
Construct the weights from the score matrix and temperature. Assume that the name of the score matrix is known and supported by ppalign. The score matrix is scaled by
The scale of the corresponding matrix is stored in Weight::scale. Gaps are given the weight
and
, where
= gap_open + gap_extension.
= gap_extension. - Parameters:
-
alphabet1 alphabet of the first sequence alphabet2 alphabet of the second sequence matrix_name name of the scoring matrix temperature temperature T gap_open gap open penalty gap_extension gap extension penalty t alignment type allow_DI transitions from deletion to insertion possible allow_ID transitions from insertion to deletion possible
| virtual BoltzmannWeight::~BoltzmannWeight | ( | ) | [inline, virtual] |
Destructor.
Definition at line 329 of file weights.hpp.
Member Function Documentation
| xdouble BoltzmannWeight::Average | ( | const Frequencies & | freq1, | |
| const Frequencies & | freq2 | |||
| ) | const |
Average the weights with respect to frequencies freq1 and freq2.
- Parameters:
-
freq1 Frequencies for the first letter freq2 Frequencies for the second letter
- Returns:
where p=freq1 and q=freq2
- Remarks:
- ensure that freq1 and freq2 are normalized
| virtual bool BoltzmannWeight::IsBoltzmann | ( | ) | const [inline, virtual] |
| double BoltzmannWeight::Temperature | ( | ) | const [inline] |
Member Data Documentation
| double BoltzmannWeight::alpha |
gap open penality
Definition at line 243 of file weights.hpp.
| double BoltzmannWeight::beta |
gap extension penality
Definition at line 245 of file weights.hpp.
Weights for gap open
. see different constructor for the definition of the scale
.
- BoltzmannWeight::BoltzmannWeight(const ScoreMatrix & s,double,double, double,AlignmentType,bool,bool) and
- BoltzmannWeight::BoltzmannWeight(const Alphabet &, const Alphabet &, const std::string &, double,double, double,AlignmentType,bool,bool)
Definition at line 255 of file weights.hpp.
Weights for gap extension
. See different constructor for the definition of the scale
- BoltzmannWeight::BoltzmannWeight(const ScoreMatrix & s,double,double, double,AlignmentType,bool,bool) and
- BoltzmannWeight::BoltzmannWeight(const Alphabet &, const Alphabet &, const std::string &, double,double, double,AlignmentType,bool,bool)
Definition at line 265 of file weights.hpp.
| double BoltzmannWeight::temper |
temperature value.
Definition at line 241 of file weights.hpp.
The documentation for this class was generated from the following file:
- src/weights.hpp