Victor
 All Data Structures Functions Variables Friends Pages
SolvationPotential.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 
19 
20 #ifndef _SOLVATIONPOTENTIAL_H_
21 #define _SOLVATIONPOTENTIAL_H_
22 
23 // Includes:
24 #include <vector>
25 #include <Spacer.h>
26 #include <Potential.h>
27 
28 // Global constants, typedefs, etc. (to avoid):
29 const double SOLVATION_CUTOFF_DISTANCE = 10.0;
30 
31 using namespace Victor;
32 namespace Victor { namespace Energy {
33 
34 
44  class SolvationPotential : public Potential {
45  public:
46 
47  // CONSTRUCTORS/DESTRUCTOR:
48  SolvationPotential(unsigned int _resol = 1);
49 
50  virtual ~SolvationPotential() {
51  PRINT_NAME;
52  }
53 
54  // PREDICATES:
55 
56  virtual long double calculateEnergy(Spacer& sp) {
57  return calculateSolvation(sp);
58  }
59  virtual long double calculateEnergy(Spacer& sp, unsigned int index1,
60  unsigned int index2);
61 
62  virtual long double calculateEnergy(AminoAcid& aa, Spacer& sp) {
63  return calculateSolvation(aa, sp);
64  }
65 
66  virtual long double calculateEnergy(
67  AminoAcid& resid, AminoAcidCode type, Spacer& sp) {
68  return calculateSolvation(resid, type, sp);
69  }
70  long double calculateSolvation(Spacer& sp);
71  long double calculateSolvation(AminoAcid& aa, Spacer& sp,
72  unsigned int start = 0, unsigned int end = 9999);
73  long double calculateSolvation(AminoAcid& resid, AminoAcidCode type,
74  Spacer& sp);
75  long double pReturnMaxPropensity(const AminoAcidCode type) const;
76  long double pReturnMinPropensity(const AminoAcidCode type) const;
77 
78  // MODIFIERS:
79 
80  // OPERATORS:
81 
82  // HELPERS:
83 
84  static inline long double propCoeff() {
85  return 0.582;
86  }
87 
88  protected:
89 
90  private:
91 
92  // PREDICATES
93  long double pGetPropensity(const AminoAcidCode type,
94  unsigned int count) const;
95  long double pGetMaxPropensity(const AminoAcidCode type) const;
96  long double pGetMinPropensity(const AminoAcidCode type) const;
97 
98  // MODIFIERS
99  void pConstructMaxPropensities();
100  void pConstructMinPropensities();
101 
102  // ATTRIBUTES:
103  vector<vector<int> > sum;
104 
105  unsigned int binResolution;
106 
107  /* maximum and minimum propensities extracted from the solvation database
108  file. The i-th element of each vector refers to the i-th amino acid type
109  declared in the AminoAcidCode enumeration (i=0,...,19). */
110  //ALA=0,CYS,ASP,GLU,PHE,GLY,HIS,ILE,LYS,LEU,MET,ASN,PRO,GLN,ARG,SER,THR,VAL,TRP,TYR
111  // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
112  vector<long double> amino_max_propensities;
113  vector<long double> amino_min_propensities;
114  static unsigned int MAX_BINS;
115  static string SOLV_PARAM_FILE;
116 
117 
118  };
119 
120  // ---------------------------------------------------------------------------
121  // SolvationPotential
122  // -----------------x-------------------x-------------------x-----------------
123 
129  inline long double SolvationPotential::pReturnMaxPropensity(const AminoAcidCode type) const {
130  return amino_max_propensities[type];
131  }
132 
138  inline long double SolvationPotential::pReturnMinPropensity(const AminoAcidCode type) const {
139  return amino_min_propensities[type];
140  }
141 
142 
143 }} // namespace
144 #endif //_SOLVATIONPOTENTIAL_H_
Includes methods that allow to calculate solvation, energy and propensity.
Definition: SolvationPotential.h:44
SolvationPotential(unsigned int _resol=1)
Definition: SolvationPotential.cc:37
long double calculateSolvation(Spacer &sp)
Definition: SolvationPotential.cc:87
Abstract class for the energy potential.
Definition: Potential.h:37
long double pReturnMinPropensity(const AminoAcidCode type) const
Definition: SolvationPotential.h:138
long double pReturnMaxPropensity(const AminoAcidCode type) const
Definition: SolvationPotential.h:129
It mplements a simple amino acid.
Definition: AminoAcid.h:43
Implements a "Spacer" for a protein chain. Includes methods to obtain values from the atoms and its p...
Definition: Spacer.h:42