ppALIGN API documentation

Frequencies Class Reference

#include <frequencies.hpp>

List of all members.

Public Member Functions

 Frequencies (const Alphabet &a)
void Normalize (bool setupUIPAC=false)
void Reset ()
double & operator[] (unsigned long i)
const double & operator[] (unsigned long i) const
double & operator[] (unsigned int i)
const double & operator[] (unsigned int i) const
double & operator[] (int i)
const double & operator[] (int i) const
double & operator[] (char ch)
const double & operator[] (char ch) const
void Count (const Sequence &seq)
Access to probabilities.

Don't forget to Normalize() the frequencies before using these functions.



double GetNormWeight (size_t i) const
double GetLogWeight (size_t i) const
double GetCumWeight (size_t i) const
Randomization.

Don't forget to Normalize() the frequencies before using these functions



int RandomLetter (DRand48 &rng) const
void RandomSequence (DRand48 &rng, const Sequence::iterator &begin, const Sequence::iterator &end) const
void RandomSequence (DRand48 &rng, Sequence &seq, size_t length) const
void RandomSequence (DRand48 &rng, Sequence &seq) const

Detailed Description

Frequencies of letters of an alphabet.

Examples:

freescore.cpp.

Definition at line 32 of file frequencies.hpp.


Member Function Documentation

void Frequencies::Normalize ( bool  setupUIPAC = false  ) 

Normalize the frequencies such that they sum to one

Parameters:
setupUIPAC if true only regular letters are normalized and the extended letters are set the the average value
Examples:
freescore.cpp.
int Frequencies::RandomLetter ( DRand48 rng  )  const

Draw a random letter. Draw a random letter from the alphabet according to the frequency table.

Parameters:
rng reference to the random number generator
Returns:
a random encoded letter
void Frequencies::RandomSequence ( DRand48 rng,
Sequence seq 
) const [inline]

Draw a random sequence. Draw a random IID sequence from with probability $ p=\prod_i f_{s_i} $.

Parameters:
rng reference to the random number generator
seq reference to the sequence that is to be shuffeled
length length of the sequence

Definition at line 115 of file frequencies.hpp.

void Frequencies::RandomSequence ( DRand48 rng,
Sequence seq,
size_t  length 
) const

Draw a random sequence. Draw a random IID sequence from with probability $ p=\prod_i f_{s_i} $.

Parameters:
rng reference to the random number generator
seq reference to the sequence that is to be shuffeled
length length of the sequence

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