BALL  1.4.79
gridBasedScoring.h
Go to the documentation of this file.
1 /* gridBasedScoring.h
2 *
3 * Copyright (C) 2011 Marcel Schumann
4 *
5 * This program free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 // ----------------------------------------------------
20 // $Maintainer: Marcel Schumann $
21 // $Authors: Marcel Schumann $
22 // ----------------------------------------------------
23 
24 #ifndef BALL_SCORING_COMMON_GRIDBASEDSCORING_H
25 #define BALL_SCORING_COMMON_GRIDBASEDSCORING_H
26 
30 #include <set>
31 #include <map>
32 
33 namespace BALL
34 {
35  class ScoreGridSet;
36  class Residue;
37  class Rotamer;
38 
40  {
41  public:
42  struct Option
43  {
45  static const char* SCOREGRID_RESOLUTION;
46 
48  static const char* SCOREGRID_INTERPOLATION;
49  };
50 
51  struct Default
52  {
53  static double SCOREGRID_RESOLUTION;
55  };
56 
57  GridBasedScoring(AtomContainer& receptor, AtomContainer& ligand, Options& options);
58 
59  GridBasedScoring(AtomContainer& receptor, Vector3& hashgrid_origin, Options& options);
60 
61  virtual ~GridBasedScoring();
62 
66  void defineGridSet(AtomContainer* sys, Vector3& angstroem, double out_of_grid_penalty, bool enforce_grid_boundaries, double resolution, double interaction_no_scale = 1);
67 
70  void defineGridSet(AtomContainer* sys, double out_of_grid_penalty, bool enforce_grid_boundaries, double resolution, double interaction_no_scale = 1);
71 
72  void defineFlexibleResiduesGridSet();
73 
74  void printResult();
75 
77  void setAtomTypeNames(std::set<String>& types);
78 
80  void precalculateGrids(bool ony_flexRes_grids = false);
81 
83  void saveGridSetsToFile(String file, String receptor_name);
84 
86  void readAdditionalGridSetFromFile(String file);
87 
89  void replaceGridSetFromFile(String file);
90 
93  void loadFlexibleResidueScoreGrids(std::list<std::pair<const Residue*, const Rotamer*> > residue_list);
94 
95  void setupReferenceLigand();
96 
102  void setCombineOperation(int i);
103 
105  int getNoNeighboringReceptorAtoms();
106 
107  std::vector<ScoreGridSet*>* getScoreGridSets();
108 
109  void validateGridSets();
110 
111  protected:
112  void setup();
113 
115  {
117  std::vector<double> gridSet_scores;
118 
120  std::vector<double> no_neighbors;
121 
123  std::vector<Size> no_out_of_grid;
124 
125  void setup(Size no_gridSets);
126  };
127 
130 
132  double calculateGridScore();
133 
137  void defineReceptorGridSet(Vector3& origin, Vector3& size, double out_of_grid_penalty, bool enforce_grid_boundaries, double resolution = 0.5, double interaction_no_scale = 1);
138 
139  virtual AtomTypes& getAtomTypes() = 0;
140 
141  std::map<String, int>* getAtomTypesMap();
142 
145  virtual void setAtomType(Atom* atom, const String& type_name);
146 
148  String getGridAtomTypeName(int grid_id);
149 
150  /* --------- protected members ------------------ */
153 
155  std::map<String, int> atom_types_map_;
156 
158  std::vector<BALL::ScoreGridSet*> grid_sets_;
159 
162  virtual void updatePrecalculatedScore(Size set) = 0;
163 
166 
169 
172 
175  std::map<const Residue*, ScoreGridSet*> flex_gridsets_;
176 
177  friend class ScoreGridSet;
179  };
180 }
181 
182 #endif // BALL_SCORING_COMMON_GRIDBASEDSCORING_H
std::map< const Residue *, ScoreGridSet * > flex_gridsets_
static const char * SCOREGRID_INTERPOLATION
std::vector< BALL::ScoreGridSet * > grid_sets_
std::map< String, int > atom_types_map_
-*- Mode: C++; tab-width: 2; -*-
Definition: constants.h:12
GridSetsResult gridsets_result_
static const char * SCOREGRID_RESOLUTION
#define BALL_EXPORT
Definition: COMMON/global.h:50