BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
scoringOptimizer.h
Go to the documentation of this file.
1 // ----------------------------------------------------
2 // $Maintainer: Marcel Schumann $
3 // $Authors: Marcel Schumann $
4 // ----------------------------------------------------
5 
6 #ifndef BALL_SCORING_COMMON_SCORINGOPTIMIZER_H
7 #define BALL_SCORING_COMMON_SCORINGOPTIMIZER_H
8 
10 
11 
12 namespace BALL
13 {
16  {
17  public:
18  ScoringOptimizer(Options& options, bool train);
19 
20  void addComplex(String name, String receptor_file, String ligand_file, double binding_free_energy);
21 
22  void evaluate(double* correlation = 0, double* R2 = 0, double* RMSE = 0, Size* no_valid_complexes = 0);
23 
24  void printMatrix(std::ostream& out = std::cout);
25 
26  struct Result
27  {
28  std::list<double> predictions;
29  std::list<double> expected_affinities;
30  std::list<String> target_names;
31  std::vector<std::vector<double> > score_contributions;
32  std::vector<String> score_contribution_names;
33  };
34 
35  const Result* getResult();
36 
37  private:
38  struct Complex
39  {
40  String name;
41  String receptor_file;
42  String ligand_file;
43  double binding_free_energy;
44  };
45 
46  list<Complex> complexes_;
47 
48  Options options_;
49  String scoring_function_name_;
50 
51  Result result_;
52 
54  bool train_;
55 
56  ScoringFunction* createScoringFunction(System& receptor, System& ligand);
57  };
58 
59  static double getMean(const list<double>& v);
60 
61  static double getCovariance(const list<double>& v1, const list<double>& v2, double mean1, double mean2);
62 
63  static double getStddev(const list<double>& m, double mean);
64 
65  static double getSumOfSquares(const list<double>& m, double mean);
66 }
67 
68 
69 #endif // BALL_SCORING_COMMON_SCORINGOPTIMIZER_H
std::vector< String > score_contribution_names
std::list< double > expected_affinities
static double getCovariance(const list< double > &v1, const list< double > &v2, double mean1, double mean2)
std::complex< BALL_COMPLEX_PRECISION > Complex
Definition: complex.h:21
std::list< String > target_names
static double getMean(const list< double > &v)
static double getStddev(const list< double > &m, double mean)
std::list< double > predictions
static double getSumOfSquares(const list< double > &m, double mean)
std::vector< std::vector< double > > score_contributions
#define BALL_EXPORT
Definition: COMMON/global.h:50