IMP logo
IMP Reference Guide  develop.63b38c487d,2024/12/21
The Integrative Modeling Platform
FretRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/FretRestraint.h
3  * \brief FRET_R restraint to use in vivo FRET data.
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPISD_FRET_RESTRAINT_H
10 #define IMPISD_FRET_RESTRAINT_H
11 #include <IMP/isd/Scale.h>
12 #include <IMP/isd/isd_config.h>
13 #include <IMP/Restraint.h>
14 #include <IMP/isd/FretData.h>
15 #include <cereal/access.hpp>
16 #include <cereal/types/vector.hpp>
17 
18 IMPISD_BEGIN_NAMESPACE
19 /** A restraint for using in-vivo ensemble FRET data.
20  See [Muller et al. Mol Biol Cell
21  16, 3341, 2005](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1165416/)
22  for more info.
23  */
24 
25 class IMPISDEXPORT FretRestraint : public Restraint {
26  ParticleIndexes pd_;
27  ParticleIndexes pa_;
28  ParticleIndex prd_;
29  algebra::Vector3D GMMterd_;
30  algebra::Vector3Ds GMMctrd_;
31  ParticleIndex pra_;
32  algebra::Vector3D GMMtera_;
33  algebra::Vector3Ds GMMctra_;
34  ParticleIndex kda_;
35  ParticleIndex Ida_;
36  ParticleIndex R0_;
37  ParticleIndex sumFi_;
38  ParticleIndex sigma0_;
39  ParticleIndex Pbl_;
41  double fexp_;
42  double multi_d_;
43  int constr_type_;
44  Floats GMMsig_;
45  Floats GMMw_;
46  unsigned Na_;
47  mutable Floats power6_;
48  std::vector<std::vector<unsigned> > states_;
49 
50  friend class cereal::access;
51 
52  template<class Archive> void serialize(Archive &ar) {
53  ar(cereal::base_class<Restraint>(this), pd_, pa_, prd_, GMMterd_,
54  GMMctrd_, pra_, GMMtera_, GMMctra_, kda_, Ida_, R0_, sumFi_, sigma0_,
55  Pbl_, data_, fexp_, multi_d_, constr_type_, GMMsig_, GMMw_, Na_,
56  power6_, states_);
57  }
58 
60 
61  double get_sumFi(double Pbleach) const;
62  std::vector<unsigned> get_indices(unsigned index, int dimension) const;
63 
64  public:
65  //! Create the restraint.
67  Particle *kda, Particle *Ida,
68  Particle *R0, Particle *sigma0,
69  Particle *Pbl, double fexp, double m_d = 1.0,
70  double m_a = 1.0);
71 
72  FretRestraint(Particle *kda, Particle *Ida,
73  Particle *sumFi, Particle *sigma0,
74  Particle *Pbl, double fexp);
75 
77  algebra::Vector3Ds GMMctrd, Floats GMMwd, Floats GMMsigd,
78  Particle *pra, algebra::Vector3D GMMtera,
79  algebra::Vector3Ds GMMctra, Floats GMMwa, Floats GMMsiga,
80  Particle *kda, Particle *Ida,
81  Particle *sigma0, Particle *Pbl, FretData *data,
82  double fexp);
83 
84  FretRestraint() {}
85 
86  // get sumFi
87  double get_sumFi() const;
88 
89  // get average sigma
90  double get_average_sigma(double fmod) const;
91 
92  // lognormal standard error (according to Wikipedia)
93  double get_standard_error() const;
94 
95  // get model fret_r (for the two constructors, i.e. type 0 and 1)
96  double get_model_fretr() const;
97 
98  // get probability
99  double get_probability() const;
100 
101  // get experimental value
102  double get_experimental_value() const {
103  return fexp_;
104  };
105 
106  // set experimental value
107  void set_experimental_value(double fexp);
108 
109  virtual double unprotected_evaluate(IMP::DerivativeAccumulator *accum)
110  const override;
111  virtual IMP::ModelObjectsTemp do_get_inputs() const override;
113 
114  private:
115  double get_model_fretr_type_0() const;
116  double get_model_fretr_type_1() const;
117  algebra::Vector3Ds get_current_centers(ParticleIndex p,
118  const algebra::Vector3Ds &ctrs) const;
119 
120  algebra::Vector3D get_current_center(ParticleIndex p,
121  const algebra::Vector3D &ctr) const;
122 };
123 
124 IMPISD_END_NAMESPACE
125 
126 #endif /* IMPISD_FRET_RESTRAINT_H */
#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.
A decorator for scale parameters particles.
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
Definition: object_macros.h:95
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:143
VectorD< 3 > Vector3D
Definition: VectorD.h:408
Class to handle individual particles of a Model object.
Definition: Particle.h:43
Abstract base class for all restraints.
Auxiliary class for FRET_R restraint.
Definition: FretData.h:24
Auxiliary class useful for FRET_R restraint.
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