IMP  2.0.1
The Integrative Modeling Platform
TALOSRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/TALOSRestraint.h
3  * \brief TALOS dihedral restraint between four particles.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPISD_TALOS_RESTRAINT_H
10 #define IMPISD_TALOS_RESTRAINT_H
11 
12 #include <IMP/isd/isd_config.h>
13 #include "Scale.h"
14 #include "vonMisesSufficient.h"
15 
16 #include <IMP/Restraint.h>
17 #include <IMP/Particle.h>
18 
19 IMPISD_BEGIN_NAMESPACE
20 
21 //! phi/psi dihedral restraint between four particles, using data from TALOS.
22 /** The likelihood is
23  \f[
24  f(\chi_{exp}^1,\cdots,\chi_{exp}^N|\chi(X),\kappa,I)
25  = \frac{1}{2\pi I_0(\kappa)^N}
26  \exp \left(R_0 \kappa \cos (\chi_{exp}-\chi(X)) \right)
27  \f]
28  where the sufficient statistics are \f$N\f$ the number of observations,
29  \f$R\f$ and \f$\chi_{exp}\f$.
30  \see vonMisesSufficient.h for further detail.
31 */
32 class IMPISDEXPORT TALOSRestraint : public Restraint
33 {
34 public:
35 
36  //! Create restraint from a list of particles and the data.
37  /** \param[in] p list of 4 particles that make the dihedral angle.
38  \param[in] data list of observations for that angle.
39  \param[in] kappa Pointer to the \f$\kappa\f$ concentration particle.
40  */
41  TALOSRestraint(Particles p, Floats data, Particle *kappa);
42 
43  //! Create restraint from 4 particles and the data.
44  /** \param[in] p1 Pointer to first particle in dihedral restraint.
45  \param[in] p2 Pointer to second particle in dihedral restraint.
46  \param[in] p3 Pointer to third particle in dihedral restraint.
47  \param[in] p4 Pointer to fourth particle in dihedral restraint.
48  \param[in] data list of observations for that angle.
49  \param[in] kappa Pointer to the \f$\kappa\f$ concentration particle.
50  */
52  Floats data, Particle *kappa);
53 
54  //! Create restraint from a list of particles and the sufficient statistics.
55  /** \param[in] p list of 4 particles that make the dihedral angle.
56  \param[in] N Number of observations
57  \param[in] R0 component on the x axis
58  \param[in] chiexp average observed angle.
59  \param[in] kappa Pointer to the \f$\kappa\f$ concentration particle.
60  */
61  TALOSRestraint(Particles p, unsigned N, double R0, double chiexp,
62  Particle *kappa);
63 
64  //! Create restraint from 4 particles and the sufficient statistics.
65  /** \param[in] p1 Pointer to first particle in dihedral restraint.
66  \param[in] p2 Pointer to second particle in dihedral restraint.
67  \param[in] p3 Pointer to third particle in dihedral restraint.
68  \param[in] p4 Pointer to fourth particle in dihedral restraint.
69  \param[in] N Number of observations
70  \param[in] R0 component on the x axis
71  \param[in] chiexp average observed angle.
72  \param[in] kappa Pointer to the \f$\kappa\f$ concentration particle.
73  */
75  unsigned N, double R0, double chiexp, Particle *kappa);
76 
77 
78  //! Call for probability
79  double get_probability() const
80  {
81  return exp(-unprotected_evaluate(nullptr));
82  }
83 
84  double get_R0() const
85  {
86  return mises_->get_R0();
87  }
88 
89  double get_chiexp() const
90  {
91  return mises_->get_chiexp();
92  }
93 
94  IMP_RESTRAINT(TALOSRestraint);
95 
96 private:
97  IMP::Pointer<Particle> p_[4];
98  IMP::Pointer<Particle> kappa_;
99  IMP::Pointer<vonMisesSufficient> mises_;
100 };
101 
102 IMPISD_END_NAMESPACE
103 
104 #endif /* IMPISD_TALOS_RESTRAINT_H */