00001
00002
00003
00004
00005
00006 #ifndef BALL_SCORING_COMMON_SCORINGFUNCTION_H
00007 #define BALL_SCORING_COMMON_SCORINGFUNCTION_H
00008
00009 #include <BALL/KERNEL/system.h>
00010 #include <BALL/DATATYPE/options.h>
00011 #include <BALL/DATATYPE/string.h>
00012 #include <BALL/SCORING/COMMON/baseFunction.h>
00013 #include <BALL/SCORING/COMMON/scoringComponent.h>
00014
00015 namespace BALL
00016 {
00017
00018 class ScoringComponent;
00019
00020 class ScoringFunction
00021 {
00022
00023 public:
00024
00025 struct Option
00026 {
00027
00030 static const char* VERBOSITY;
00031
00034 static const char* BASE_FUNCTION_TYPE;
00035
00036 };
00037
00038
00039 struct Default
00040 {
00041
00044 static const Size VERBOSITY;
00045
00048 static const Size BASE_FUNCTION_TYPE;
00049
00050 };
00051
00053 ScoringFunction()
00054 ;
00055
00057 ScoringFunction(const ScoringFunction& sf)
00058 ;
00059
00061 ScoringFunction(Molecule& receptor, Molecule& ligand)
00062 ;
00063
00065 ScoringFunction(Molecule& receptor, Molecule& ligand,
00066 const Options& options)
00067 ;
00068
00070 virtual ~ScoringFunction()
00071 ;
00072
00074 virtual void clear()
00075 ;
00076
00078 ScoringFunction& operator = (const ScoringFunction& sf)
00079 ;
00080
00082 bool setup()
00083 ;
00084
00086 bool setup(Molecule& receptor, Molecule& ligand)
00087 ;
00088
00090 bool setup(Molecule& receptor, Molecule& ligand, const Options& options)
00091 ;
00092
00094 virtual bool specificSetup()
00095 throw(Exception::TooManyErrors);
00096
00098 void setMaximumNumberOfErrors(Size nr)
00099 ;
00100
00102 Size getMaximumNumberOfErrors() const
00103 ;
00104
00106 void setFirstMolecule(Molecule& molecule1)
00107 ;
00108
00110 Molecule* getFirstMolecule() const
00111 ;
00112
00114 void setSecondMolecule(Molecule& molecule2)
00115 ;
00116
00118 Molecule* getSecondMolecule() const
00119 ;
00120
00124 void setReceptor(Molecule& receptor)
00125 ;
00126
00130 Molecule* getReceptor() const
00131 ;
00132
00136 void setLigand(Molecule& ligand)
00137 ;
00138
00142 Molecule* getLigand() const
00143 ;
00144
00146 void setIntercept(double intercept)
00147 ;
00148
00150 double getIntercept() const
00151 ;
00152
00154 void setBaseFunction(ScoringBaseFunction& base_function)
00155 ;
00156
00160 ScoringBaseFunction* getBaseFunction() const
00161 ;
00162
00164 void insertComponent(ScoringComponent* component, float coefficient = 1.0f)
00165 ;
00166
00172 void removeComponent(const ScoringComponent* component)
00173 ;
00174
00181 void removeComponent(const String& name)
00182 ;
00183
00188 void setCoefficient(const ScoringComponent* component, float coefficient)
00189 ;
00190
00196 void setCoefficient(const String& name, float coefficient)
00197 ;
00198
00202 bool getCoefficient(const ScoringComponent* component,
00203 float& coefficient) const
00204 ;
00205
00209 bool getCoefficient(const String& name, float& coefficient) const
00210 ;
00211
00213 ScoringComponent* getComponent(const String& name) const
00214 ;
00215
00217 ScoringComponent* getComponent(const Size index) const
00218 ;
00219
00221 double calculateScore()
00222 ;
00223
00225 const HashSet<const Atom*>& getUnassignedAtoms() const
00226 ;
00227
00229 HashSet<const Atom*>& getUnassignedAtoms()
00230 ;
00231
00233 Options options;
00234
00235
00236 protected:
00237
00238
00239
00240
00241 Molecule* molecule1_;
00242
00243
00244
00245
00246 Molecule* molecule2_;
00247
00248
00249 String name_;
00250
00251
00252 double score_;
00253
00254
00255 double intercept_;
00256
00257
00258
00259 ScoringBaseFunction* base_function_;
00260
00261
00262
00263
00264
00265 std::vector< std::pair<ScoringComponent*, float> > components_;
00266
00267
00268 HashSet<const Atom*> unassigned_atoms_;
00269
00270
00271 Size max_number_of_errors_;
00272
00273
00274 Size number_of_errors_;
00275
00276
00277 };
00278
00279 }
00280
00281 #endif // BALL_SCORING_COMMON_SCORINGFUNCTION_H