IMP logo
IMP Reference Guide  2.11.1
The Integrative Modeling Platform
AtomicCrossLinkMSRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/AtomicCrossLinkMSRestraint.h
3  * \brief A pmf based likelihood function
4  * with prior knowledge on the false positive rate.
5  *
6  * Copyright 2007-2019 IMP Inventors. All rights reserved.
7  *
8  */
9 
10 #ifndef IMPISD_ATOMIC_CROSS_LINK_MSRESTRAINT_H
11 #define IMPISD_ATOMIC_CROSS_LINK_MSRESTRAINT_H
12 #include "isd_config.h"
14 #include <IMP/container_macros.h>
15 #include <IMP/PairContainer.h>
16 #include <IMP/Restraint.h>
17 
18 IMPISD_BEGIN_NAMESPACE
19 
20 //! Restrain atom pairs based on a set of crosslinks.
21 class IMPISDEXPORT AtomicCrossLinkMSRestraint : public Restraint {
22 public:
23  //! Constructor
24  /**
25  \param[in] m The IMP model
26  \param[in] length The maximum length of the crosslinker
27  \param[in] psi The xlink uncertainty nuisance particle
28  \param[in] slope Exponential factor added to the score
29  \param[in] part_of_log_score If true, will return probability instead of
30  score (but the derivative will still be for a log)
31  \param[in] name The restraint name
32 
33  */
34  AtomicCrossLinkMSRestraint(IMP::Model* m, double length,
35  ParticleIndex psi, Float slope = 0.0,
36  bool part_of_log_score=false,
37  std::string name = "AtomicCrossLinkMSRestraint%1%");
38 
39  //! Add a contribution to this xlink
40  /**
41  \param[in] ppi The particles to which you will apply the restraint
42  \param[in] sigmas Nuisance parameters (one per residue involved in the XL)
43  */
44 
45  void add_contribution(const ParticleIndexPair& ppi,
46  const ParticleIndexPair& sigmas);
47 
48 
49  //! Evaluate the restraint just for a subset of contribution indexes
50  Float evaluate_for_contributions(Ints c,DerivativeAccumulator *accum) const;
51 
52  //! Get number of contributions added to the restraint
53  unsigned int get_number_of_contributions() const { return ppis_.size(); }
54 
55  //! Get the particles in a contribution
56  ParticleIndexPair get_contribution(int i) const { return ppis_[i]; }
57 
58  //! Get the sigma nuisances in a contribution
59  ParticleIndexPair get_contribution_sigmas(int i) const { return sigmass_[i]; }
60 
61  //! Get the psi nuisance in a contribution
62  ParticleIndex get_psi() const { return psi_; }
63 
64  virtual double unprotected_evaluate(
67  void show(std::ostream &out) const { out << "Atomic XL restraint with "
68  <<get_number_of_contributions()
69  <<" contributions"; }
70  void set_slope(Float slope) { slope_=slope; }
71  void set_part_of_log_score(bool hey) { part_of_log_score_=hey; }
72 
74  private:
75  Float xlen_;
76  ParticleIndex psi_;
77  Float slope_;
78  bool part_of_log_score_;
79  ParticleIndexPairs ppis_;
80  ParticleIndexPairs sigmass_;
81  Ints default_range_;
82 };
83 
84 IMPISD_END_NAMESPACE
85 
86 #endif /* IMPISD_ATOMIC_CROSS_LINK_MSRESTRAINT_H */
Store a list of ParticleIndexes.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Restrain atom pairs based on a set of crosslinks.
Macros to define containers of objects.
ParticleIndexPair get_contribution(int i) const
Get the particles in a contribution.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
A container for Pairs.
ParticleIndex get_psi() const
Get the psi nuisance in a contribution.
std::ostream & show(Hierarchy h, std::ostream &out=std::cout)
Print the hierarchy using a given decorator to display each node.
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:20
Abstract base class for all restraints.
ParticleIndexPair get_contribution_sigmas(int i) const
Get the sigma nuisances in a contribution.
unsigned int get_number_of_contributions() const
Get number of contributions added to the restraint.
virtual ModelObjectsTemp do_get_inputs() const =0
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.
Definition: Restraint.h:54