bpp-phyl  2.1.0
bpp::WordFromUniqueFrequenciesSet Class Reference

#include <Bpp/Phyl/Model/FrequenciesSet/WordFrequenciesSet.h>

+ Inheritance diagram for bpp::WordFromUniqueFrequenciesSet:
+ Collaboration diagram for bpp::WordFromUniqueFrequenciesSet:

List of all members.

Public Member Functions

 WordFromUniqueFrequenciesSet (const WordAlphabet *pWA, FrequenciesSet *pabsfreq, const std::string &prefix="", const std::string &name="WordFromUnique")
 Constructor from a WordAlphabet* and a FrequenciesSet* repeated as many times as the length of the words.
 WordFromUniqueFrequenciesSet (const WordFromUniqueFrequenciesSet &iwfs)
WordFromUniqueFrequenciesSetoperator= (const WordFromUniqueFrequenciesSet &iwfs)
 ~WordFromUniqueFrequenciesSet ()
WordFromUniqueFrequenciesSetclone () const
virtual void fireParameterChanged (const ParameterList &pl)
virtual void setFrequencies (const std::vector< double > &frequencies)
virtual void updateFrequencies ()
const FrequenciesSetgetFrequenciesSetForLetter (size_t i) const
size_t getLength () const
void setNamespace (const std::string &prefix)
std::string getDescription () const
const WordAlphabetgetAlphabet () const
virtual const std::vector
< double > & 
getFrequencies () const =0
const std::vector< double > & getFrequencies () const
virtual void setFrequenciesFromMap (const std::map< int, double > &frequencies)=0
 Set the Frequencies from the one of the map which keys match with a letter of the Alphabet. The frequencies are normalized so that the matching values sum 1.
void setFrequenciesFromMap (const std::map< int, double > &frequencies)
 Set the Frequencies from the one of the map which keys match with a letter of the Alphabet. The frequencies are normalized so that the matching values sum 1.
virtual std::string getName () const =0
std::string getName () const
virtual size_t getNumberOfFrequencies () const =0
size_t getNumberOfFrequencies () const
virtual bool hasParameter (const std::string &name) const =0
bool hasParameter (const std::string &name) const
virtual const ParameterListgetParameters () const =0
const ParameterListgetParameters () const
virtual const ParametergetParameter (const std::string &name) const =0
const ParametergetParameter (const std::string &name) const
virtual double getParameterValue (const std::string &name) const =0
double getParameterValue (const std::string &name) const
virtual void setAllParametersValues (const ParameterList &parameters)=0
void setAllParametersValues (const ParameterList &parameters)
virtual void setParameterValue (const std::string &name, double value)=0
void setParameterValue (const std::string &name, double value)
virtual void setParametersValues (const ParameterList &parameters)=0
void setParametersValues (const ParameterList &parameters)
virtual bool matchParametersValues (const ParameterList &parameters)=0
bool matchParametersValues (const ParameterList &parameters)
virtual size_t getNumberOfParameters () const =0
size_t getNumberOfParameters () const
virtual std::string getNamespace () const =0
std::string getNamespace () const
virtual std::string getParameterNameWithoutNamespace (const std::string &name) const =0
std::string getParameterNameWithoutNamespace (const std::string &name) const

Static Public Attributes

static IntervalConstraint FREQUENCE_CONSTRAINT_SMALL
static IntervalConstraint FREQUENCE_CONSTRAINT_MILLI

Protected Member Functions

size_t getSizeFromVector (const std::vector< FrequenciesSet * > &freqVector)
std::vector< double > & getFrequencies_ ()
double & getFreq_ (size_t i)
const double & getFreq_ (size_t i) const
void setFrequencies_ (const std::vector< double > &frequencies)
void addParameter_ (Parameter *parameter)
void addParameters_ (const ParameterList &parameters)
void deleteParameter_ (size_t index)
void resetParameters_ ()
ParametergetParameter_ (const std::string &name)
ParametergetParameter_ (size_t index)
const ParametergetParameter_ (size_t index) const
ParametergetParameterWithNamespace_ (const std::string &name)
const ParametergetParameterWithNamespace_ (const std::string &name) const
ParameterListgetParameters_ ()

Protected Attributes

FrequenciesSetpFreq_
std::string NestedPrefix_
size_t length_

Detailed Description

Definition at line 190 of file WordFrequenciesSet.h.


Constructor & Destructor Documentation

WordFromUniqueFrequenciesSet::WordFromUniqueFrequenciesSet ( const WordAlphabet pWA,
FrequenciesSet pabsfreq,
const std::string &  prefix = "",
const std::string &  name = "WordFromUnique" 
)

Constructor from a WordAlphabet* and a FrequenciesSet* repeated as many times as the length of the words.

Definition at line 254 of file WordFrequenciesSet.cpp.

References bpp::AbstractParametrizable::addParameters_(), bpp::Parametrizable::getParameters(), length_, NestedPrefix_, pFreq_, bpp::Parametrizable::setNamespace(), bpp::TextTools::toString(), and updateFrequencies().

Referenced by clone().


Member Function Documentation

const double& bpp::AbstractFrequenciesSet::getFreq_ ( size_t  i) const [inline, protected, inherited]

Definition at line 162 of file FrequenciesSet.h.

References bpp::AbstractFrequenciesSet::freq_.

const std::vector<double>& bpp::AbstractFrequenciesSet::getFrequencies ( ) const [inline, virtual, inherited]
Returns:
The frequencies values of the set.

Implements bpp::FrequenciesSet.

Definition at line 151 of file FrequenciesSet.h.

References bpp::AbstractFrequenciesSet::freq_.

Referenced by bpp::MvaFrequenciesSet::updateFrequencies().

std::vector<double>& bpp::AbstractFrequenciesSet::getFrequencies_ ( ) [inline, protected, inherited]

Definition at line 160 of file FrequenciesSet.h.

References bpp::AbstractFrequenciesSet::freq_.

@ brief Return the n-th FrequenciesSet&

Implements bpp::WordFrequenciesSet.

Definition at line 230 of file WordFrequenciesSet.h.

References pFreq_.

Referenced by bpp::BppOFrequenciesSetFormat::write().

size_t bpp::WordFromUniqueFrequenciesSet::getLength ( ) const [inline, virtual]

@ brief Return the length of the words

Reimplemented from bpp::AbstractWordFrequenciesSet.

Definition at line 232 of file WordFrequenciesSet.h.

References length_.

Referenced by bpp::BppOFrequenciesSetFormat::write().

std::string bpp::AbstractFrequenciesSet::getName ( ) const [inline, virtual, inherited]
virtual size_t bpp::FrequenciesSet::getNumberOfFrequencies ( ) const [pure virtual, inherited]
Returns:
The number of frequencies in the set. In most cases this will correspond to the size of the alphabet, but it needs not be.

Implemented in bpp::AbstractFrequenciesSet.

size_t bpp::AbstractFrequenciesSet::getNumberOfFrequencies ( ) const [inline, virtual, inherited]
Returns:
The number of frequencies in the set. In most cases this will correspond to the size of the alphabet, but it needs not be.

Implements bpp::FrequenciesSet.

Definition at line 155 of file FrequenciesSet.h.

References bpp::AbstractFrequenciesSet::freq_.

Referenced by bpp::FullFrequenciesSet::setFrequencies(), and bpp::FixedFrequenciesSet::setFrequencies().

size_t AbstractWordFrequenciesSet::getSizeFromVector ( const std::vector< FrequenciesSet * > &  freqVector) [protected, virtual, inherited]
WordFromUniqueFrequenciesSet & WordFromUniqueFrequenciesSet::operator= ( const WordFromUniqueFrequenciesSet iwfs)
void WordFromUniqueFrequenciesSet::setFrequencies ( const std::vector< double > &  frequencies) [virtual]

@ brief letter frequencies from given word frequencies. The frequencies of a letter at a position is the sum of the frequencies of the words that have this letter at this position. The frequencies of each letter is the average of the frequencies of that letter at all positions.

Implements bpp::FrequenciesSet.

Definition at line 334 of file WordFrequenciesSet.cpp.

References bpp::FrequenciesSet::getAlphabet(), bpp::AbstractWordFrequenciesSet::getAlphabet(), bpp::Parametrizable::getParameters(), bpp::WordAlphabet::getSize(), bpp::Alphabet::getSize(), length_, bpp::AbstractParametrizable::matchParametersValues(), pFreq_, bpp::FrequenciesSet::setFrequencies(), bpp::TextTools::toString(), and updateFrequencies().

virtual void bpp::FrequenciesSet::setFrequenciesFromMap ( const std::map< int, double > &  frequencies) [pure virtual, inherited]

Set the Frequencies from the one of the map which keys match with a letter of the Alphabet. The frequencies are normalized so that the matching values sum 1.

Parameters:
frequenciesThe set of frequencies to match.

Implemented in bpp::AbstractFrequenciesSet.

Referenced by bpp::BppOFrequenciesSetFormat::initialize_(), bpp::AbstractCodonFitnessSubstitutionModel::setFreq(), bpp::AbstractCodonFrequenciesSubstitutionModel::setFreq(), and bpp::AbstractCodonPhaseFrequenciesSubstitutionModel::setFreq().

void AbstractFrequenciesSet::setFrequenciesFromMap ( const std::map< int, double > &  frequencies) [virtual, inherited]

Set the Frequencies from the one of the map which keys match with a letter of the Alphabet. The frequencies are normalized so that the matching values sum 1.

Parameters:
frequenciesThe set of frequencies to match.

Implements bpp::FrequenciesSet.

Definition at line 58 of file FrequenciesSet.cpp.

void WordFromUniqueFrequenciesSet::setNamespace ( const std::string &  prefix) [virtual]

Member Data Documentation


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends