IMP logo
IMP Reference Guide  2.5.0
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-2015 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 "isd_config.h"
13 #include <IMP/Restraint.h>
14 #include <IMP/isd/FretData.h>
15 
16 IMPISD_BEGIN_NAMESPACE
17 /** A restraint for using in-vivo ensemble FRET data.
18  See [Muller et al. Mol Biol Cell
19  16, 3341, 2005](http://www.ncbi.nlm.nih.gov/pmc/articles/PMC1165416/)
20  for more info.
21  */
22 
23 class IMPISDEXPORT FretRestraint : public Restraint {
24  Particles pd_;
25  Particles pa_;
26  Pointer<Particle> prd_;
27  algebra::Vector3D GMMterd_;
28  algebra::Vector3Ds GMMctrd_;
29  Pointer<Particle> pra_;
30  algebra::Vector3D GMMtera_;
31  algebra::Vector3Ds GMMctra_;
32  Pointer<Particle> kda_;
33  Pointer<Particle> Ida_;
35  Pointer<Particle> sumFi_;
36  Pointer<Particle> sigma0_;
37  Pointer<Particle> Pbl_;
39  double fexp_;
40  double multi_d_;
41  int constr_type_;
42  Floats GMMsig_;
43  Floats GMMw_;
44  unsigned Na_;
45  mutable Floats power6_;
46  std::vector<std::vector<unsigned> > states_;
47 
48  double get_sumFi(double Pbleach) const;
49  std::vector<unsigned> get_indices(unsigned index, int dimension) const;
50 
51  public:
52  //! Create the restraint.
53  /** Restraints should store the particles they are to act on,
54  preferably in a Singleton or PairContainer as appropriate.
55  */
56 
58  Particle *kda, Particle *Ida,
59  Particle *R0, Particle *sigma0,
60  Particle *Pbl, double fexp, double m_d = 1.0,
61  double m_a = 1.0);
62 
63  FretRestraint(Particle *kda, Particle *Ida,
64  Particle *sumFi, Particle *sigma0,
65  Particle *Pbl, double fexp);
66 
68  algebra::Vector3Ds GMMctrd, Floats GMMwd, Floats GMMsigd,
69  Particle *pra, algebra::Vector3D GMMtera,
70  algebra::Vector3Ds GMMctra, Floats GMMwa, Floats GMMsiga,
71  Particle *kda, Particle *Ida,
72  Particle *sigma0, Particle *Pbl, FretData *data,
73  double fexp);
74 
75  // get sumFi
76  double get_sumFi() const;
77 
78  // get average sigma
79  double get_average_sigma(double fmod) const;
80 
81  // lognormal standard error (according to Wikipedia)
82  double get_standard_error() const;
83 
84  // get model fret_r (for the two constructors, i.e. type 0 and 1)
85  double get_model_fretr() const;
86 
87  // get probability
88  double get_probability() const;
89 
90  // get experimental value
91  double get_experimental_value() const {
92  return fexp_;
93  };
94 
95  // set experimental value
96  void set_experimental_value(double fexp);
97 
98  /** This macro declares the basic needed methods: evaluate and show
99  */
100  virtual double unprotected_evaluate(IMP::DerivativeAccumulator *accum)
101  const IMP_OVERRIDE;
104 
105  private:
106  double get_model_fretr_type_0() const;
107  double get_model_fretr_type_1() const;
108  algebra::Vector3Ds get_current_centers(Particle *p,
109  const algebra::Vector3Ds &ctrs) const;
110 
111  algebra::Vector3D get_current_center(Particle *p,
112  const algebra::Vector3D &ctr) const;
113 };
114 
115 IMPISD_END_NAMESPACE
116 
117 #endif /* IMPISD_FRET_RESTRAINT_H */
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
A decorator for scale parameters particles.
A smart pointer to a reference counted object.
Definition: Pointer.h:87
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:146
VectorD< 3 > Vector3D
Definition: VectorD.h:395
Class to handle individual model particles.
Definition: Particle.h:37
Abstract base class for all restraints.
Auxiliary class for FRET_R restraint.
Definition: FretData.h:22
Auxiliary class useful for FRET_R restraint.
virtual ModelObjectsTemp do_get_inputs() const =0
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:52