bpp-phyl3  3.0.0
Coala.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_PROTEIN_COALA_H
6 #define BPP_PHYL_MODEL_PROTEIN_COALA_H
7 
8 
9 #include "../AbstractSubstitutionModel.h"
10 #include "CoalaCore.h"
12 
13 // From bpp-seq:
15 
16 namespace bpp
17 {
54 class Coala :
56  public CoalaCore
57 {
58 protected:
59  bool init_;
60  unsigned int nbrOfAxes_;
61  std::string exch_;
62  std::string file_;
63  bool param_;
64 
65 public:
66  Coala(std::shared_ptr<const ProteicAlphabet> alpha,
68  unsigned int nbAxes = 0,
69  bool param = true);
70 
71  virtual ~Coala() {}
72 
73  Coala* clone() const override { return new Coala(*this); }
74 
75 public:
76  std::string getName() const override { return "Coala"; }
77  std::string getExch() const { return exch_; }
78  void setFreqFromData(const SequenceDataInterface& data, double pseudoCount = 0) override;
79  std::string getEmpiricalMatrixFile() const { return file_; }
80 
81 protected:
82  void readFromFile(std::string& file);
84  void updateMatrices_() override;
85 };
86 } // end of namespace bpp.
87 #endif // BPP_PHYL_MODEL_PROTEIN_COALA_H
Specialisation abstract class for reversible protein substitution model.
This class is the core class inherited by the Coala class. COaLA is a branch-heterogeneous amino-acid...
Definition: CoalaCore.h:32
The Coala branch-heterogeneous amino-acid substitution model.
Definition: Coala.h:57
std::string getExch() const
Definition: Coala.h:77
std::string getEmpiricalMatrixFile() const
Definition: Coala.h:79
void updateMatrices_() override
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
Definition: Coala.cpp:136
unsigned int nbrOfAxes_
Definition: Coala.h:60
void readFromFile(std::string &file)
Definition: Coala.cpp:51
void setFreqFromData(const SequenceDataInterface &data, double pseudoCount=0) override
Set equilibrium frequencies equal to the frequencies estimated from the data.
Definition: Coala.cpp:144
bool init_
Definition: Coala.h:59
std::string getName() const override
Get the name of the model.
Definition: Coala.h:76
std::string file_
Definition: Coala.h:62
std::string exch_
Definition: Coala.h:61
Coala(std::shared_ptr< const ProteicAlphabet > alpha, const ProteinSubstitutionModelInterface &model, unsigned int nbAxes=0, bool param=true)
Definition: Coala.cpp:28
void computeEquilibriumFrequencies()
Definition: Coala.cpp:85
bool param_
Definition: Coala.h:63
Coala * clone() const override
Definition: Coala.h:73
virtual ~Coala()
Definition: Coala.h:71
Specialized interface for protein substitution model.
Defines the basic types of data flow nodes.