IMP logo
IMP Reference Guide  2.10.0
The Integrative Modeling Platform
ChiFreeScore.h
Go to the documentation of this file.
1 /**
2  * \file IMP/saxs/ChiFreeScore.h \brief Chi free score implementation
3  *
4  * Copyright 2007-2018 IMP Inventors. All rights reserved.
5  * TODO: add reference
6  */
7 
8 #ifndef IMPSAXS_CHI_FREE_SCORE_H
9 #define IMPSAXS_CHI_FREE_SCORE_H
10 
11 #include <IMP/saxs/saxs_config.h>
12 #include "Profile.h"
13 
14 IMPSAXS_BEGIN_NAMESPACE
15 /**
16  Implementation of chi free score
17  Accurate assessment of mass, models and resolution by small-angle scattering.
18  Rambo RP, Tainer JA. Nature. 2013
19 */
20 class IMPSAXSEXPORT ChiFreeScore : public IMP::Object {
21  public:
22  ChiFreeScore(unsigned int ns, unsigned int k) :
23  IMP::Object("ChiFreeScore%1%"), ns_(ns), K_(k) {
24  if (K_ % 2 == 0) K_++; // make sure it is odd for median
25  last_scale_updated_ = false;
26  }
27 
28  double compute_score(const Profile* exp_profile, const Profile* model_profile,
29  bool use_offset = false) const;
30 
31  double compute_scale_factor(const Profile* exp_profile,
32  const Profile* model_profile,
33  double offset = 0.0) const;
34 
35  double compute_offset(const Profile* exp_profile,
36  const Profile* model_profile) const;
37 
38  private:
39  unsigned int ns_; // number of Shannon channels
40  unsigned int K_;
41  double last_scale_;
42  bool last_scale_updated_;
43 };
44 
45 IMPSAXS_END_NAMESPACE
46 
47 #endif /* IMPSAXS_CHI_FREE_SCORE_H */
Common base class for heavy weight IMP objects.
Definition: Object.h:106
A class for profile storing and computation.