bpp-phyl  2.2.0
SubstitutionModelFactory.h
Go to the documentation of this file.
1 //
2 // File: SubstitutionModelFactory.h
3 // Created by: Julien Dutheil
4 // Vincent Ranwez
5 // Created on: Fri apr 14 11:11 2006
6 //
7 
8 /*
9 Copyright or © or Copr. Bio++ Development Team, (November 16, 2004, 2005, 2006)
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 _SUBSTITUTIOMODELFACTORY_H_
42 #define _SUBSTITUTIOMODELFACTORY_H_
43 
44 #include "../Model/Nucleotide/JCnuc.h"
45 #include "../Tree.h"
46 
47 // From SeqLib:
48 #include <Bpp/Seq/Alphabet/Alphabet.h>
49 #include <Bpp/Seq/Alphabet/AlphabetExceptions.h>
50 #include <Bpp/Seq/GeneticCode/GeneticCode.h>
51 
52 // From the STL:
53 #include <string>
54 
55 namespace bpp
56 {
57 
62 {
63  public:
64  static const std::string JUKES_CANTOR;
65  static const std::string KIMURA_2P;
66  static const std::string HASEGAWA_KISHINO_YANO;
67  static const std::string TAMURA_NEI;
68  static const std::string GENERAL_TIME_REVERSIBLE;
69  static const std::string STRAND_SYMMETRIC_REVERSIBLE;
70  static const std::string TAMURA;
71  static const std::string LOBRY;
72  static const std::string FELSENSTEIN;
73  static const std::string JOHN_TAYLOR_THORNTON;
74  static const std::string DAYHOFF_SCHWARTZ_ORCUTT;
75  static const std::string WHELAN_AND_GOLDMAN;
76  static const std::string LE_GASCUEL;
77 
78  private:
79  const Alphabet* alphabet_;
80  const GeneticCode* geneticCode_;
81 
82  public:
100  SubstitutionModelFactory(const Alphabet* alphabet, const GeneticCode* geneticCode):
101  alphabet_(alphabet), geneticCode_(geneticCode) {}
102 
105 
107  {
108  alphabet_ = smf.alphabet_;
110  return *this;
111  }
112 
114 
115  public:
124  virtual SubstitutionModel* createModel(const std::string& modelName) const throw (AlphabetException, Exception);
125 
126 };
127 
128 } //end of namespace bpp.
129 
130 #endif //_SUBSTITUTIOMODELFACTORY_H_
131 
Interface for all substitution models.
static const std::string JUKES_CANTOR
static const std::string KIMURA_2P
static const std::string FELSENSTEIN
SubstitutionModelFactory(const SubstitutionModelFactory &smf)
Utilitary class for creating substitution models.
virtual SubstitutionModel * createModel(const std::string &modelName) const
Get a new dynamically created SubstitutionModel object.
static const std::string LE_GASCUEL
static const std::string HASEGAWA_KISHINO_YANO
static const std::string DAYHOFF_SCHWARTZ_ORCUTT
static const std::string WHELAN_AND_GOLDMAN
static const std::string JOHN_TAYLOR_THORNTON
SubstitutionModelFactory(const Alphabet *alphabet, const GeneticCode *geneticCode)
Creates a new factory object with the given alphabet.
static const std::string STRAND_SYMMETRIC_REVERSIBLE
SubstitutionModelFactory & operator=(const SubstitutionModelFactory &smf)
static const std::string GENERAL_TIME_REVERSIBLE
static const std::string TAMURA_NEI