IMP logo
IMP Reference Guide  2.18.0
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 #include "isd_config.h"
17 #include <IMP/container_macros.h>
18 #include <IMP/PairContainer.h>
19 #include <IMP/Restraint.h>
20 #include <IMP/core/XYZR.h>
21 #include <IMP/core/utility.h>
22 #include <boost/unordered_map.hpp>
23 
24 IMPISD_BEGIN_NAMESPACE
25 
26 //! Apply harmonic restraint between a residue or fragment and a
27 //! protein.
28 class IMPISDEXPORT ResidueProteinProximityRestraint : public Restraint {
29 public:
30  //! Create the restraint.
32  double cutoff = 6.0,
33  double sigma = 3.0,
34  double xi = 0.5,
35  bool part_of_log_score=false,
36  std::string name = "ResidueProteinProximityRestraint_%1%");
37 
38  // add a contribution: general case
39  void add_pairs_container(PairContainer *pc);
40 
41  // add particles list (for COM calculations)
42  void add_contribution_particles(const ParticleIndexes ppis1,
43  const ParticleIndexes ppis2);
44 
45  //! Evaluate the restraint just for a subset of contribution indexes
46  double evaluate_for_contributions(Ints c) const;
47 
48  //! Get number of contributions added to the restraint
49  unsigned get_number_of_contributions() const { return ppis_.size(); }
50 
51  void set_sigma(double sigma) { sigma_=sigma; }
52 
53  void set_cutoff(double cutoff) { cutoff_=cutoff; }
54 
55  void set_max_score(double max_score) { max_score_=max_score; }
56 
57  void set_yi(double yi) { yi_=yi; }
58 
59  void set_interpolation_factor(double interpolation_factor) { interpolation_factor_=interpolation_factor; }
60 
61  void set_part_of_log_score(bool hey) { part_of_log_score_=hey; }
62 
63  virtual double unprotected_evaluate(DerivativeAccumulator *accum) const override;
64 
65  virtual IMP::ModelObjectsTemp do_get_inputs() const override;
66 
68  private:
69  double cutoff_;
70  double sigma_;
71  double xi_;
72  double yi_;
73  double interpolation_factor_;
74  double max_score_;
75  bool part_of_log_score_;
76  PairContainers contribs_;
77  ParticleIndexes ppis_;
78  Ints default_range_;
79  std::vector<IMP::core::XYZRs> coms1_;
80  std::vector<IMP::core::XYZRs> coms2_;
81 };
82 
83 IMPISD_END_NAMESPACE
84 
85 #endif /* IMPISD_RESIDUE_PROTEIN_PROXIMITY_RESTRAINT_H */
Various important functionality for implementing decorators.
A shared container for Pairs.
Definition: PairContainer.h:37
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:73
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:53