IMP  2.1.0
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-2013 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 
18 #include <IMP/core/rigid_bodies.h>
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 {
44  public:
45  //! Constructor
46  /**
47  \param[in] particles The particles participating in the fitting score
48  \param[in] exp_profile The experimental profile used in the fitting score
49  \param[in] ff_type Type of the form factors for profile calculations:
50  ALL_ATOMS - all atoms including hydrogens
51  HEAVY_ATOMS - no hydrogens, all other atoms included
52  CA_ATOMS - residue level, residue represented by CA
53  */
54  Restraint(const kernel::Particles& particles, const Profile* exp_profile,
55  FormFactorType ff_type = HEAVY_ATOMS);
56 
57  virtual double
58  unprotected_evaluate(IMP::kernel::DerivativeAccumulator *accum)
59  const IMP_OVERRIDE;
60  virtual IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
62 
63  protected:
64  void compute_profile(Profile* model_profile);
65 
66  protected:
67  kernel::Particles particles_; // non-rigid bodies particles
68  std::vector<core::RigidBody> rigid_bodies_decorators_; //rigid bodies
69  std::vector<kernel::Particles> rigid_bodies_; // rigid bodies particles
70  // non-changing part of the profile
71  base::PointerMember<Profile> rigid_bodies_profile_;
72  base::Pointer<ProfileFitter<ChiScore> > profile_fitter_; // computes profiles
73  // computes derivatives
74  base::Pointer<DerivativeCalculator> derivative_calculator_;
75  FormFactorType ff_type_; // type of the form factors to use
76 };
77 
78 IMPSAXS_END_NAMESPACE
79 
80 #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)
A smart pointer to a ref-counted Object that is a class memeber.
Definition: base/Pointer.h:146
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.
functionality for defining rigid bodies
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.