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 /* scoringOptimizer.h
2 *
3 * Copyright (C) 2011 Marcel Schumann
4 *
5 * This program free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 // ----------------------------------------------------
20 // $Maintainer: Marcel Schumann $
21 // $Authors: Marcel Schumann $
22 // ----------------------------------------------------
23 
24 #ifndef BALL_SCORING_COMMON_SCORINGOPTIMIZER_H
25 #define BALL_SCORING_COMMON_SCORINGOPTIMIZER_H
26 
28 
29 
30 namespace BALL
31 {
34  {
35  public:
36  ScoringOptimizer(Options& options, bool train);
37 
38  void addComplex(String name, String receptor_file, String ligand_file, double binding_free_energy);
39 
40  void evaluate(double* correlation = 0, double* R2 = 0, double* RMSE = 0, Size* no_valid_complexes = 0);
41 
42  void printMatrix(std::ostream& out = std::cout);
43 
44  struct Result
45  {
46  std::list<double> predictions;
47  std::list<double> expected_affinities;
48  std::list<String> target_names;
49  std::vector<std::vector<double> > score_contributions;
50  std::vector<String> score_contribution_names;
51  };
52 
53  const Result* getResult();
54 
55  private:
56  struct Complex
57  {
58  String name;
59  String receptor_file;
60  String ligand_file;
61  double binding_free_energy;
62  };
63 
64  list<Complex> complexes_;
65 
66  Options options_;
67  String scoring_function_name_;
68 
69  Result result_;
70 
72  bool train_;
73 
74  ScoringFunction* createScoringFunction(System& receptor, System& ligand);
75  };
76 
77  static double getMean(const list<double>& v);
78 
79  static double getCovariance(const list<double>& v1, const list<double>& v2, double mean1, double mean2);
80 
81  static double getStddev(const list<double>& m, double mean);
82 
83  static double getSumOfSquares(const list<double>& m, double mean);
84 }
85 
86 
87 #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