IMP  2.0.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-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/Model.h>
21 #include <IMP/Restraint.h>
22 #include <IMP/VersionInfo.h>
23 #include <IMP/internal/OwnerPointer.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 IMP::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 Particles& particles, const Profile& exp_profile,
55  FormFactorType ff_type = HEAVY_ATOMS);
56 
58 
59  protected:
60  void compute_profile(Profile& model_profile);
61 
62  protected:
63  Particles particles_; // non-rigid bodies particles
64  std::vector<core::RigidBody> rigid_bodies_decorators_; //rigid bodies
65  std::vector<Particles> rigid_bodies_; // rigid bodies particles
66  Profile rigid_bodies_profile_; // non-changing part of the profile
67  Profile exp_profile_; // experimental profile
68  Pointer<ProfileFitter<ChiScore> > profile_fitter_; // computes profiles
69  Pointer<DerivativeCalculator> derivative_calculator_; // computes derivatives
70  FormFactorType ff_type_; // type of the form factors to use
71 };
72 
73 IMPSAXS_END_NAMESPACE
74 
75 #endif /* IMPSAXS_RESTRAINT_H */