Victor
 All Data Structures Functions Variables Friends Pages
PhiPsi.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 _PHIPSI_H_
19 #define _PHIPSI_H_
20 
21 
22 // Includes:
23 #include <vector>
24 #include <Spacer.h>
25 #include <AminoAcidCode.h>
26 #include <TorsionPotential.h>
27 
28 // Global constants, typedefs, etc. (to avoid):
29 
30 using namespace Victor::Biopool;
31 using namespace Victor::Energy;
32 using namespace Victor;
33  namespace Victor { namespace Energy {
34 
41  class PhiPsi : public TorsionPotential {
42  public:
43 
44  // CONSTRUCTORS/DESTRUCTOR:
45  PhiPsi(int SET_ARC1 = 10,
46  string knownledge = "data/tor.par"); //default knownledge TOP500
47 
48  virtual ~PhiPsi() {
49  PRINT_NAME;
50  }
51 
52  // PREDICATES:
53  virtual long double calculateEnergy(Spacer& sp);
54  virtual long double calculateEnergy(Spacer& sp, unsigned int index1,
55  unsigned int index2);
56  virtual long double calculateEnergySmooth(AminoAcid& aa);
57  virtual long double calculateEnergy(AminoAcid& aa);
58  virtual long double calculateEnergy(AminoAcid& aa, double phi, double psi);
59 
60  virtual long double calculateEnergy(AminoAcid& aa, Spacer& sp) {
61  return calculateEnergy(aa);
62  }
63  virtual long double calculateEnergy(AminoAcid& diheds, AminoAcidCode code);
64  virtual double pReturnMaxPropensities(int amino);
65  virtual double pReturnMinPropensities(int amino);
66  int sGetPropBinDiff(double p, double& diff);
67 
68  string getLabel() {
69  return "phi-psi";
70  }
71 
72  // MODIFIERS:
73  virtual void setArcStep(int n);
74 
75  int getArcStep() {
76  return ARC_STEP;
77  }
78  // OPERATORS:
79  int getPhiPsiIndexTable(double angle);
80  int getPropensity(AminoAcidCode aa, int phi, int psi);
81  double getEnergyFromPhiPsi(AminoAcidCode code, double phi, double psi);
82 
83  protected:
84 
85  // HELPERS:
86  virtual void pConstructData();
87  virtual void pResetData();
88  virtual double pGetMaxPropensities(int amino);
89  virtual double pGetMinPropensities(int amino);
90  int sGetPropBin(double p);
91  void sAddProp(int code, int x, int y);
92  virtual void pConstructMaxPropensities();
93  virtual void pConstructMinPropensities();
94 
95 
96  // ATTRIBUTES:
97 
98  string TOR_PARAM_FILE; // File with prop torsion angles
99  int ARC_STEP; // important: must be a divisior of 360 !!!!
100  int SIZE_OF_TABLE; // "granularity" props.
101  int amino_count[AminoAcid_CODE_SIZE]; //number of amino.
102  vector<vector<vector<int>* >* > propensities; // the propensities table.
103  vector<vector<int>* > all_propensities; // the sum of propropensities table.
104  double total; //total numer of ammino considered.
105  vector<double> amino_max_propensities; //vector with max amino propensities
106  // according to knowledge.
107  vector<double> amino_min_propensities; //vector with min amino propensities
108  // according to knowledge.
109 
110  private:
111 
112  };
113 
114  // ---------------------------------------------------------------------------
115  // PhiPsi
116 
117 }} // namespace
118 #endif// _PHIPSI_H_
119 
120 
121 
122 
123 
124 
class manages the angle qualities and the energy
Definition: PhiPsi.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