58 #include <Bpp/Seq/Alphabet/AlphabetTools.h> 83 if (modelName == JUKES_CANTOR)
85 if (AlphabetTools::isNucleicAlphabet(alphabet_))
86 return new JCnuc(dynamic_cast<const NucleicAlphabet *>(alphabet_));
88 return new JCprot(dynamic_cast<const ProteicAlphabet *>(alphabet_));
90 else if(modelName == KIMURA_2P)
93 return new K80(dynamic_cast<const NucleicAlphabet *>(alphabet_));
94 }
catch(Exception & e) {
95 throw AlphabetException(
"SubstitutionModelFactory::createInstanceOf(). K80 model requires a nucleotide alphabet.", alphabet_);
98 else if(modelName == TAMURA)
101 return new T92(dynamic_cast<const NucleicAlphabet *>(alphabet_));
102 }
catch(Exception & e) {
103 throw AlphabetException(
"SubstitutionModelFactory::createInstanceOf(). T92 model requires a nucleotide alphabet.", alphabet_);
106 else if(modelName == LOBRY)
109 return new L95(dynamic_cast<const NucleicAlphabet *>(alphabet_));
110 }
catch(Exception & e) {
111 throw AlphabetException(
"SubstitutionModelFactory::createInstanceOf(). L95 model requires a nucleotide alphabet.", alphabet_);
114 else if(modelName == FELSENSTEIN)
117 return new F84(dynamic_cast<const NucleicAlphabet *>(alphabet_));
118 }
catch(Exception & e) {
119 throw AlphabetException(
"SubstitutionModelFactory::createInstanceOf(). T92 model requires a nucleotide alphabet.", alphabet_);
122 else if(modelName == TAMURA_NEI)
125 return new TN93(dynamic_cast<const NucleicAlphabet *>(alphabet_));
126 }
catch(Exception & e) {
127 throw AlphabetException(
"SubstitutionModelFactory::createInstanceOf(). TN93 model requires a nucleotide alphabet.", alphabet_);
130 else if(modelName == HASEGAWA_KISHINO_YANO)
133 return new HKY85(dynamic_cast<const NucleicAlphabet *>(alphabet_));
134 }
catch(Exception & e) {
135 throw AlphabetException(
"SubstitutionModelFactory::createInstanceOf(). HKY85 model requires a nucleotide alphabet.", alphabet_);
138 else if(modelName == GENERAL_TIME_REVERSIBLE)
141 return new GTR(dynamic_cast<const NucleicAlphabet *>(alphabet_));
142 }
catch(Exception & e) {
143 throw AlphabetException(
"SubstitutionModelFactory::createInstanceOf(). GTR model requires a nucleotide alphabet.", alphabet_);
146 else if(modelName == STRAND_SYMMETRIC_REVERSIBLE)
149 return new SSR(dynamic_cast<const NucleicAlphabet *>(alphabet_));
150 }
catch(Exception & e) {
151 throw AlphabetException(
"SubstitutionModelFactory::createInstanceOf(). SSR model requires a nucleotide alphabet.", alphabet_);
154 else if(modelName == JOHN_TAYLOR_THORNTON)
157 return new JTT92(dynamic_cast<const ProteicAlphabet *>(alphabet_));
158 }
catch(Exception & e) {
159 throw AlphabetException(
"SubstitutionModelFactory::createInstanceOf(). JTT92 model requires a protein alphabet.", alphabet_);
162 else if(modelName == DAYHOFF_SCHWARTZ_ORCUTT)
165 return new DSO78(dynamic_cast<const ProteicAlphabet *>(alphabet_));
166 }
catch(Exception & e) {
167 throw AlphabetException(
"SubstitutionModelFactory::createInstanceOf(). DSO78 model requires a protein alphabet.", alphabet_);
170 else if(modelName == WHELAN_AND_GOLDMAN)
173 return new WAG01(dynamic_cast<const ProteicAlphabet *>(alphabet_));
174 }
catch(Exception & e) {
175 throw AlphabetException(
"SubstitutionModelFactory::createInstanceOf(). WAG01 model requires a protein alphabet.", alphabet_);
178 else if(modelName == LE_GASCUEL)
181 return new LG08(dynamic_cast<const ProteicAlphabet *>(alphabet_));
182 }
catch(Exception & e) {
183 throw AlphabetException(
"SubstitutionModelFactory::createInstanceOf(). LE08 model requires a protein alphabet.", alphabet_);
186 else throw Exception(
"SubstitutionModelFactory::createModel(). Unknown model: " + modelName);
The no-strand bias substitution model for nucleotides, from Lobry 1995. The point of this model is th...
Interface for all substitution models.
The Jukes-Cantor substitution model for proteins.
static const std::string JUKES_CANTOR
The Strand Symmetric Reversible substitution model for nucleotides.
The Whelan and Goldman substitution model for proteins.
static const std::string KIMURA_2P
The Le and Gascuel substitution model for proteins.
The Kimura 2-rates substitution model for nucleotides.
static const std::string FELSENSTEIN
The Tamura (1992) substitution model for nucleotides.
virtual SubstitutionModel * createModel(const std::string &modelName) const
Get a new dynamically created SubstitutionModel object.
static const std::string LOBRY
The Tamura and Nei (1993) substitution model for nucleotides.
The Hasegawa M, Kishino H and Yano T (1985) substitution model for nucleotides.
static const std::string LE_GASCUEL
static const std::string HASEGAWA_KISHINO_YANO
The General Time-Reversible substitution model for nucleotides.
The Jones, Taylor and Thornton substitution model for proteins.
static const std::string TAMURA
static const std::string DAYHOFF_SCHWARTZ_ORCUTT
static const std::string WHELAN_AND_GOLDMAN
static const std::string JOHN_TAYLOR_THORNTON
static const std::string STRAND_SYMMETRIC_REVERSIBLE
The Jukes-Cantor substitution model for nucleotides.
The Felsenstein (1984) substitution model for nucleotides.
static const std::string GENERAL_TIME_REVERSIBLE
The Dayhoff, Schwartz and Orcutt substitution model for proteins.
static const std::string TAMURA_NEI