Victor
 All Data Structures Functions Variables Friends Pages
Chi1Chi2.h
1 /* This file is part of Victor.
2 
3  Victor is free software: you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation, either version 3 of the License, or
6  (at your option) any later version.
7 
8  Victor is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with Victor. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 
18 #ifndef _CHI1CHI2_H_
19 #define _CHI1CHI2_H_
20 
21 
22 // Includes:
23 #include <TorsionPotential.h>
24 #include <vector>
25 #include <Spacer.h>
26 #include <AminoAcidCode.h>
27 #include <IoTools.h>
28 
29 // Global constants, typedefs, etc. (to avoid):
30 
31 using namespace Victor::Biopool;
32 using namespace Victor::Energy;
33 using namespace Victor;
34 namespace Victor { namespace Energy {
35 
41  class Chi1Chi2 : public TorsionPotential {
42  public:
43 
44  // CONSTRUCTORS/DESTRUCTOR:
45  Chi1Chi2(string knownledge = "data/tor.par"); // OTHER KNOWNLEDGE
46 
47  virtual ~Chi1Chi2() {
48  pResetData();
49  }
50 
51  // PREDICATES:
52  virtual long double calculateEnergy(Spacer& sp);
53  virtual long double calculateEnergy(AminoAcid& aa);
54 
55  virtual long double calculateEnergy(AminoAcid& aa, Spacer& sp) {
56  return calculateEnergy(aa);
57  }
58  virtual long double calculateEnergy(Spacer& sp, unsigned int index1, unsigned int index2);
59 
60  virtual long double calculateEnergy(AminoAcid& diheds, AminoAcidCode code) {
61  ERROR("ERROR. NOT IMPLEMENTED FOR THIS CLASS.", exception)
62  }
63  virtual double pReturnMaxPropensities(int amino);
64 
65  virtual double pReturnMaxPropensitiesPreAngle(int amino, int prephi, int prepsi) {
66  ERROR("ERROR. NOT IMPLEMENTED FOR THIS CLASS.", exception)
67  }
68 
69  virtual int sGetPropBin2(double p) {
70  ERROR("ERROR. NOT IMPLEMENTED FOR THIS CLASS.", exception)
71  }
72 
73  // MODIFIERS:
74 
75  // OPERATORS:
76 
77  protected:
78 
79  // HELPERS:
80  virtual void pConstructData();
81  virtual void pResetData();
82  virtual double pGetMaxPropensities(int amino);
83  //not implemented in this class. No pre-angle considered.
84 
85  virtual double pGetMaxPropensities(int amino, int prephi, int prepsi) {
86  ERROR("ERROR. NOT IMPLEMENTED FOR THIS CLASS.", exception)
87  }
88  virtual void sAddProp(int code, int x, int y);
89  virtual int sGetPropChiBin(double p);
90  virtual void pConstructMaxPropensities();
91 
92  private:
93 
94  // ATTRIBUTES:
95  string TOR_PARAM_FILE; // File with prop torsion angles
96  int amino_count[AminoAcid_CODE_SIZE];
97  // total number of entries for all amino acids
98  vector<vector<vector<int>* >* > propensities; // the propensities table.
99  vector<vector<int>* > all_propensities; // the sum of propropensities table.
100  int CHI_RANGE;
101  double total;
102  vector<double> amino_max_propensities; //vector with max amino propensities
103  // according to knowledge.
104 
105  };
106 
107  // ---------------------------------------------------------------------------
108  // Chi1Chi2
109  // -----------------x-------------------x-------------------x-----------------
110 }} // namespace
111 #endif //_CHI1CHI2_H_
112 
113 
class manages the angle qualities and the energy
Definition: Chi1Chi2.h:41
It mplements a simple amino acid.
Definition: AminoAcid.h:43
This class implements a simple torsion potential based on the statistical preference of aminoacid typ...
Definition: TorsionPotential.h:40
Implements a "Spacer" for a protein chain. Includes methods to obtain values from the atoms and its p...
Definition: Spacer.h:42