IMP  2.4.0
The Integrative Modeling Platform
SAXSMultiStateModelScore.h
Go to the documentation of this file.
1 /**
2  * \file IMP/multi_state/SAXSMultiStateModelScore.h
3  * \brief
4  *
5  * \authors Dina Schneidman
6  * Copyright 2007-2015 IMP Inventors. All rights reserved.
7  *
8  */
9 
10 #ifndef IMPMULTI_STATE_SAXS_MULTI_STATE_MODEL_SCORE_H
11 #define IMPMULTI_STATE_SAXS_MULTI_STATE_MODEL_SCORE_H
12 
13 #include "MultiStateModelScore.h"
14 #include "MultiStateModel.h"
15 
16 #include <IMP/saxs/Profile.h>
18 #include <IMP/base/Object.h>
19 
20 #include <vector>
21 
22 IMPMULTISTATE_BEGIN_NAMESPACE
23 
24 /** Score multi-state models against SAXS profiles */
25 class IMPMULTISTATEEXPORT SAXSMultiStateModelScore :
26  public MultiStateModelScore {
27 public:
28 
29  /* if c1_c2_approximate=true, get_score will return approximate score
30  based on average c1/c2
31  min_weight_threshold, multi-state models with one or more weights below
32  min_weight_threshold will get a negative score
33  */
35  const IMP::saxs::Profile* exp_profile,
36  bool c1_c2_approximate,
37  float min_c1 = 0.99, float max_c1 = 1.05,
38  float min_c2 = -0.5, float max_c2 = 2.0);
39 
40  double get_score(const MultiStateModel& m) const;
41 
42  double get_score(const MultiStateModel& m,
43  std::vector<double>& weights) const;
44 
45  IMP::saxs::WeightedFitParameters get_fit_parameters(MultiStateModel& m) const;
46 
47  IMP::saxs::WeightedFitParameters get_fit_parameters() const;
48 
49  void write_fit_file(MultiStateModel& m,
50  const IMP::saxs::WeightedFitParameters& fp,
51  const std::string fit_file_name) const;
52 
53  std::string get_state_name(unsigned int id) const { return profiles_[id]->get_name(); }
54 
55  std::string get_dataset_name() const { return exp_profile_->get_name(); }
56 
57  float get_average_c1() const { return average_c1_; }
58  float get_average_c2() const { return average_c2_; }
59 
60  void set_average_c1_c2(const std::vector<IMP::saxs::WeightedFitParameters>& fps);
61 
62 private:
63  void resample(const IMP::saxs::Profile* exp_profile,
64  const IMP::saxs::Profiles& profiles,
65  IMP::saxs::Profiles& resampled_profiles);
66 
67  void set_average_c1_c2(IMP::saxs::WeightedProfileFitter* score,
68  const IMP::saxs::Profiles& profiles);
69 
70 private:
71  // input profiles
72  const IMP::saxs::Profiles profiles_;
74 
75  // resampled on experimental profile q's
76  IMP::saxs::Profiles resampled_profiles_;
77 
78  // scoring with exp_profile_
80 
81  float min_c1_, max_c1_, min_c2_, max_c2_;
82  float average_c1_, average_c2_;
83  bool c1_c2_approximate_;
84 };
85 
86 IMPMULTISTATE_END_NAMESPACE
87 
88 #endif /* IMPMULTI_STATE_SAXS_MULTI_STATE_MODEL_SCORE_H */
Fitting of multiple profiles to the experimental one. The weights of the profiles are computed analyt...
base class for MultiStateModel
A shared base class to help in debugging and things.
A class for profile storing and computation.