IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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
18IMPISD_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
25class IMPISDEXPORT FretRestraint : public Restraint {
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.
66 FretRestraint(ParticlesTemp pd, ParticlesTemp pa,
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
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
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
124IMPISD_END_NAMESPACE
125
126#endif /* IMPISD_FRET_RESTRAINT_H */
Auxiliary class useful for FRET_R restraint.
Abstract base class for all restraints.
A decorator for scale parameters particles.
Class for adding derivatives from restraints to the model.
Class to handle individual particles of a Model object.
Definition Particle.h:45
Restraint(Model *m, std::string name)
Create a restraint and register it with the model.
Auxiliary class for FRET_R restraint.
Definition FretData.h:24
virtual double unprotected_evaluate(IMP::DerivativeAccumulator *accum) const override
Return the unweighted score for the restraint.
FretRestraint(ParticlesTemp pd, ParticlesTemp pa, Particle *kda, Particle *Ida, Particle *R0, Particle *sigma0, Particle *Pbl, double fexp, double m_d=1.0, double m_a=1.0)
Create the restraint.
virtual IMP::ModelObjectsTemp do_get_inputs() const override
Index< ParticleIndexTag > ParticleIndex
Definition base_types.h:196
Vector< VectorD< 3 > > Vector3Ds
Definition VectorD.h:409
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Definition base_types.h:199
VectorD< 3 > Vector3D
Definition VectorD.h:407
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Definition base_types.h:122
IMP::Vector< Float > Floats
Standard way to pass a bunch of Float values.
Definition types.h:46
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
A smart pointer to a ref-counted Object that is a class member.
Definition Pointer.h:144