bpp-seq3  3.0.0
AAChouFasmanAHelixIndex.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_AACHOUFASMANAHELIXINDEX_H
6 #define BPP_SEQ_ALPHABETINDEX_AACHOUFASMANAHELIXINDEX_H
7 
8 
9 #include "AlphabetIndex1.h"
10 
11 namespace bpp
12 {
20 {
21 private:
22  std::vector<double> aHelix_;
23 
24 public:
27  aHelix_()
28  {
29  aHelix_.resize(20);
30  aHelix_[ 0] = 142; // A
31  aHelix_[ 1] = 98; // R
32  aHelix_[ 2] = 67; // N
33  aHelix_[ 3] = 101; // D
34  aHelix_[ 4] = 70; // C
35  aHelix_[ 5] = 111; // Q
36  aHelix_[ 6] = 151; // E
37  aHelix_[ 7] = 57; // G
38  aHelix_[ 8] = 100; // H
39  aHelix_[ 9] = 108; // I
40  aHelix_[10] = 121; // L
41  aHelix_[11] = 114; // K
42  aHelix_[12] = 145; // M
43  aHelix_[13] = 113; // F
44  aHelix_[14] = 57; // P
45  aHelix_[15] = 77; // S
46  aHelix_[16] = 83; // T
47  aHelix_[17] = 108; // W
48  aHelix_[18] = 69; // Y
49  aHelix_[19] = 106; // V
50  }
51 
53 
54  AAChouFasmanAHelixIndex* clone() const override
55  {
56  return new AAChouFasmanAHelixIndex();
57  }
58 
59 public:
60  double getIndex(int state) const override
61  {
62  return aHelix_[getAlphabet()->getStateIndex(state) - 1];
63  }
64 
65  double getIndex(const std::string& state) const override
66  {
67  return aHelix_[getAlphabet()->getStateIndex(state) - 1];
68  }
69 
70  const std::vector<double>& indexVector() const override { return aHelix_; }
71 };
72 } // end of namespace bpp.
73 #endif // BPP_SEQ_ALPHABETINDEX_AACHOUFASMANAHELIXINDEX_H
A-Helix score for the Chou-Fasman algorithm of secondary structure prediction, according to http://pr...
const std::vector< double > & indexVector() const override
double getIndex(const std::string &state) const override
Get the index associated to a state.
AAChouFasmanAHelixIndex * clone() const override
double getIndex(int 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.