IMP  2.2.1
The Integrative Modeling Platform
saxs/Restraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/saxs/Restraint.h
3  * \brief Calculate score based on fit to SAXS profile.
4  *
5  * Copyright 2007-2014 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPSAXS_RESTRAINT_H
10 #define IMPSAXS_RESTRAINT_H
11 
12 #include <IMP/saxs/saxs_config.h>
13 
14 #include <IMP/saxs/ProfileFitter.h>
15 #include <IMP/saxs/Profile.h>
17 
19 
20 #include <IMP/kernel/Model.h>
21 #include <IMP/kernel/Restraint.h>
22 #include <IMP/base/Object.h>
23 #include <IMP/base/Pointer.h>
24 
25 IMPSAXS_BEGIN_NAMESPACE
26 
27 //! Calculate score based on fit to SAXS profile
28 /** \ingroup exp_restraint
29 
30  The restraint takes rigid bodies into account, in order
31  to speed up the calculations. Rigid body should be gived as single
32  RigidBody Particle. Other, non-rigid body Particles can also be given.
33 
34  The shape of a rigid body is assumed to be defined by the set of
35  atom::Hierarchy leaves of the atom::Hierarchy rooted at the rigid body
36  particle.
37 
38  \par Algorithmic details:
39  The distances between the atoms of rigid body do not change, therefore
40  their contribution to the profile is pre-computed and stored.
41  */
42 class IMPSAXSEXPORT Restraint : public kernel::Restraint {
43  public:
44  //! Constructor
45  /**
46  \param[in] particles The particles participating in the fitting score
47  \param[in] exp_profile The experimental profile used in the fitting score
48  \param[in] ff_type Type of the form factors for profile calculations:
49  ALL_ATOMS - all atoms including hydrogens
50  HEAVY_ATOMS - no hydrogens, all other atoms included
51  CA_ATOMS - residue level, residue represented by CA
52  */
53  Restraint(const kernel::Particles& particles, const Profile* exp_profile,
54  FormFactorType ff_type = HEAVY_ATOMS);
55 
56  virtual double unprotected_evaluate(IMP::kernel::DerivativeAccumulator* accum)
57  const IMP_OVERRIDE;
58 
59  virtual IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
60 
62 
63  protected:
65  base::Pointer<ProfileFitter<ChiScore> > profile_fitter_; // computes profiles
66  // computes derivatives
67  base::Pointer<DerivativeCalculator> derivative_calculator_;
68 };
69 
70 IMPSAXS_END_NAMESPACE
71 
72 #endif /* IMPSAXS_RESTRAINT_H */
Class for adding derivatives from restraints to the model.
A nullptr-initialized pointer to an IMP Object.
Restraint(kernel::Model *m, std::string name)
Calculate score based on fit to SAXS profile.
A smart pointer to a reference counted object.
Definition: base/Pointer.h:87
a class for fitting two profiles
Abstract base class for all restraints.
A restraint is a term in an IMP ScoringFunction.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Storage of a model, its restraints, constraints and particles.
virtual ModelObjectsTemp do_get_inputs() const =0
FormFactorType
type of the form factors for profile calculations
A shared base class to help in debugging and things.
A class for computing SAXS derivatives.
A class for profile storing and computation.