BALL  1.5.0
bindingPocketProcessor.h
Go to the documentation of this file.
1 #ifndef BALL_STRUCTURE_BINDINGPOCKETPROCESSOR_H
2 #define BALL_STRUCTURE_BINDINGPOCKETPROCESSOR_H
3 
4 #ifndef BALL_CONCEPT_PROCESSOR_H
5 # include <BALL/CONCEPT/processor.h>
6 #endif
7 
8 #ifndef BALL_KERNEL_RESIDUE_H
9 # include <BALL/KERNEL/residue.h>
10 #endif
11 
12 #ifndef BALL_MATHS_VECTOR3_H
13 # include <BALL/MATHS/vector3.h>
14 #endif
15 
16 #ifndef BALL_KERNEL_SYSTEM_H
17 # include <BALL/KERNEL/system.h>
18 #endif
19 
20 #ifndef BALL_DATATYPE_HASHGRID_H
21 # include <BALL/DATATYPE/hashGrid.h>
22 #endif
23 
24 #ifndef BALL_DATATYPE_OPTIONS_H
25 # include <BALL/DATATYPE/options.h>
26 #endif
27 
28 #include <vector>
29 #include <string>
30 
31 #include <fstream>
32 
33 namespace BALL
34 {
35 
41  : public UnaryProcessor<Composite>
42  {
43 
44  public:
45 
48  struct Option
49  {
51  static const String HEAVY_ONLY;
53  static const String PARSE_INI_FILE;
55  static const String INI_FILE_NAME;
56 
58  static const String RADIUS_HYDROGEN;
59  static const String RADIUS_OXYGEN;
60  static const String RADIUS_NITROGEN;
61  static const String RADIUS_CARBON;
62  static const String RADIUS_SULFUR;
63 
69  static const String PROBE_LAYER_RADIUS;
77  static const String PW_SQUARE_WELL;
78  static const String PW_GAUSSIAN_WIDTH;
79  static const String PW_MAX_DISTANCE;
81  static const String MAX_ASPS;
82  // additional factor for the computation of the collision of two spheres
83  static const String CLASH_FACTOR;
85  static const String ASP_SEPERATION;
86  };
87 
90  struct Default
91  {
92  static const bool HEAVY_ONLY;
93  static const bool PARSE_INI_FILE;
94  static const String INI_FILE_NAME;
95 
96  static const double RADIUS_HYDROGEN;
97  static const double RADIUS_OXYGEN;
98  static const double RADIUS_NITROGEN;
99  static const double RADIUS_CARBON;
100  static const double RADIUS_SULFUR;
101 
102  static const double PROBE_SPHERE_RADIUS;
104  static const double PROBE_LAYER_RADIUS;
107  static const double BURIAL_COUNT_RADIUS;
108  static const double PW_SQUARE_WELL;
109  static const double PW_GAUSSIAN_WIDTH;
110  static const double PW_MAX_DISTANCE;
111  static const Position MAX_ASPS;
112  static const double CLASH_FACTOR;
113  static const double ASP_SEPERATION;
114  };
115 
119 
122  BindingPocketProcessor(Options& new_options);
123 
127 
130  virtual ~BindingPocketProcessor();
131 
134  const BindingPocketProcessor& operator=(const BindingPocketProcessor& pp);
135 
137  virtual bool finish();
138 
139  virtual Processor::Result operator() (Composite &composite);
140 
143  const vector<std::pair<Vector3,double> >& getActiveSitePoints() const;
144 
147  const vector<vector<std::pair<Vector3,double> > >& getLayers() const;
148 
152 
153  private:
154 
158  class Sphere_
159  {
160  public:
162  Sphere_();
163 
166  BALL::Vector3 position;
167 
170  float radius;
171 
174  Position b_count;
175 
178  float probe_weight;
179 
182  Position layer;
183 
186  inline bool operator<(const Sphere_& sp) const {return probe_weight > sp.probe_weight;};
187 
190  int id;
191  static int global_id;
192  Position a,b,c,d;
193 
196  inline bool operator==(const Sphere_& sp) const {return a == sp.a && b == sp.b && c == sp.c && d == sp.d;};
197  };
198 
201  class SphereComparator_
202  {
203  public:
204  int operator()(const Sphere_& sp1, const Sphere_& sp2) const
205  {
206  if (sp1.a != sp2.a)
207  return sp1.a < sp2.a;
208  if (sp1.b != sp2.b)
209  return sp1.b < sp2.b;
210  if (sp1.c != sp2.c)
211  return sp1.c < sp2.c;
212  if (sp1.d != sp2.d)
213  return sp1.d < sp2.d;
214  return 0;
215  };
216  };
217 
220  Position layer_;
221 
225  friend std::ostream& operator<<(std::ostream& os, const BindingPocketProcessor::Sphere_& /*sp*/) {return os;};
226 
229  HashGrid3<Sphere_> sphere_grid_;
230 
233  HashGrid3<Sphere_> protein_grid_;
234 
237  HashGrid3<Sphere_> layer_grid_;
238 
241  HashGrid3<Sphere_> clayer_grid_;
242 
245  HashGrid3<Sphere_> BC_grid_;
246 
249  HashGrid3<Sphere_> pw_grid_;
250 
253  HashGrid3<Sphere_> candidates_grid_;
254 
255  std::vector<Sphere_> sorted_spheres_;
256 
259  double sphere_rad_;
260 
263  double second_layer_rad_;
264 
267  double protein_clash_rad_;
268 
271  double BC_threshold_;
272 
275  Position found_new_;
276 
277  double c_factor_;
278 
281  std::vector<Sphere_> candidates;
282 
283  std::vector<std::pair<Vector3,double> > asps_;
284 
285  std::vector<std::vector<std::pair<Vector3,double> > > layers_;
286 
293  double radius_(const String& element);
294 
297  void trySphere__(HashGridBox3<Sphere_>::DataIterator data_it,
300 
303  void addSphere_s_();
304 
307  Vector3 calculateT_(HashGridBox3<Sphere_>::DataIterator data_it,
309 
312  void testFirst_(HashGrid3<Sphere_>& hg,HashGridBox3<Sphere_>::DataIterator data_it,
313  Position x, Position y, Position z);
314 
315  void testSecond_(HashGrid3<Sphere_>& hg,HashGridBox3<Sphere_>::DataIterator data_it,
317  Position x, Position y, Position z,Position step);
318 
321  bool testSphereClash_(Vector3& v);
322 
325  bool testProteinClash_(Vector3& v);
326 
329  bool testBC_(Sphere_& sp);
330 
333  void weedCandidates_();
334 
337  bool parse_();
338 
339 
340  bool second_it_;
341 
342  };
343 
344 } //namesspace BALL
345 
346 #endif // BALL_STRUCTURE_BINDINGPOCKETPROCESSOR_H
BALL::BindingPocketProcessor::Option::PW_MAX_DISTANCE
static const String PW_MAX_DISTANCE
Definition: bindingPocketProcessor.h:79
BALL::BindingPocketProcessor::Default::PW_GAUSSIAN_WIDTH
static const double PW_GAUSSIAN_WIDTH
Definition: bindingPocketProcessor.h:109
BALL::BindingPocketProcessor::Option::PROBE_SPHERE_RADIUS
static const String PROBE_SPHERE_RADIUS
probe sphere radius for computation with hydrogen atoms
Definition: bindingPocketProcessor.h:65
BALL::BindingPocketProcessor::Option::RADIUS_OXYGEN
static const String RADIUS_OXYGEN
Definition: bindingPocketProcessor.h:59
BALL::BindingPocketProcessor::Default::BURIAL_COUNT_THRESHOLD
static const Position BURIAL_COUNT_THRESHOLD
Definition: bindingPocketProcessor.h:105
BALL::Options
Definition: options.h:46
BALL::BindingPocketProcessor::Default::PARSE_INI_FILE
static const bool PARSE_INI_FILE
Definition: bindingPocketProcessor.h:93
BALL::BindingPocketProcessor::Default::PROBE_SPHERE_RADIUS_HYDROGEN_FREE
static const double PROBE_SPHERE_RADIUS_HYDROGEN_FREE
Definition: bindingPocketProcessor.h:103
BALL::BindingPocketProcessor::Default::CLASH_FACTOR
static const double CLASH_FACTOR
Definition: bindingPocketProcessor.h:112
BALL::BindingPocketProcessor::Default::INI_FILE_NAME
static const String INI_FILE_NAME
Definition: bindingPocketProcessor.h:94
BALL::BindingPocketProcessor::Default::HEAVY_ONLY
static const bool HEAVY_ONLY
Definition: bindingPocketProcessor.h:92
BALL::BindingPocketProcessor::Option::HEAVY_ONLY
static const String HEAVY_ONLY
use only heavy atoms for computation
Definition: bindingPocketProcessor.h:51
BALL::BindingPocketProcessor::Option::PROBE_SPHERE_RADIUS_HYDROGEN_FREE
static const String PROBE_SPHERE_RADIUS_HYDROGEN_FREE
probe sphere radius for heavy atoms only
Definition: bindingPocketProcessor.h:67
BALL::BindingPocketProcessor::Option::BURIAL_COUNT_RADIUS
static const String BURIAL_COUNT_RADIUS
radius for the computation of the burial count
Definition: bindingPocketProcessor.h:75
BALL::BindingPocketProcessor::Option::PARSE_INI_FILE
static const String PARSE_INI_FILE
try to parse ini-file
Definition: bindingPocketProcessor.h:53
vector3.h
BALL::operator<
BALL_EXPORT bool operator<(const String &s1, const String &s2)
BALL::BindingPocketProcessor::Default::BURIAL_COUNT_THRESHOLD_HYDROGEN_FREE
static const Position BURIAL_COUNT_THRESHOLD_HYDROGEN_FREE
Definition: bindingPocketProcessor.h:106
BALL::Position
BALL_SIZE_TYPE Position
Definition: COMMON/global.h:140
BALL::BindingPocketProcessor::Option::BURIAL_COUNT_THRESHOLD_HYDROGEN_FREE
static const String BURIAL_COUNT_THRESHOLD_HYDROGEN_FREE
burial count threshold for heavy atoms only
Definition: bindingPocketProcessor.h:73
BALL::BindingPocketProcessor::Default::PW_SQUARE_WELL
static const double PW_SQUARE_WELL
Definition: bindingPocketProcessor.h:108
BALL::BindingPocketProcessor::Option::ASP_SEPERATION
static const String ASP_SEPERATION
minumum distance between two active site points
Definition: bindingPocketProcessor.h:85
BALL::String
Definition: string.h:56
BALL::HashGridBox3
Definition: hashGrid.h:54
BALL::BindingPocketProcessor::Option::INI_FILE_NAME
static const String INI_FILE_NAME
name of the ini-file
Definition: bindingPocketProcessor.h:55
BALL::BindingPocketProcessor::Default::MAX_ASPS
static const Position MAX_ASPS
Definition: bindingPocketProcessor.h:111
BALL
Definition: constants.h:12
BALL::BindingPocketProcessor::operator<<
friend std::ostream & operator<<(std::ostream &os, const BindingPocketProcessor::Sphere_ &)
Definition: bindingPocketProcessor.h:225
BALL::BindingPocketProcessor::Option
Definition: bindingPocketProcessor.h:48
options.h
BALL::BindingPocketProcessor::Default::BURIAL_COUNT_RADIUS
static const double BURIAL_COUNT_RADIUS
Definition: bindingPocketProcessor.h:107
hashGrid.h
BALL::BindingPocketProcessor::Option::RADIUS_CARBON
static const String RADIUS_CARBON
Definition: bindingPocketProcessor.h:61
BALL::BindingPocketProcessor::Option::MAX_ASPS
static const String MAX_ASPS
maximum number of active site points
Definition: bindingPocketProcessor.h:81
BALL::Composite
Definition: composite.h:71
BALL::BindingPocketProcessor::Default::RADIUS_HYDROGEN
static const double RADIUS_HYDROGEN
Definition: bindingPocketProcessor.h:96
BALL_SIZE_TYPE
BALL::UnaryProcessor
Definition: processor.h:58
BALL::TVector3< float >
BALL::Constants::c
const BALL_EXTERN_VARIABLE double c
Definition: constants.h:149
BALL::BindingPocketProcessor::Option::RADIUS_SULFUR
static const String RADIUS_SULFUR
Definition: bindingPocketProcessor.h:62
BALL::BindingPocketProcessor::Default::PROBE_LAYER_RADIUS
static const double PROBE_LAYER_RADIUS
Definition: bindingPocketProcessor.h:104
processor.h
BALL::BindingPocketProcessor::options
Options options
Definition: bindingPocketProcessor.h:151
BALL::BindingPocketProcessor::Option::RADIUS_NITROGEN
static const String RADIUS_NITROGEN
Definition: bindingPocketProcessor.h:60
BALL::BindingPocketProcessor::Default::ASP_SEPERATION
static const double ASP_SEPERATION
Definition: bindingPocketProcessor.h:113
BALL::BindingPocketProcessor::Option::CLASH_FACTOR
static const String CLASH_FACTOR
Definition: bindingPocketProcessor.h:83
BALL::operator==
BALL_EXPORT bool operator==(const String &s1, const String &s2)
BALL::BindingPocketProcessor::Default::RADIUS_SULFUR
static const double RADIUS_SULFUR
Definition: bindingPocketProcessor.h:100
BALL::BindingPocketProcessor::Default::RADIUS_CARBON
static const double RADIUS_CARBON
Definition: bindingPocketProcessor.h:99
BALL::BindingPocketProcessor::Option::BURIAL_COUNT_THRESHOLD
static const String BURIAL_COUNT_THRESHOLD
burial count threshold for computation with hydrogen atoms
Definition: bindingPocketProcessor.h:71
residue.h
BALL::BindingPocketProcessor::Default::PROBE_SPHERE_RADIUS
static const double PROBE_SPHERE_RADIUS
Definition: bindingPocketProcessor.h:102
BALL::BindingPocketProcessor::Default::RADIUS_NITROGEN
static const double RADIUS_NITROGEN
Definition: bindingPocketProcessor.h:98
BALL::BindingPocketProcessor::Default
Definition: bindingPocketProcessor.h:90
BALL::BindingPocketProcessor::Default::PW_MAX_DISTANCE
static const double PW_MAX_DISTANCE
Definition: bindingPocketProcessor.h:110
BALL::BindingPocketProcessor::Option::PW_SQUARE_WELL
static const String PW_SQUARE_WELL
options for the computation of the probe weight
Definition: bindingPocketProcessor.h:77
BALL::Processor::Result
int Result
Definition: processor.h:36
BALL::BindingPocketProcessor
Definition: bindingPocketProcessor.h:40
BALL::BindingPocketProcessor::Default::RADIUS_OXYGEN
static const double RADIUS_OXYGEN
Definition: bindingPocketProcessor.h:97
BALL_EXPORT
#define BALL_EXPORT
Definition: COMMON/global.h:50
BALL::HashGrid3< Sphere_ >
system.h
BALL::BindingPocketProcessor::Option::RADIUS_HYDROGEN
static const String RADIUS_HYDROGEN
atom radius of individual elements
Definition: bindingPocketProcessor.h:58
BALL::BindingPocketProcessor::Option::PROBE_LAYER_RADIUS
static const String PROBE_LAYER_RADIUS
probe radius for colision of probes in one layer
Definition: bindingPocketProcessor.h:69
BALL::BindingPocketProcessor::Option::PW_GAUSSIAN_WIDTH
static const String PW_GAUSSIAN_WIDTH
Definition: bindingPocketProcessor.h:78