bpp-phyl  2.2.0
Coala.h
Go to the documentation of this file.
1 //
2 // File: Coala.h
3 // Created by: Bastien Boussau
4 // Created on: Tue May 18 15:23:20 2010
5 // Modified by: Mathieu Groussin
6 // Modified on: Sun Mar 13 12:00:00 2011
7 //
8 
9 /*
10  Copyright or © or Copr. Bio++ Development Team, (November 16, 2004)
11 
12  This software is a computer program whose purpose is to provide classes
13  for phylogenetic data analysis.
14 
15  This software is governed by the CeCILL license under French law and
16  abiding by the rules of distribution of free software. You can use,
17  modify and/ or redistribute the software under the terms of the CeCILL
18  license as circulated by CEA, CNRS and INRIA at the following URL
19  "http://www.cecill.info".
20 
21  As a counterpart to the access to the source code and rights to copy,
22  modify and redistribute granted by the license, users are provided only
23  with a limited warranty and the software's author, the holder of the
24  economic rights, and the successive licensors have only limited
25  liability.
26 
27  In this respect, the user's attention is drawn to the risks associated
28  with loading, using, modifying and/or developing or reproducing the
29  software by the user in light of its specific status of free software,
30  that may mean that it is complicated to manipulate, and that also
31  therefore means that it is reserved for developers and experienced
32  professionals having in-depth computer knowledge. Users are therefore
33  encouraged to load and test the software's suitability as regards their
34  requirements in conditions enabling the security of their systems and/or
35  data to be ensured and, more generally, to use and operate it in the
36  same conditions as regards security.
37 
38  The fact that you are presently reading this means that you have had
39  knowledge of the CeCILL license and that you accept its terms.
40  */
41 
42 
43 #ifndef _COALA_H_
44 #define _COALA_H_
45 
47 #include "../AbstractSubstitutionModel.h"
48 #include "CoalaCore.h"
49 
50 // From bpp-seq:
51 #include <Bpp/Seq/Alphabet/ProteicAlphabet.h>
52 
53 namespace bpp
54 {
72 class Coala :
75  public CoalaCore
76 {
77 protected:
78  bool init_;
79  unsigned int nbrOfAxes_;
80  std::string exch_;
81  std::string file_;
82  bool param_;
83 
84 public:
85  Coala(const ProteicAlphabet* alpha,
86  const ProteinSubstitutionModel& model,
87  unsigned int nbAxes = 0,
88  bool param = true);
89 
90  virtual ~Coala() {}
91 
92 #ifndef NO_VIRTUAL_COV
93  Coala*
94 #else
95  Clonable*
96 #endif
97  clone() const { return new Coala(*this); }
98 
99 public:
100  std::string getName() const {return "Coala"; }
101  std::string getExch() const {return exch_; }
102  void setFreqFromData(const SequenceContainer& data, double pseudoCount = 0);
103  std::string getEmpiricalMatrixFile() const { return file_; }
104 
105 protected:
106  void readFromFile(std::string& file);
108  void updateMatrices();
109 };
110 } // end of namespace bpp.
111 #endif // _COALA_H_
std::string exch_
Definition: Coala.h:80
std::string getEmpiricalMatrixFile() const
Definition: Coala.h:103
void updateMatrices()
Compute and diagonalize the matrix, and fill the eigenValues_, leftEigenVectors_ and rightEigenVecto...
Definition: Coala.cpp:173
std::string file_
Definition: Coala.h:81
Specialized interface for protein substitution model.
std::string getExch() const
Definition: Coala.h:101
Coala(const ProteicAlphabet *alpha, const ProteinSubstitutionModel &model, unsigned int nbAxes=0, bool param=true)
Definition: Coala.cpp:65
unsigned int nbrOfAxes_
Definition: Coala.h:79
Partial implementation of the ReversibleSubstitutionModel interface.
bool init_
Definition: Coala.h:78
void computeEquilibriumFrequencies()
Definition: Coala.cpp:122
The Coala branch-heterogeneous amino-acid substitution model.
Definition: Coala.h:72
Coala * clone() const
Definition: Coala.h:97
void setFreqFromData(const SequenceContainer &data, double pseudoCount=0)
Set equilibrium frequencies equal to the frequencies estimated from the data.
Definition: Coala.cpp:181
void readFromFile(std::string &file)
Definition: Coala.cpp:89
std::string getName() const
Get the name of the model.
Definition: Coala.h:100
virtual ~Coala()
Definition: Coala.h:90
bool param_
Definition: Coala.h:82
This class is the core class inherited by the Coala class. COaLA is a branch-heterogeneous amino-acid...
Definition: CoalaCore.h:66