00001
00002
00003
00004
00005 #ifndef BALL_STRUCTURE_HBONDPROCESSOR_H
00006 #define BALL_STRUCTURE_HBONDPROCESSOR_H
00007
00008 #ifndef BALL_CONCEPT_PROCESSOR_H
00009 #include <BALL/CONCEPT/processor.h>
00010 #endif
00011
00012 #ifndef BALL_KERNEL_RESIDUE_H
00013 #include <BALL/KERNEL/residue.h>
00014 #endif
00015
00016 #ifndef BALL_MATHS_VECTOR3_H
00017 #include <BALL/MATHS/vector3.h>
00018 #endif
00019
00020 #ifndef BALL_DATATYPE_OPTIONS_H
00021 #include <BALL/DATATYPE/options.h>
00022 #endif
00023
00024 #include <vector>
00025 #include <map>
00026
00027 namespace BALL
00028 {
00098 class BALL_EXPORT HBondProcessor
00099 : public UnaryProcessor<Composite>
00100 {
00101
00102 public:
00103
00107
00110 class BALL_EXPORT HBond
00111 {
00112 public:
00113 HBond();
00114 HBond(Atom const* acceptor, Atom const* donor, bool donor_is_hydrogen=false)
00115 {acceptor_ = acceptor; donor_ = donor; donor_is_hydrogen_ = donor_is_hydrogen;}
00116 Atom const* getAcceptor() { return acceptor_; }
00117 Atom const* getDonor() { return donor_; }
00118
00120 bool donorIsHydrogen() { return donor_is_hydrogen_; }
00121
00123 float getLength() { return acceptor_->getDistance(*donor_); }
00124
00125
00126
00127 protected:
00128 Atom const* acceptor_;
00129 Atom const* donor_;
00130 bool donor_is_hydrogen_;
00131 };
00133
00137
00138 struct BALL_EXPORT Option
00139 {
00142 static const String PREDICTION_METHOD;
00143
00146 static const String ADD_HBONDS;
00147
00150 static const String KABSCH_SANDER_ENERGY_CUTOFF;
00151 };
00152
00154 struct BALL_EXPORT Default
00155 {
00156 static const String PREDICTION_METHOD;
00157 static const bool ADD_HBONDS;
00158 static const float KABSCH_SANDER_ENERGY_CUTOFF;
00159 };
00160
00162 struct BALL_EXPORT PredictionMethod
00163 {
00164 static const String KABSCH_SANDER;
00165 static const String WISHART_ET_AL;
00166 };
00167
00168
00169
00170
00171
00172
00173 static float MAX_LENGTH;
00174 static float BOND_LENGTH_N_H;
00175 static float BOND_LENGTH_C_O;
00176
00177
00178 static float AMIDE_PROTON_OXYGEN_SEPARATION_DISTANCE;
00179 static float ALPHA_PROTON_OXYGEN_SEPARATION_DISTANCE;
00180
00181
00183 struct BALL_EXPORT ResidueData
00184 {
00185 Vector3 pos_C;
00186 Vector3 pos_N;
00187 Vector3 pos_H;
00188 Vector3 pos_O;
00189 Size number;
00190 Residue* res;
00192 bool is_complete;
00193 };
00194
00195 BALL_CREATE(HBondProcessor);
00196
00199
00201 HBondProcessor();
00202
00204 HBondProcessor(Options& new_options);
00205
00207 virtual ~HBondProcessor();
00208
00210
00211
00214
00217 virtual void init();
00218
00221 virtual bool start();
00222
00224
00225
00226
00228 virtual Processor::Result operator() (Composite &composite);
00229
00231
00232 virtual bool finish();
00233
00235
00239
00241 const std::vector< HBond>& getHBonds() const {return h_bonds_;}
00242
00244 std::vector< HBond> getHBonds() {return h_bonds_;}
00245
00247 const std::vector< std::vector<Position> >& getBackboneHBondPairs() const;
00248
00250 const std::vector<ResidueData>& getResidueData() const;
00251
00253
00257
00258 Options options;
00259
00262 void setDefaultOptions();
00264
00265 protected:
00266
00267 void preComputeBonds_(ResidueIterator& data);
00268 bool finishKabschSander_();
00269 bool finishWishartEtAl_();
00270
00271
00275
00276
00277 Vector3 upper_;
00278
00279 Vector3 lower_;
00280
00281
00282 std::vector<ResidueData> residue_data_;
00283
00284
00285 std::vector<std::vector<Position> > backbone_h_bond_pairs_;
00287
00288
00289
00293
00294
00295
00296 std::vector<Atom*> donors_;
00297
00298
00299
00300 std::vector<Atom*> acceptors_;
00301
00302 std::map< Residue*, Position> residue_ptr_to_position_;
00304
00308
00310 std::vector<HBond> h_bonds_;
00312
00313 };
00314 }
00315
00316
00317 #endif // BALL_STRUCTURE_HBONDPROCESSOR_H