IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
ResidueProteinProximityRestraint.h
Go to the documentation of this file.
1/**
2 * \file IMP/isd/ResidueProteinProximityRestraint.h
3 * \brief Restrain a selection of particles (eg. a residue or
4 * segment) to be within a certain distance of a second
5 * selection of particles (eg. a protein).
6 * Use to model data from mutagenesis experiments that disrupt
7 * protein-protein interactions.
8 *
9 * Copyright 2007-2022 IMP Inventors. All rights reserved.
10 *
11 */
12
13#ifndef IMPISD_RESIDUE_PROTEIN_PROXIMITY_RESTRAINT_H
14#define IMPISD_RESIDUE_PROTEIN_PROXIMITY_RESTRAINT_H
15
16#include <IMP/isd/isd_config.h>
19#include <IMP/PairContainer.h>
20#include <IMP/Restraint.h>
21#include <IMP/core/XYZR.h>
22#include <IMP/core/utility.h>
23#include <boost/unordered_map.hpp>
24
25IMPISD_BEGIN_NAMESPACE
26
27//! Apply harmonic restraint between a residue or fragment and a
28//! protein.
29class IMPISDEXPORT ResidueProteinProximityRestraint : public Restraint {
30public:
31 //! Create the restraint.
33 double cutoff = 6.0,
34 double sigma = 3.0,
35 double xi = 0.5,
36 bool part_of_log_score=false,
37 std::string name = "ResidueProteinProximityRestraint_%1%");
38
39 // add a contribution: general case
40 void add_pairs_container(PairContainer *pc);
41
42 // add particles list (for COM calculations)
43 void add_contribution_particles(const ParticleIndexes ppis1,
44 const ParticleIndexes ppis2);
45
46 //! Evaluate the restraint just for a subset of contribution indexes
48
49 //! Get number of contributions added to the restraint
50 unsigned get_number_of_contributions() const { return ppis_.size(); }
51
52 void set_sigma(double sigma) { sigma_=sigma; }
53
54 void set_cutoff(double cutoff) { cutoff_=cutoff; }
55
56 void set_max_score(double max_score) { max_score_=max_score; }
57
58 void set_yi(double yi) { yi_=yi; }
59
60 void set_interpolation_factor(double interpolation_factor) { interpolation_factor_=interpolation_factor; }
61
62 void set_part_of_log_score(bool hey) { part_of_log_score_=hey; }
63
64 virtual double unprotected_evaluate(DerivativeAccumulator *accum) const override;
65
66 virtual IMP::ModelObjectsTemp do_get_inputs() const override;
67
69 private:
70 double cutoff_;
71 double sigma_;
72 double xi_;
73 double yi_;
74 double interpolation_factor_;
75 double max_score_;
76 bool part_of_log_score_;
77 PairContainers contribs_;
78 ParticleIndexes ppis_;
79 Ints default_range_;
80 std::vector<IMP::core::XYZRs> coms1_;
81 std::vector<IMP::core::XYZRs> coms2_;
82};
83
84IMPISD_END_NAMESPACE
85
86#endif /* IMPISD_RESIDUE_PROTEIN_PROXIMITY_RESTRAINT_H */
Store a list of ParticleIndexes.
A container for Pairs.
Abstract base class for all restraints.
Decorator for a sphere-like particle.
Class for adding derivatives from restraints to the model.
A shared container for Pairs.
Restraint(Model *m, std::string name)
Create a restraint and register it with the model.
unsigned get_number_of_contributions() const
Get number of contributions added to the restraint.
virtual IMP::ModelObjectsTemp do_get_inputs() const override
double evaluate_for_contributions(Ints c) const
Evaluate the restraint just for a subset of contribution indexes.
virtual double unprotected_evaluate(DerivativeAccumulator *accum) const override
Return the unweighted score for the restraint.
ResidueProteinProximityRestraint(Model *m, double cutoff=6.0, double sigma=3.0, double xi=0.5, bool part_of_log_score=false, std::string name="ResidueProteinProximityRestraint_%1%")
Create the restraint.
Macros to define containers of objects.
Various important functionality for implementing decorators.
IMP::Vector< Int > Ints
Standard way to pass a bunch of Int values.
Definition types.h:48
Vector< ParticleIndex, std::allocator< ParticleIndex > > ParticleIndexes
A list of particles, each identified by its ParticleIndex.
Definition base_types.h:199
IMP::Vector< IMP::Pointer< PairContainer > > PairContainers
Definition base_types.h:146
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Definition base_types.h:122
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.