BALL  1.4.79
 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  struct BALL_EXPORT Option
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 
183  {
192  };
193 
195 
198 
200  HBondProcessor();
201 
203  HBondProcessor(Options& new_options);
204 
206  virtual ~HBondProcessor();
207 
209 
210 
213 
216  virtual void init();
217 
220  virtual bool start();
221 
223  // computes the theoretical position of H
224  // and stores the residue information in residue_data_
225  //
227  virtual Processor::Result operator() (Composite &composite);
228 
230  // to the chosen method <tt> PredictionMethod</tt>.
231  virtual bool finish();
232 
234 
238 
240  const std::vector< HBond>& getHBonds() const {return h_bonds_;}
241 
243  std::vector< HBond> getHBonds() {return h_bonds_;}
244 
246  BALL_DEPRECATED const std::vector< std::vector<Position> >& getBackboneHBondPairs() const;
247 
249  const std::vector< std::vector<Position> >& getBackboneHBondPattern() const;
250 
252  const std::vector<ResidueData>& getResidueData() const;
253 
255 
259  Options options;
261 
264  void setDefaultOptions();
266 
267  protected:
268 
269  void preComputeBonds_(ResidueIterator& data);
270  bool finishKabschSander_();
271  bool finishWishartEtAl_();
272 
273 
277 
278  //_ lower point of the grid
280  //_ upper point of the grid
282 
283  //_ the atom positions and an accending number per residue
284  std::vector<ResidueData> residue_data_;
285 
286  //_ the backbone hydrogen bonds for the secondary structure processor
287  std::vector<std::vector<Position> > backbone_h_bond_pairs_;
289 
290 
291 
295 
296  /*_ list of __ShiftX__ HBond donors collected by <tt>operator ()</tt>
297  */
298  std::vector<Atom*> donors_;
299 
300  /*_ list of HBond acceptors collected by <tt>operator ()</tt>
301  */
302  std::vector<Atom*> acceptors_;
303 
304  std::map< Residue*, Position> residue_ptr_to_position_;
306 
310 
312  std::vector<HBond> h_bonds_;
314 
315  }; //class HBondProcessor
316 } //namesspace BALL
317 
318 
319 #endif // BALL_STRUCTURE_HBONDPROCESSOR_H
static float MAX_LENGTH
static const String KABSCH_SANDER_ENERGY_CUTOFF
HBond(Atom const *acceptor, Atom const *donor, bool donor_is_hydrogen=false)
std::map< Residue *, Position > residue_ptr_to_position_
#define BALL_CREATE(name)
Definition: create.h:62
std::vector< HBond > h_bonds_
store HBond
static const String PREDICTION_METHOD
static const float KABSCH_SANDER_ENERGY_CUTOFF
std::vector< Atom * > donors_
static const String PREDICTION_METHOD
std::vector< Atom * > acceptors_
#define BALL_DEPRECATED
Definition: COMMON/global.h:66
static float ALPHA_PROTON_OXYGEN_SEPARATION_DISTANCE
static float BOND_LENGTH_C_O
bool is_complete
sometimes there are defect residues around...
static const String ADD_HBONDS
Computation of hydrogen bonds from topology information.
std::vector< HBond > getHBonds()
Default values for options.
Mutable bidirectional iterator.
std::vector< ResidueData > residue_data_
const std::vector< HBond > & getHBonds() const
static float AMIDE_PROTON_OXYGEN_SEPARATION_DISTANCE
Default values for options.
static float BOND_LENGTH_N_H
std::vector< std::vector< Position > > backbone_h_bond_pairs_
bool donorIsHydrogen()
Return flag indicating what HBond definition was used.
#define BALL_EXPORT
Definition: COMMON/global.h:50
float getLength()
Return distance between donor and acceptor.