IMP logo
IMP Reference Guide  develop.7400db2aee,2024/11/23
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>
18 #include <IMP/container_macros.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 
25 IMPISD_BEGIN_NAMESPACE
26 
27 //! Apply harmonic restraint between a residue or fragment and a
28 //! protein.
29 class IMPISDEXPORT ResidueProteinProximityRestraint : public Restraint {
30 public:
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
47  double evaluate_for_contributions(Ints c) const;
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 
84 IMPISD_END_NAMESPACE
85 
86 #endif /* IMPISD_RESIDUE_PROTEIN_PROXIMITY_RESTRAINT_H */
Various important functionality for implementing decorators.
A shared container for Pairs.
Definition: PairContainer.h:39
Store a list of ParticleIndexes.
#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.
Macros to define containers of objects.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
A container for Pairs.
unsigned get_number_of_contributions() const
Get number of contributions added to the restraint.
Abstract base class for all restraints.
Decorator for a sphere-like particle.
virtual ModelObjectsTemp do_get_inputs() const =0
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:56