IMP  2.1.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-2013 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>
16 #include <IMP/restraint_macros.h>
18 #include <IMP/kernel/Particle.h>
19 IMPMULTIFIT_BEGIN_NAMESPACE
20 
21 //! Ensure the radius of gyration of particles fits the predicted one
22 /**
23 /note a harmonic upper bound is applied between
24  the predicted radius and the actual radius
25  */
26 class IMPMULTIFITEXPORT RadiusOfGyrationRestraint : public kernel::Restraint
27 {
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,Float scale=1.);
37  virtual double
38  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  //! Get the predicted radius of gyration used in the restraint
47  inline Float get_radius_of_gyration() {return predicted_rog_;}
48 
49 #ifndef SWIG
50  IMP_LIST(private, Particle, particle, kernel::Particle*, kernel::Particles);
51 #endif
52  protected:
53  kernel::Model *mdl_;
54  Float predicted_rog_;
55  Float scale_;
57 };
58 
59 IMPMULTIFITEXPORT
60 float get_approximated_radius_of_gyration(int len);
61 IMPMULTIFITEXPORT
62 float get_actual_radius_of_gyration(kernel::ParticlesTemp ps);
63 IMPMULTIFITEXPORT
64 float get_approximated_radius(int len);
65 IMPMULTIFIT_END_NAMESPACE
66 
67 #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 &gt; mean)
Float get_radius_of_gyration()
Get the predicted radius of gyration used in the restraint.
Import IMP/kernel/restraint_macros.h in the namespace.
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.
Harmonic upper bound function.
Class for storing model, its restraints, constraints, and particles.