bpp-phyl3 3.0.0
MvaFrequencySet.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: The Bio++ Development Group
2//
3// SPDX-License-Identifier: CECILL-2.1
4
5#ifndef BPP_PHYL_MODEL_FREQUENCYSET_MVAFREQUENCYSET_H
6#define BPP_PHYL_MODEL_FREQUENCYSET_MVAFREQUENCYSET_H
7
8
9#include "../Protein/Coala.h"
10#include "ProteinFrequencySet.h"
11
12namespace bpp
13{
22 public virtual ProteinFrequencySetInterface,
24{
25public:
29 MvaFrequencySet(std::shared_ptr<const ProteicAlphabet> alpha);
30
31 MvaFrequencySet* clone() const override { return new MvaFrequencySet(*this); }
32
33 /*
34 MvaFrequencySet& operator=(const MvaFrequencySet& mfs)
35 {
36 AbstractFrequencySet::operator=(mfs);
37 tPpalAxes_ = mfs.tPpalAxes_;
38 rowCoords_ = mfs.rowCoords_;
39 nbrOfAxes_ = mfs.nbrOfAxes_;
40 model_ = mfs.model_;
41 columnWeights_ = mfs.columnWeights_;
42 paramValues_ = mfs.paramValues_;
43 return *this;
44 }
45 */
46
47protected:
50 size_t nbrOfAxes_;
51 std::string model_;
52 std::vector<double> columnWeights_;
53 std::map<std::string, std::string> paramValues_;
54
55public:
56 std::shared_ptr<const ProteicAlphabet> getProteicAlphabet() const override
57 {
58 return std::dynamic_pointer_cast<const ProteicAlphabet>(getAlphabet());
59 }
60
62 void setMatrixOfRowCoords(const RowMatrix<double>& matrix) { rowCoords_ = matrix; }
63 void setNbrOfAxes(const size_t& nAxes) { nbrOfAxes_ = nAxes; }
64 void setModelName(const std::string& modelName) { model_ = modelName; }
65 void setVectorOfColumnWeights(const std::vector<double>& cw) { columnWeights_ = cw; }
66 void setParamValues(std::map<std::string, std::string>& valuesSettings) {paramValues_ = valuesSettings;}
67
68 void setFrequencies(const std::vector<double>& frequencies) override;
69
70 void defineParameters();
71 void fireParameterChanged(const ParameterList& parameters) override;
72 void updateFrequencies();
73
74 void initSet(const CoalaCore& coala);
75
76 void computeReversePCA(const std::vector<double>& positions, std::vector<double>& tmpFreqs);
77 void computeCoordsFirstSpacePCA(std::vector<double>& tmpFreqs, std::vector<double>& freqs);
78 void computeReverseCOA(const std::vector<double>& positions, std::vector<double>& tmpFreqs);
79 void computeCoordsFirstSpaceCOA(std::vector<double>& tmpFreqs, std::vector<double>& freqs);
80};
81} // end of namespace bpp.
82#endif // BPP_PHYL_MODEL_FREQUENCYSET_MVAFREQUENCYSET_H
Basic implementation of the FrequencySet interface.
Definition: FrequencySet.h:102
std::shared_ptr< const Alphabet > getAlphabet() const override
Definition: FrequencySet.h:140
This class is the core class inherited by the Coala class. COaLA is a branch-heterogeneous amino-acid...
Definition: CoalaCore.h:32
A frequencies set used to estimate frequencies at the root with the COaLA model. Frequencies at the r...
std::shared_ptr< const ProteicAlphabet > getProteicAlphabet() const override
void computeCoordsFirstSpacePCA(std::vector< double > &tmpFreqs, std::vector< double > &freqs)
RowMatrix< double > tPpalAxes_
void setMatrixOfRowCoords(const RowMatrix< double > &matrix)
RowMatrix< double > rowCoords_
MvaFrequencySet(std::shared_ptr< const ProteicAlphabet > alpha)
Constructor.
void initSet(const CoalaCore &coala)
void setParamValues(std::map< std::string, std::string > &valuesSettings)
void computeReverseCOA(const std::vector< double > &positions, std::vector< double > &tmpFreqs)
MvaFrequencySet * clone() const override
std::vector< double > columnWeights_
void setFrequencies(const std::vector< double > &frequencies) override
Set the parameters in order to match a given set of frequencies.
void computeCoordsFirstSpaceCOA(std::vector< double > &tmpFreqs, std::vector< double > &freqs)
void computeReversePCA(const std::vector< double > &positions, std::vector< double > &tmpFreqs)
void setModelName(const std::string &modelName)
void fireParameterChanged(const ParameterList &parameters) override
void setTransposeMatrixOfPpalAxes(const RowMatrix< double > &matrix)
std::map< std::string, std::string > paramValues_
void setNbrOfAxes(const size_t &nAxes)
void setVectorOfColumnWeights(const std::vector< double > &cw)
Parametrize a set of state frequencies for proteins.
Defines the basic types of data flow nodes.