IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
CysteineCrossLinkRestraint.h
Go to the documentation of this file.
1/**
2 * \file IMP/isd/CysteineCrossLinkRestraint.h
3 * \brief A sigmoid shaped restraint between
4 * residues with discrete classifier
5 * and ambiguous assignment. To be used with
6 * cross-linking mass-spectrometry data.
7 *
8 * Copyright 2007-2022 IMP Inventors. All rights reserved.
9 *
10 */
11
12#ifndef IMPISD_CYSTEINE_CROSS_LINK_RESTRAINT_H
13#define IMPISD_CYSTEINE_CROSS_LINK_RESTRAINT_H
14#include <IMP/isd/isd_config.h>
15#include <IMP/Restraint.h>
18#include <cereal/access.hpp>
19#include <cereal/types/vector.hpp>
20
21IMPISD_BEGIN_NAMESPACE
22//! A restraint for cysteine cross-linking data.
23/** It models the frequency fexp derived from gel separation of cross-linked
24 complexes. The experimental frequency fexp is derived as the
25 fraction of dimeric versus monomeric complex, upon cysteine
26 cross-linking. The forward model is derived from free energy
27 calculations. The likelihood is modeled as a normal distribution
28 function truncated over the interval [0,1]. To construct the
29 restraint, the class CysteineCrossLinkData and CrossLinkData have
30 to be initialized (see for instance
31 test_CysteineCrossLinkRestraint.py). Input parameters and
32 constructor. There are two different constructors p1 and p2 are
33 the two cross-linked sites. \f$ \beta \f$ is the beta parameter
34 in the distribution function. The \f$ \alpha \f$ parameter is
35 constrained by the condition that the variance is gaussian by the
36 formula \f$ \omega \f$ is a scale factor for the beta parameter,
37 to allow for outlier detection. Usage: Construct the ambiguous
38 set using CysteineCrossLinkRestraint(\f$ \beta \f$, \f$ \omega
39 \f$, xlyield, \f$ f_{exp} \f$) method. The model frequencies of
40 each individual copy are summed, weighted and multiplied by the
41 unknown crosslink yield (epsilon). Pass individual cross-linked
42 pairs to add_contribution(p0, p1, w) command, where "w" is a state
43 weight parameter.
44 */
45
46class IMPISDEXPORT CysteineCrossLinkRestraint : public Restraint {
47 ParticleIndexes ps1_;
48 ParticleIndexes ps2_;
49 std::vector<ParticleIndexes> pslist1_;
50 std::vector<ParticleIndexes> pslist2_;
51 ParticleIndex beta_;
52 ParticleIndex sigma_;
53 ParticleIndex epsilon_; // k * t at the exponential
54 ParticleIndex weight_;
57 int constr_type_;
58 double fexp_;
59 bool use_CA_;
60
61 friend class cereal::access;
62
63 template<class Archive> void serialize(Archive &ar) {
64 ar(cereal::base_class<Restraint>(this), ps1_, ps2_, pslist1_, pslist2_,
65 beta_, sigma_, epsilon_, weight_, data_, ccldata_, constr_type_,
66 fexp_, use_CA_);
67 }
68
70
71 public:
72 //! Create the restraint.
77 double fexp);
78
83 CysteineCrossLinkData *ccldata);
84
86
87 /* call for probability */
88 double get_probability() const;
89
90 double get_standard_error() const;
91
92 Floats get_frequencies() const;
93
94 double get_model_frequency() const;
95
96 Floats get_distances() const;
97
98 double get_truncated_normalization(double mean, double sigma) const;
99
100 double get_normal_pdf(double mean, double sigma, double x) const;
101
102 void add_contribution(ParticleIndexAdaptor p1, ParticleIndexAdaptor p2);
103 void add_contribution(ParticleIndexes p1, ParticleIndexes p2);
104
105 algebra::Vector3D get_CB_coordinates(const ParticleIndexes &ps) const;
106
107 unsigned get_number_of_contributions() const;
108
110 const override;
111 virtual IMP::ModelObjectsTemp do_get_inputs() const override;
113};
114
115IMPISD_END_NAMESPACE
116
117#endif /* IMPISD_CYSTEINE_CROSS_LINK_RESTRAINT_H */
Normal distribution of Function.
Normal distribution of Function.
Abstract base class for all restraints.
Class for adding derivatives from restraints to the model.
Take Decorator, Particle or ParticleIndex.
Restraint(Model *m, std::string name)
Create a restraint and register it with the model.
virtual IMP::ModelObjectsTemp do_get_inputs() const override
virtual double unprotected_evaluate(IMP::DerivativeAccumulator *accum) const override
Return the unweighted score for the restraint.
CysteineCrossLinkRestraint(Model *m, ParticleIndexAdaptor beta, ParticleIndexAdaptor sigma, ParticleIndexAdaptor epsilon, ParticleIndexAdaptor weight, CrossLinkData *data, double fexp)
Create the restraint.
Index< ParticleIndexTag > ParticleIndex
Definition base_types.h:196
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