rotationalEntropyLoss.h

Go to the documentation of this file.
00001 // $Id: rotationalEntropyLoss.h,v 1.2 2006/05/21 18:15:28 anker Exp $
00002 // Molecular Mechanics: SLICK force field, rotational entropy loss
00003 
00004 #ifndef BALL_MOLMEC_SLICK_SLICKROTATION_H
00005 #define BALL_MOLMEC_SLICK_SLICKROTATION_H
00006 
00007 #include <stack>
00008 
00009 #include <BALL/SCORING/COMMON/scoringComponent.h>
00010 #include <BALL/DATATYPE/hashSet.h>
00011 #include <BALL/DATATYPE/hashGrid.h>
00012 
00013 namespace BALL
00014 {
00015 
00019   class RotationalEntropyLoss
00020     : public ScoringComponent
00021   {
00022 
00023     public:
00024 
00025     enum AlgorithmType
00026     {
00028       ALGORITHM__GUESS = 0,
00030       ALGORITHM__DATABASE = 1
00031     };
00032 
00033     enum CalculationMethod
00034     {
00036       CALCULATION__ORIGINAL = 1,
00037 
00039       CALCULATION__BOEHM = 2,
00040 
00042       CALCULATION__GLYCOSIDIC_BONDS = 3,
00043 
00045       CALCULATION__FROZEN_GLYCOSIDIC_BONDS = 4,
00046 
00048       CALCULATION__GLYCOSIDIC_CONTRIBUTION = 5
00049     };
00050 
00053     struct Option
00054     {
00057       static const char* ROT_BIND_OFFSET;
00058 
00061       static const char* ROT_GRID_SPACING;
00062 
00065       static const char* ROT_ALGORITHM;
00066 
00069       static const char* ROT_METHOD;
00070 
00073       static const char* VERBOSITY;
00074 
00075     };
00076 
00079     struct Default
00080     {
00081 
00084       static const float ROT_BIND_OFFSET;
00085 
00088       static const float ROT_GRID_SPACING;
00089 
00092       static const Size ROT_ALGORITHM;
00093 
00096       static const Size ROT_METHOD;
00097 
00100       static const Size VERBOSITY;
00101 
00102     };
00103 
00107 
00110     RotationalEntropyLoss()
00111       ;
00112 
00115     RotationalEntropyLoss(ScoringFunction& sf)
00116       ;
00117 
00120     RotationalEntropyLoss(const RotationalEntropyLoss& fr)
00121       ;
00122 
00125     virtual ~RotationalEntropyLoss()
00126       ;
00127 
00129 
00132 
00135     const RotationalEntropyLoss& operator = (const RotationalEntropyLoss& fr)
00136       ;
00137 
00140     virtual void clear()
00141       ;
00142 
00144 
00147 
00148     bool operator == (const RotationalEntropyLoss& fr) const
00149       ;
00150 
00152 
00155 
00158     virtual bool setup()
00159       ;
00160 
00162 
00165 
00168     virtual double calculateScore()
00169       ;
00170 
00172 
00173     private:
00174 
00175     /*_ All possible rotatable bonds.
00176     */
00177     std::vector<const Bond*> rotatable_bonds_;
00178 
00179     /*_ All glycosidic bonds.
00180     */
00181     HashSet<const Bond*> glycosidic_bonds_;
00182 
00183     /*_ The number of rotatable bonds (i. e. rotatable_bonds_.size()).
00184     */
00185     Size N_rot_;
00186 
00187     /*_ A vector of bool indicating which of rotatable bond was frozen upon
00188      * binding.
00189     */
00190     std::vector<bool> is_frozen_;
00191 
00192     /* A flag defining which algorithm should be used for finding
00193      * rotatable bonds
00194     */
00195     Size algorithm_type_;
00196 
00197     /* The percentages of nonlipophilc heavy atoms on each side of the bond
00198      * (named P(r) in the paper).
00199     */
00200     std::vector< std::pair<double, double> > heavy_atom_fractions_;
00201 
00202     /*_ This hash grid contains all receptor atoms. We need it for obtaining
00203      * those ligand atoms that are close to the receptor.
00204     */
00205     HashGrid3<const Atom*>* grid_;
00206 
00207     /*_ The spacing of the grid_.
00208     */
00209     float grid_spacing_;
00210 
00211     /*_
00212      */
00213     Molecule* receptor_;
00214 
00215     /*_
00216      */
00217     Molecule* ligand_;
00218 
00219     /*_
00220      */
00221     float bind_distance_offset_;
00222 
00223     /*_
00224     */
00225     Size calculation_method_;
00226 
00227     /*_ The fresno atom types that are stored in the fresno force field
00228     */
00229     HashMap<const Atom*, Size> fresno_types_;
00230 
00231     /*_ A simple DFS algorithm for identifying rings (i. e. cycles) of the
00232         molecule.
00233     */
00234     void cycleDFS_(const Atom* atom,
00235         HashSet<const Atom*>& visited,
00236         HashSet<const Bond*>& tree,
00237         std::stack<const Bond*>& possible_cycle_bonds,
00238         HashSet<const Bond*>& cycle_bonds,
00239         int& cycle_count)
00240       ;
00241 
00242 
00243     /*_ A simple DFS implementation for counting heavy (as defined by
00244      * Rognan et al.) atoms.
00245     */
00246     void heavyAtomsDFS_(const Atom* atom, const Bond* bond,
00247         HashSet<const Atom*>& visited,
00248         int& heavy_atom_count, int& nonlip_heavy_atom_count)
00249       ;
00250     
00251     /*_ Find out which bonds are still frozen
00252      */
00253     void updateFrozenBonds_()
00254       ;
00255     
00256     /*_
00257      */
00258     bool frozenBondsDFS_(const Atom* atom,
00259         HashSet<const Atom*>& visited)
00260       ;
00261   };
00262 
00263 } // namespace BALL
00264 
00265 #endif // BALL_MOLMEC_SLICK_SLICKROTATION_H