IMP  2.2.1
The Integrative Modeling Platform
multifit/RadiusOfGyrationRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/multifit/RadiusOfGyrationRestraint.h
3  * \brief radius of gyration restraint.
4  *
5  * Restrict max distance between every pair of particle
6  *
7  * Copyright 2007-2014 IMP Inventors. All rights reserved.
8  *
9  */
10 
11 #ifndef IMPMULTIFIT_RADIUS_OF_GYRATION_RESTRAINT_H
12 #define IMPMULTIFIT_RADIUS_OF_GYRATION_RESTRAINT_H
13 
14 #include <IMP/multifit/multifit_config.h>
15 #include <IMP/kernel/Restraint.h>
17 #include <IMP/kernel/Particle.h>
19 
20 IMPMULTIFIT_BEGIN_NAMESPACE
21 
22 //! Ensure the radius of gyration of particles fits the predicted one
23 /**
24 /note a harmonic upper bound is applied between
25  the predicted radius and the actual radius
26  */
27 class IMPMULTIFITEXPORT RadiusOfGyrationRestraint : public kernel::Restraint {
28  public:
29  //! Constructor
30  /**
31  \param[in] ps the particles to work on
32  \param[in] num_residues the number of residues the particles represent
33  \param[in] scale allow the radius of gyration of the particles
34  to be at most scale times the predicted one
35  */
36  RadiusOfGyrationRestraint(kernel::Particles ps, int num_residues,
37  Float scale = 1.);
38  virtual double unprotected_evaluate(IMP::kernel::DerivativeAccumulator *accum)
39  const IMP_OVERRIDE;
40  virtual IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
42  //! Set the predicted radius of gyration used in the restraint
44  predicted_rog_ = r;
45  hub_ = new core::HarmonicUpperBound(predicted_rog_ * scale_, 1);
46  }
47  //! Get the predicted radius of gyration used in the restraint
48  inline Float get_radius_of_gyration() { return predicted_rog_; }
49 
50 #ifndef SWIG
51  IMP_LIST(private, Particle, particle, kernel::Particle *, kernel::Particles);
52 #endif
53  protected:
54  kernel::Model *mdl_;
55  Float predicted_rog_;
56  Float scale_;
58 };
59 
60 IMPMULTIFITEXPORT
61 float get_approximated_radius_of_gyration(int len);
62 IMPMULTIFITEXPORT
63 float get_actual_radius_of_gyration(kernel::ParticlesTemp ps);
64 IMPMULTIFITEXPORT
65 float get_approximated_radius(int len);
66 IMPMULTIFIT_END_NAMESPACE
67 
68 #endif /* IMPMULTIFIT_RADIUS_OF_GYRATION_RESTRAINT_H */
void set_radius_of_gyration(Float r)
Set the predicted radius of gyration used in the restraint.
Class for adding derivatives from restraints to the model.
Upper bound harmonic function (non-zero when feature > mean)
Float get_radius_of_gyration()
Get the predicted radius of gyration used in the restraint.
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.
Class to handle individual model particles.
Classes to handle individual model particles.
Ensure the radius of gyration of particles fits the predicted one.
virtual ModelObjectsTemp do_get_inputs() const =0
double Float
Basic floating-point value (could be float, double...)
Definition: base/types.h:20
#define IMP_LIST(protection, Ucname, lcname, Data, PluralData)
A macro to provide a uniform interface for storing lists of objects.
Macros to define containers of objects.
Harmonic upper bound function.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72