43 #include <Bpp/Seq/Container/SequenceContainerTools.h> 51 AbstractParameterAliasable(
"WAG01."),
55 #include "__WAG01ExchangeabilityCode" 56 #include "__WAG01FrequenciesCode" 62 AbstractParameterAliasable(
"WAG01+F."),
66 #include "__WAG01ExchangeabilityCode" 67 #include "__WAG01FrequenciesCode" 71 addParameters_(
freqSet_->getParameters());
80 SequenceContainerTools::getCounts(data, counts);
82 for (
int i = 0; i < static_cast<int>(
size_); i++)
84 t += (counts[i] + pseudoCount);
86 for (
size_t i = 0; i < size_; ++i) freq_[i] = (static_cast<double>(counts[
static_cast<int>(i)]) + pseudoCount) / t;
89 matchParametersValues(
freqSet_->getParameters());
This class implements a state map where all resolved states are modeled.
virtual void setFrequencies(const std::vector< double > &frequencies)=0
Set the parameters in order to match a given set of frequencies.
FrequenciesSet useful for homogeneous and stationary models, protein implementation.
virtual const std::vector< double > getFrequencies() const =0
Vdouble freq_
The vector of equilibrium frequencies.
virtual void updateMatrices()
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
Partial implementation of the ReversibleSubstitutionModel interface.
Parametrize a set of state frequencies for proteins.
void setFreqFromData(const SequenceContainer &data, double pseudoCount=0)
Set equilibrium frequencies equal to the frequencies estimated from the data.
WAG01(const ProteicAlphabet *alpha)
Build a simple WAG01 model, with original equilibrium frequencies.
ProteinFrequenciesSet * freqSet_
size_t size_
The size of the generator, i.e. the number of states.