BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HBondProcessor.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_STRUCTURE_HBONDPROCESSOR_H
6 #define BALL_STRUCTURE_HBONDPROCESSOR_H
7 
8 #ifndef BALL_CONCEPT_PROCESSOR_H
10 #endif
11 
12 #ifndef BALL_KERNEL_RESIDUE_H
13 #include <BALL/KERNEL/residue.h>
14 #endif
15 
16 #ifndef BALL_MATHS_VECTOR3_H
17 #include <BALL/MATHS/vector3.h>
18 #endif
19 
20 #ifndef BALL_DATATYPE_OPTIONS_H
21  #include <BALL/DATATYPE/options.h>
22 #endif
23 
24 #include <vector>
25 #include <map>
26 
27 namespace BALL
28 {
99  : public UnaryProcessor<Composite>
100  {
101 
102  public:
103 
107 
111  {
112  public:
113  HBond();
114  HBond(Atom const* acceptor, Atom const* donor, bool donor_is_hydrogen=false)
115  {acceptor_ = acceptor; donor_ = donor; donor_is_hydrogen_ = donor_is_hydrogen;}
116  Atom const* getAcceptor() { return acceptor_; }
117  Atom const* getDonor() { return donor_; }
118 
120  bool donorIsHydrogen() { return donor_is_hydrogen_; }
121 
123  float getLength() { return acceptor_->getDistance(*donor_); }
124 
125  // TODO: getAngle()? This is tricky as the DSSP works with implicit hydrogen positions
126 
127  protected:
128  Atom const* acceptor_;
129  Atom const* donor_;
131  };
133 
137 
139  {
142  static const String PREDICTION_METHOD;
143 
146  static const String ADD_HBONDS;
147 
151  };
152 
155  {
156  static const String PREDICTION_METHOD;
157  static const bool ADD_HBONDS;
158  static const float KABSCH_SANDER_ENERGY_CUTOFF;
159  };
160 
163  {
164  static const String KABSCH_SANDER;
165  static const String WISHART_ET_AL;
166  };
167 
168  // constants for Kabsch Sander
169  // 5.2 Angstrom is the maximum distance between N and O in a hydrogen bond.
170  // 4.2 Angstrom is an upper bound for the distance between N and O in the same
171  // residue. Therefore, if two residues are farther apart than MAX_LENGTH, N and O
172  // are farther apart than 5.2 Angstroms and there will be no hydrogen bond.
173  static float MAX_LENGTH;
174  static float BOND_LENGTH_N_H;
175  static float BOND_LENGTH_C_O;
176 
177  // constants for Wishard et al
179  static float ALPHA_PROTON_OXYGEN_SEPARATION_DISTANCE; // = 2.77208;
180 
181 
184  {
192  bool is_complete;
193  };
194 
196 
199 
201  HBondProcessor();
202 
204  HBondProcessor(Options& new_options);
205 
207  virtual ~HBondProcessor();
208 
210 
211 
214 
217  virtual void init();
218 
221  virtual bool start();
222 
224  // computes the theoretical position of H
225  // and stores the residue information in residue_data_
226  //
228  virtual Processor::Result operator() (Composite &composite);
229 
231  // to the chosen method <tt> PredictionMethod</tt>.
232  virtual bool finish();
233 
235 
239 
241  const std::vector< HBond>& getHBonds() const {return h_bonds_;}
242 
244  std::vector< HBond> getHBonds() {return h_bonds_;}
245 
247  BALL_DEPRECATED const std::vector< std::vector<Position> >& getBackboneHBondPairs() const;
248 
250  const std::vector< std::vector<Position> >& getBackboneHBondPattern() const;
251 
253  const std::vector<ResidueData>& getResidueData() const;
254 
256 
260 
262 
265  void setDefaultOptions();
267 
268  protected:
269 
270  void preComputeBonds_(ResidueIterator& data);
271  bool finishKabschSander_();
272  bool finishWishartEtAl_();
273 
274 
278 
279  //_ lower point of the grid
281  //_ upper point of the grid
283 
284  //_ the atom positions and an accending number per residue
285  std::vector<ResidueData> residue_data_;
286 
287  //_ the backbone hydrogen bonds for the secondary structure processor
288  std::vector<std::vector<Position> > backbone_h_bond_pairs_;
290 
291 
292 
296 
297  /*_ list of __ShiftX__ HBond donors collected by <tt>operator ()</tt>
298  */
299  std::vector<Atom*> donors_;
300 
301  /*_ list of HBond acceptors collected by <tt>operator ()</tt>
302  */
303  std::vector<Atom*> acceptors_;
304 
305  std::map< Residue*, Position> residue_ptr_to_position_;
307 
311 
313  std::vector<HBond> h_bonds_;
315 
316  }; //class HBondProcessor
317 } //namesspace BALL
318 
319 
320 #endif // BALL_STRUCTURE_HBONDPROCESSOR_H