bpp-phyl  2.2.0
ProteinFrequenciesSet.h
Go to the documentation of this file.
1 //
2 // File: ProteinFrequenciesSet.h
3 // Created by: Bastien Boussau
4 // Julien Dutheil
5 // Created on: Tue Aug 21 2007
6 //
7 
8 /*
9  Copyright or (c) or Copr. Bio++ Development Team, (November 16, 2004)
10 
11  This software is a computer program whose purpose is to provide classes
12  for phylogenetic data analysis.
13 
14  This software is governed by the CeCILL license under French law and
15  abiding by the rules of distribution of free software. You can use,
16  modify and/ or redistribute the software under the terms of the CeCILL
17  license as circulated by CEA, CNRS and INRIA at the following URL
18  "http://www.cecill.info".
19 
20  As a counterpart to the access to the source code and rights to copy,
21  modify and redistribute granted by the license, users are provided only
22  with a limited warranty and the software's author, the holder of the
23  economic rights, and the successive licensors have only limited
24  liability.
25 
26  In this respect, the user's attention is drawn to the risks associated
27  with loading, using, modifying and/or developing or reproducing the
28  software by the user in light of its specific status of free software,
29  that may mean that it is complicated to manipulate, and that also
30  therefore means that it is reserved for developers and experienced
31  professionals having in-depth computer knowledge. Users are therefore
32  encouraged to load and test the software's suitability as regards their
33  requirements in conditions enabling the security of their systems and/or
34  data to be ensured and, more generally, to use and operate it in the
35  same conditions as regards security.
36 
37  The fact that you are presently reading this means that you have had
38  knowledge of the CeCILL license and that you accept its terms.
39  */
40 
41 #ifndef _PROTEINFREQUENCIESSET_H_
42 #define _PROTEINFREQUENCIESSET_H_
43 
44 #include <Bpp/Seq/Alphabet/ProteicAlphabet.h>
45 #include "FrequenciesSet.h"
46 
47 namespace bpp
48 {
53  public virtual FrequenciesSet
54 {
55 public:
56 #ifndef NO_VIRTUAL_COV
57  ProteinFrequenciesSet* clone() const = 0;
58 
59  const ProteicAlphabet* getAlphabet() const = 0;
60 #endif
61 };
62 
75  public virtual ProteinFrequenciesSet,
76  public FullFrequenciesSet
77 {
78 public:
79  FullProteinFrequenciesSet(const ProteicAlphabet* alphabet, bool allowNullFreqs = false, unsigned short method = 1, const std::string& name = "Full") :
80  FullFrequenciesSet(new CanonicalStateMap(alphabet, false), allowNullFreqs, method, name) {}
81  FullProteinFrequenciesSet(const ProteicAlphabet* alphabet, const std::vector<double>& initFreqs, bool allowNullFreqs = false, unsigned short method = 1, const std::string& name = "Full") :
82  FullFrequenciesSet(new CanonicalStateMap(alphabet, false), initFreqs, allowNullFreqs, method, name) {}
83 
84 #ifndef NO_VIRTUAL_COV
86 #else
87  Clonable*
88 #endif
89  clone() const { return new FullProteinFrequenciesSet(*this); }
90 
91 public:
92 #ifndef NO_VIRTUAL_COV
93  const ProteicAlphabet* getAlphabet() const
94  {
95  return dynamic_cast<const ProteicAlphabet*>(AbstractFrequenciesSet::getAlphabet());
96  }
97 #endif
98 };
99 
106  public virtual ProteinFrequenciesSet,
107  public FixedFrequenciesSet
108 {
109 public:
110  FixedProteinFrequenciesSet(const ProteicAlphabet* alphabet, const std::vector<double>& initFreqs, const std::string& name = "Fixed") :
111  FixedFrequenciesSet(new CanonicalStateMap(alphabet, false), initFreqs, name) {}
112 
117  FixedProteinFrequenciesSet(const ProteicAlphabet* alphabet, const std::string& name = "Fixed") :
118  FixedFrequenciesSet(new CanonicalStateMap(alphabet, false), name) {}
119 
120 #ifndef NO_VIRTUAL_COV
122 #else
124 #endif
125  clone() const { return new FixedProteinFrequenciesSet(*this); }
126 
127 #ifndef NO_VIRTUAL_COV
128  const ProteicAlphabet* getAlphabet() const
129  {
130  return dynamic_cast<const ProteicAlphabet*>(AbstractFrequenciesSet::getAlphabet());
131  }
132 #endif
133 };
134 
135 
136 } // end of namespace bpp.
137 
138 #endif // _PROTEINFREQUENCIESSET_H_
139 
140 
FixedProteinFrequenciesSet(const ProteicAlphabet *alphabet, const std::string &name="Fixed")
Construction with uniform frequencies on the letters of the alphabet.
FixedProteinFrequenciesSet * clone() const
FrequenciesSet useful for homogeneous and stationary models.
const ProteicAlphabet * getAlphabet() const
FullProteinFrequenciesSet * clone() const
This class implements a state map where all resolved states are modeled.
Definition: StateMap.h:161
FixedProteinFrequenciesSet(const ProteicAlphabet *alphabet, const std::vector< double > &initFreqs, const std::string &name="Fixed")
FrequenciesSet useful for homogeneous and stationary models, protein implementation.
Parametrize a set of state frequencies.
ProteinFrequenciesSet * clone() const =0
A generic FrequenciesSet allowing for the estimation of all frequencies.
Protein FrequenciesSet using 19 independent parameters to model the 20 frequencies.
const Alphabet * getAlphabet() const
FullProteinFrequenciesSet(const ProteicAlphabet *alphabet, const std::vector< double > &initFreqs, bool allowNullFreqs=false, unsigned short method=1, const std::string &name="Full")
Parametrize a set of state frequencies for proteins.
const ProteicAlphabet * getAlphabet() const
FullProteinFrequenciesSet(const ProteicAlphabet *alphabet, bool allowNullFreqs=false, unsigned short method=1, const std::string &name="Full")
const ProteicAlphabet * getAlphabet() const =0