00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef BALL_STRUCTURE_DOCKING_GEOMETRICFIT_H
00010 #define BALL_STRUCTURE_DOCKING_GEOMETRICFIT_H
00011
00012 #ifndef BALL_DATATYPE_REGULARDATA3D_H
00013 #include <BALL/DATATYPE/regularData3D.h>
00014 #endif
00015
00016 #ifndef BALL_KERNEL_SYSTEM_H
00017 #include <BALL/KERNEL/system.h>
00018 #endif
00019
00020 #ifndef BALL_MATHS_COMPLEX_H
00021 #include <BALL/MATHS/complex.h>
00022 #endif
00023
00024 #ifndef BALL_MATHS_FFT3D_H
00025 #include <BALL/MATHS/FFT3D.h>
00026 #endif
00027
00028 #ifndef BALL_STRUCTURE_DOCKING_DOCKINGALGORITHM_H
00029 #include <BALL/STRUCTURE/DOCKING/dockingAlgorithm.h>
00030 #endif
00031
00032 namespace BALL
00033 {
00040 class BALL_EXPORT GeometricFit : public DockingAlgorithm
00041 {
00042 public:
00043 BALL_CREATE(GeometricFit)
00044
00045
00050 struct BALL_EXPORT Option
00051 {
00052
00053
00054
00055
00056 static const String NEAR_RADIUS;
00057
00058
00059
00060 static const String GRID_SPACING;
00061
00062
00063 static const String GRID_SIZE;
00064
00065
00066
00067 static const String SURFACE_THICKNESS;
00068
00069
00070
00071
00072 static const String DEGREE_INTERVAL;
00073
00074
00075 static const String TOP_N;
00076
00083 static const String SURFACE_TYPE;
00084
00085
00086 static const String BEST_NUM;
00087
00088
00089 static const String VERBOSITY;
00090
00091
00092 static const String PHI_MIN;
00093 static const String PHI_MAX;
00094 static const String DEG_PHI;
00095
00096 static const String THETA_MIN;
00097 static const String THETA_MAX;
00098 static const String DEG_THETA;
00099
00100 static const String PSI_MIN;
00101 static const String PSI_MAX;
00102 static const String DEG_PSI;
00103
00104
00105
00106 static const String PENALTY_STATIC;
00107 static const String PENALTY_MOBILE;
00108
00109 };
00110
00111 struct BALL_EXPORT Default
00112 {
00113
00114
00115 static const float NEAR_RADIUS;
00116
00117
00118
00119 static const float GRID_SPACING;
00120
00121
00122 static const int GRID_SIZE;
00123
00124
00125
00126 static const float SURFACE_THICKNESS;
00127
00128
00129
00130
00131 static const double DEGREE_INTERVAL;
00132
00136 static const int SURFACE_TYPE;
00137
00138
00139 static const int TOP_N;
00140
00141
00142
00143 static const int BEST_NUM;
00144
00145
00146
00147
00148
00149 static const int VERBOSITY;
00150
00151
00152 static const float PHI_MIN;
00153 static const float PHI_MAX;
00154 static const float DEG_PHI;
00155
00156 static const float THETA_MIN;
00157 static const float THETA_MAX;
00158 static const float DEG_THETA;
00159
00160 static const float PSI_MIN;
00161 static const float PSI_MAX;
00162 static const float DEG_PSI;
00163
00164
00165
00166 static const int PENALTY_STATIC;
00167 static const int PENALTY_MOBILE;
00168 };
00169
00175 class BALL_EXPORT Peak_
00176 {
00177 public:
00178
00179
00180 Peak_() ;
00181
00182
00183 ~Peak_() ;
00184
00185
00186 bool operator < (const Peak_& p) const ;
00187
00188 double value;
00189 Vector3 orientation;
00190 Vector3 translation;
00191 };
00192
00193
00197 class BALL_EXPORT RotationAngles_
00198 {
00199 public:
00200
00201
00202 RotationAngles_() ;
00203
00204
00205 RotationAngles_( int step ) ;
00206
00207
00208 ~RotationAngles_() {};
00209
00210
00211
00212 bool generateSomeAngles( const float deg_phi, const float deg_psi, const float deg_theta,
00213 const float phi_min, const float phi_max,
00214 const float psi_min, const float psi_max,
00215 const float theta_min, const float theta_max ) ;
00216
00217
00218
00219 bool generateAllAngles( const int deg ) ;
00220
00221 int getRotationNum()
00222
00223 {
00224 return ang_num_;
00225 }
00226
00227 int getXAng( int n )
00228
00229 {
00230 return phi_[n];
00231 }
00232
00233 int getYAng( int n )
00234
00235 {
00236 return theta_[n];
00237 }
00238
00239 int getZAng( int n )
00240
00241 {
00242 return psi_[n];
00243 }
00244
00245 private:
00246 int max_rotation_;
00247 int ang_num_;
00248 vector<int> phi_;
00249 vector<int> theta_;
00250 vector<int> psi_;
00251 };
00252
00253
00254
00255 enum ProteinIndex{ PROTEIN_A = 1, PROTEIN_B = 2 };
00256
00257
00258 enum SurfaceType { CONNOLLY = 1, VAN_DER_WAALS = 2, FTDOCK = 3 };
00259
00260
00261
00262 GeometricFit()
00263 ;
00264
00270 GeometricFit(System &system1, System &system2)
00271 ;
00272
00277 GeometricFit(Options& new_options)
00278 ;
00279
00284 GeometricFit(System &system1,System &system2 ,Options& new_options)
00285 ;
00286
00287
00288
00289
00290
00291
00292
00293 ~GeometricFit() ;
00294
00297 virtual void setup(System& system1, System& system2, Options& new_options)
00298 ;
00299
00300 virtual void setup(System& system1, System& system2)
00301 ;
00302
00305 void start()
00306 ;
00307
00308
00309 float getProgress() const
00310 ;
00311
00312
00313 bool hasFinished() const
00314 ;
00315
00318 Vector3 getTranslation(Index con_num) const
00319 ;
00320
00323 Vector3 getOrientation(Index con_num) const
00324 ;
00325
00328 ConformationSet getConformationSet(Index total_number = 0)
00329 ;
00330
00332
00333
00336 Options options;
00337
00338 protected:
00339
00340
00341 void destroy_()
00342 ;
00343
00344
00345 void findInsidePoints_( System& system, ProteinIndex pro_idx )
00346 ;
00347
00348
00349 void findConnollySurfacePoints_( System& system, ProteinIndex pro_idx )
00350 ;
00351
00352
00353 void findVanDerWaalsSurfacePoints_( System& system, ProteinIndex pro_idx )
00354 ;
00355
00356
00357 void findFTDockInsidePoints_( System& system, ProteinIndex pro_idx )
00358 ;
00359
00360
00361 void findFTDockSurfacePoints_( System& system, ProteinIndex pro_idx )
00362 ;
00363
00366 Vector3 getMassCenter_( System& system )
00367 ;
00368
00371 float getRadius_( System& system )
00372 ;
00373
00374 void doPreTranslation_( ProteinIndex pro_idx )
00375 ;
00376
00377 void initGridSizes_()
00378 ;
00379
00385 int optimizeGridSize_( int raw_size )
00386 ;
00387
00390 void initFFTGrid_( ProteinIndex pro_idx )
00391 ;
00392
00393
00394 void makeFFTGrid_( ProteinIndex pro_idx )
00395 ;
00396
00397
00398 void getGlobalPeak_(Peak_* peak_list)
00399 ;
00400
00401
00402 void changeProteinOrientation_( System& system, Vector3 euler_ang )
00403 ;
00404
00405
00406 void calcConjugate_( ProteinIndex pro_idx )
00407 ;
00408
00409
00410 void FFTGridMulti_()
00411 ;
00412
00413
00414 Vector3 getTranslation_( const Vector3& mat_pos )
00415 ;
00416
00417 Vector3 getSeparation_( const Vector3& mat_pos )
00418 ;
00419
00420
00421
00422
00423
00424
00425
00426 FFT3D* FFT_grid_a_;
00427
00428
00429 FFT3D* FFT_grid_b_;
00430
00431 float radius_a_;
00432 float radius_b_;
00433
00434 Vector3 FFT_grid_lower_index_;
00435 Vector3 FFT_grid_upper_index_;
00436 Vector3 FFT_grid_lower_coord_;
00437 Vector3 FFT_grid_upper_coord_;
00438
00439 Vector3 FFT_grid_size_index_;
00440
00441
00442
00443 Vector3 pre_translation_a_;
00444 Vector3 pre_translation_b_;
00445
00446 Vector3 FFT_grid_origin_;
00447
00448
00449 int current_round_;
00450
00451
00452 int total_round_;
00453
00454
00455 std::multiset<Peak_> peak_set_;
00456
00457
00458 System system_backup_a_;
00459 System system_backup_b_;
00460
00461
00462 vector<Vector3> translations_;
00463 vector<Vector3> orientations_;
00464
00465 };
00466
00467 }
00468
00469 #endif