IMP logo
IMP Reference Guide  2.22.0
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-2022 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/Restraint.h>
17 #include <IMP/Particle.h>
18 #include <IMP/container_macros.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 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(Particles ps, int num_residues,
37  Float scale = 1.);
39  const override;
40  virtual IMP::ModelObjectsTemp do_get_inputs() const 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, Particle *, Particles);
52 #endif
53  protected:
54  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(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.
Upper bound harmonic function (non-zero when feature > mean)
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
virtual double unprotected_evaluate(DerivativeAccumulator *da) const
Return the unweighted score for the restraint.
Float get_radius_of_gyration()
Get the predicted radius of gyration used in the restraint.
Macros to define containers of objects.
#define IMP_LIST(protection, Ucname, lcname, Data, PluralData)
A macro to provide a uniform interface for storing lists of objects.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Ensure the radius of gyration of particles fits the predicted one.
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:19
Class to handle individual particles of a Model object.
Definition: Particle.h:43
Abstract base class for all restraints.
virtual ModelObjectsTemp do_get_inputs() const =0
Class for adding derivatives from restraints to the model.
Harmonic upper bound function.
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:56