IMP logo
IMP Reference Guide  2.22.0
The Integrative Modeling Platform
CADihedralRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/atom/CADihedralRestraint.h
3  * \brief Dihedral restraint between five residues in CA-only representation.
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPATOM_CA_DIHEDRAL_RESTRAINT_H
10 #define IMPATOM_CA_DIHEDRAL_RESTRAINT_H
11 
12 #include <IMP/atom/atom_config.h>
13 
14 #include <IMP/Restraint.h>
15 #include <IMP/Particle.h>
16 #include <IMP/generic.h>
17 #include <map>
18 
19 IMPATOM_BEGIN_NAMESPACE
20 
21 //! Dihedral restraint between five residues in CA-only representation
22 /** This restraint is designed to be used in conjunction with a CA-only
23  representation; each restraint is applied to five CA atoms that
24  correspond to five residues that are adjacent in sequence.
25  A simple statistical potential is applied to score the pair of dihedral
26  angles that involve the five atoms. Currently, no splining or other
27  smoothing is done and no derivatives are calculated.
28  */
29 class IMPATOMEXPORT CADihedralRestraint : public Restraint
30 {
31 public:
32  //! Create the dihedral restraint.
33  /** The value of the restraint is simply score[i*N+j] where phi0[i]
34  is the closest angle in phi0 to that between p1-p2-p3-p4,
35  phi1[j] is the closest angle in phi1 to that between p2-p3-p4-p5,
36  and N is the number of elements in phi0.
37  \param[in] m Model
38  \param[in] p1 First CA atom
39  \param[in] p2 Second CA atom
40  \param[in] p3 Third CA atom
41  \param[in] p4 Fourth CA atom
42  \param[in] p5 Fifth CA atom
43  \param[in] phi0 First list of angles for which scores are available
44  \param[in] phi1 Second list of angles for which scores are available
45  \param[in] score List of scores that correspond to phi0*phi1
46  */
50  Floats phi0, Floats phi1,
51  Floats score);
52 
53  virtual double
55  const override;
56  virtual IMP::ModelObjectsTemp do_get_inputs() const override;
58 
59 private:
60  ParticleIndex p_[5];
61  Floats phi0_;
62  Floats phi1_;
63  Floats score_;
64 
65  double get_distance(double v0, double v1) const;
66  int get_closest(std::vector<double> const& vec, double value) const;
67 
68 };
69 
70 IMPATOM_END_NAMESPACE
71 
72 #endif /* IMPATOM_CA_DIHEDRAL_RESTRAINT_H */
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Take Decorator, Particle or ParticleIndex.
virtual double unprotected_evaluate(DerivativeAccumulator *da) const
Return the unweighted score for the restraint.
Dihedral restraint between five residues in CA-only representation.
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...
Abstract base class for all restraints.
double get_distance(const Line3D &s, const Vector3D &p)
Get closest distance between a line and a point.
virtual ModelObjectsTemp do_get_inputs() const =0
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:56
Compile-time generic restraint and constraint support.