bpp-seq3  3.0.0
AAChouFasmanTurnIndex.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_SEQ_ALPHABETINDEX_AACHOUFASMANTURNINDEX_H
6 #define BPP_SEQ_ALPHABETINDEX_AACHOUFASMANTURNINDEX_H
7 
8 
9 #include "AlphabetIndex1.h"
10 
11 namespace bpp
12 {
20 {
21 private:
22  std::vector<double> turn_;
23 
24 public:
27  turn_()
28  {
29  turn_.resize(20);
30  turn_[ 0] = 66; // A
31  turn_[ 1] = 95; // R
32  turn_[ 2] = 156; // N
33  turn_[ 3] = 146; // D
34  turn_[ 4] = 119; // C
35  turn_[ 5] = 98; // Q
36  turn_[ 6] = 74; // E
37  turn_[ 7] = 156; // G
38  turn_[ 8] = 95; // H
39  turn_[ 9] = 47; // I
40  turn_[10] = 59; // L
41  turn_[11] = 101; // K
42  turn_[12] = 60; // M
43  turn_[13] = 60; // F
44  turn_[14] = 152; // P
45  turn_[15] = 143; // S
46  turn_[16] = 96; // T
47  turn_[17] = 96; // W
48  turn_[18] = 114; // Y
49  turn_[19] = 50; // V
50  }
51 
53 
54  AAChouFasmanTurnIndex* clone() const override
55  {
56  return new AAChouFasmanTurnIndex();
57  }
58 
59 public:
60  double getIndex(int state) const override
61  {
62  return turn_[getAlphabet()->getStateIndex(state) - 1];
63  }
64 
65  double getIndex(const std::string& state) const override
66  {
67  return turn_[getAlphabet()->getStateIndex(state) - 1];
68  }
69 
70  const std::vector<double>& indexVector() const override
71  {
72  return turn_;
73  }
74 };
75 } // end of namespace bpp.
76 #endif // BPP_SEQ_ALPHABETINDEX_AACHOUFASMANTURNINDEX_H
Turn score for the Chou-Fasman algorithm of secondary structure prediction, according to http://prowl...
double getIndex(int state) const override
Get the index associated to a state.
const std::vector< double > & indexVector() const override
AAChouFasmanTurnIndex * clone() const override
double getIndex(const std::string &state) const override
Get the index associated to a state.
std::shared_ptr< const Alphabet > getAlphabet() const override
Get the alphabet associated to this index.
This alphabet is used to deal NumericAlphabet.