70 const vector<double> rCoords =
rowCoords_.col(i);
71 double maxCoord = VectorTools::max(rCoords);
72 double minCoord = VectorTools::min(rCoords);
73 double sd = VectorTools::sd<double, double>(rCoords);
74 IntervalConstraint* constraint =
new IntervalConstraint(minCoord - sd, maxCoord + sd,
true,
true);
76 addParameter_(
new Parameter(
"MVA.RootAxPos" + TextTools::toString(i), TextTools::toDouble(
paramValues_[
"RootAxPos" + TextTools::toString(i)].substr(0, 8)), constraint));
78 addParameter_(
new Parameter(
"MVA.RootAxPos" + TextTools::toString(i), 0., constraint));
90 throw Exception(
"The number of axes kept by the MVA analysis was not set. You should initialize it with the setNbrOfAxes function");
91 vector<double> positions;
95 positions.push_back(getParameter(
"RootAxPos" + TextTools::toString(i)).getValue());
98 vector<double> tmpFreqs(20, 0.0);
99 vector<double> freqs(20, 0.0);
107 for (
unsigned int i = 0; i < 20; i++)
123 for (
size_t i = 0; i < 20; ++i)
135 for (
unsigned int i = 0; i < 20; i++)
137 for (
unsigned int j = 0; j < nbrOfAxes_; j++)
139 tmpFreqs[i] = tmpFreqs[i] + tPpalAxes_(j, i) * positions[j];
146 if (freqs.size() != tmpFreqs.size())
147 throw Exception(
"MvaFrequenciesSet::computeCoordsFirstSpaceCOA : error in the size of the vectors");
149 for (
unsigned int i = 0; i < tmpFreqs.size(); i++)
151 freqs[i] = (tmpFreqs[i] + 1) * columnWeights_[i];
void fireParameterChanged(const ParameterList ¶meters)
size_t getNbrOfAxes() const
This class implements a state map where all resolved states are modeled.
void setVectorOfColumnWeights(const std::vector< double > &cw)
RowMatrix< double > rowCoords_
void setFrequencies_(const std::vector< double > &frequencies)
void computeReverseCOA(const std::vector< double > &positions, std::vector< double > &tmpFreqs)
void setNbrOfAxes(const size_t &nAxes)
MvaFrequenciesSet(const ProteicAlphabet *alpha)
Constructor.
void computeCoordsFirstSpaceCOA(std::vector< double > &tmpFreqs, std::vector< double > &freqs)
const std::vector< double > & getColumnWeights() const
std::map< std::string, std::string > paramValues_
double & getFreq_(size_t i)
void initSet(CoalaCore *coala)
const RowMatrix< double > & getTppalAxesMatrix() const
void setFrequencies(const std::vector< double > &frequencies)
Set the parameters in order to match a given set of frequencies.
const std::vector< double > getFrequencies() const
void setTransposeMatrixOfPpalAxes(const RowMatrix< double > &matrix)
void setMatrixOfRowCoords(const RowMatrix< double > &matrix)
This class is the core class inherited by the Coala class. COaLA is a branch-heterogeneous amino-acid...
Basic implementation of the FrequenciesSet interface.
const RowMatrix< double > & getRowCoordinates() const