bpp-seq3  3.0.0
AAVolumeIndex.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_AAVOLUMEINDEX_H
6 #define BPP_SEQ_ALPHABETINDEX_AAVOLUMEINDEX_H
7 
8 
9 #include "AlphabetIndex1.h"
10 
11 namespace bpp
12 {
20 {
21 private:
22  std::vector<double> volume_;
23 
24 public:
27  volume_()
28  {
29  volume_.resize(20);
30  volume_[ 0] = 88.6; // A
31  volume_[ 1] = 173.4; // R
32  volume_[ 2] = 114.1; // N
33  volume_[ 3] = 111.1; // D
34  volume_[ 4] = 108.5; // C
35  volume_[ 5] = 143.8; // Q
36  volume_[ 6] = 138.4; // E
37  volume_[ 7] = 60.1; // G
38  volume_[ 8] = 153.2; // H
39  volume_[ 9] = 166.7; // I
40  volume_[10] = 166.7; // L
41  volume_[11] = 168.6; // K
42  volume_[12] = 162.9; // M
43  volume_[13] = 189.9; // F
44  volume_[14] = 112.7; // P
45  volume_[15] = 89; // S
46  volume_[16] = 116.1; // T
47  volume_[17] = 227.8; // W
48  volume_[18] = 193.6; // Y
49  volume_[19] = 140; // V
50  }
51 
52  virtual ~AAVolumeIndex() {}
53 
54  AAVolumeIndex* clone() const override { return new AAVolumeIndex(); }
55 
56 public:
57  double getIndex(int state) const override
58  {
59  return volume_[getAlphabet()->getStateIndex(state) - 1];
60  }
61 
62  double getIndex(const std::string& state) const override
63  {
64  return volume_[getAlphabet()->getStateIndex(state) - 1];
65  }
66 
67  const std::vector<double>& indexVector() const override { return volume_; }
68 };
69 } // end of namespace bpp.
70 #endif // BPP_SEQ_ALPHABETINDEX_AAVOLUMEINDEX_H
Volume (Angström^3) of each amino acid, according to http://www.imb-jena.de/IMAGE_AA....
Definition: AAVolumeIndex.h:20
AAVolumeIndex * clone() const override
Definition: AAVolumeIndex.h:54
const std::vector< double > & indexVector() const override
Definition: AAVolumeIndex.h:67
std::vector< double > volume_
Definition: AAVolumeIndex.h:22
double getIndex(int state) const override
Get the index associated to a state.
Definition: AAVolumeIndex.h:57
virtual ~AAVolumeIndex()
Definition: AAVolumeIndex.h:52
double getIndex(const std::string &state) const override
Get the index associated to a state.
Definition: AAVolumeIndex.h:62
std::shared_ptr< const Alphabet > getAlphabet() const override
Get the alphabet associated to this index.
This alphabet is used to deal NumericAlphabet.