10 #include "../Alphabet/AlphabetTools.h"
11 #include "../AlphabetIndex/AAIndex2Entry.h"
12 #include "../AlphabetIndex/AlphabetIndex1.h"
13 #include "../AlphabetIndex/BLOSUM50.h"
14 #include "../AlphabetIndex/CodonFromProteicAlphabetIndex2.h"
15 #include "../AlphabetIndex/GranthamAAChemicalDistance.h"
16 #include "../AlphabetIndex/MiyataAAChemicalDistance.h"
17 #include "../AlphabetIndex/SimpleIndexDistance.h"
26 if (description !=
"None")
29 map<string, string> args;
37 throw Exception(
"BppOAlphabetIndex2Format::read. Missing genetic code for codon alphabet.");
39 auto alphaPtr = gencode_->getTargetAlphabet();
42 shared_ptr<AlphabetIndex2> ai2(reader2.
read(description));
44 throw Exception(
"BppOAlphabetIndex2Format::read. Not a Proteic Alphabet for CodonAlphabetIndex2.");
46 return make_unique<CodonFromProteicAlphabetIndex2>(gencode_, ai2);
51 throw Exception(
"BppOAlphabetIndex2Format::read. This index is only supported with a protein alphabet.");
53 if (name ==
"Blosum50")
55 return make_unique<BLOSUM50>();
57 else if (name ==
"Grantham")
60 auto M = make_unique<GranthamAAChemicalDistance>();
66 else if (name ==
"Miyata")
69 auto M = make_unique<MiyataAAChemicalDistance>();
73 else if (name ==
"Diff")
78 auto index1 = index1Reader.
read(index1Desc);
81 auto M = make_unique<SimpleIndexDistance>(std::move(index1));
87 throw Exception(
"BppOAlphabetIndex2Format::read. Diff: index1 should be provided.");
90 else if (name ==
"User")
94 ifstream aax2File(aax2FilePath.c_str(), ios::in);
95 auto M = make_unique<AAIndex2Entry>(aax2File, sym);
101 throw Exception(
"Invalid index2 '" + name +
"'.");
This alphabet is used to deal NumericAlphabet.