IMP  2.4.0
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 flase positive rate.
5  *
6  * Copyright 2007-2013 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/kernel/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  */
35  double length,
36  const ParticleIndex& psi,
37  Float slope = 0.0,
38  bool part_of_log_score=false,
39  std::string name = "AtomicCrossLinkMSRestraint%1%");
40 
41  //! Add a contribution to this xlink
42  /**
43  \param[in] ppi The particles to which you will apply the restraint
44  \param[in] sigmas Nuisance parameters (one per residue involved in the XL)
45  */
46 
47  void add_contribution(const ParticleIndexPair& ppi,
48  const ParticleIndexPair& sigmas);
49 
50 
51  //! Evaluate the restraint just for a subset of contribution indexes
52  Float evaluate_for_contributions(Ints c,DerivativeAccumulator *accum) const;
53 
54  //! Get number of contributions added to the restraint
55  unsigned int get_number_of_contributions() const { return ppis_.size(); }
56 
57  //! Get the particles in a contribution
58  ParticleIndexPair get_contribution(int i) const { return ppis_[i]; }
59 
60  //! Get the sigma nuisances in a contribution
61  ParticleIndexPair get_contribution_sigmas(int i) const { return sigmass_[i]; }
62 
63  //! Get the psi nuisance in a contribution
64  ParticleIndex get_psi() const { return psi_; }
65 
66  virtual double unprotected_evaluate(
69  void show(std::ostream &out) const { out << "Atomic XL restraint with "
70  <<get_number_of_contributions()
71  <<" contributions"; }
72  void set_slope(Float slope) { slope_=slope; }
73  void set_part_of_log_score(bool hey) { part_of_log_score_=hey; }
74 
76  private:
77  Float xlen_;
78  ParticleIndex psi_;
79  Float slope_;
80  bool part_of_log_score_;
81  ParticleIndexPairs ppis_;
82  ParticleIndexPairs sigmass_;
83  Ints default_range_;
84 };
85 
86 IMPISD_END_NAMESPACE
87 
88 #endif /* IMPISD_ATOMIC_CROSS_LINK_MSRESTRAINT_H */
Class for adding derivatives from restraints to the model.
IMP::base::Vector< IMP::base::WeakPointer< kernel::ModelObject > > ModelObjectsTemp
Store a list of kernel::ParticlesTemp.
#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.
Import IMP/kernel/container_macros.h in the namespace.
ParticleIndexPair get_contribution(int i) const
Get the particles in a contribution.
Import IMP/kernel/PairContainer.h in the namespace.
Abstract base class for all restraints.
ParticleIndex get_psi() const
Get the psi nuisance in a contribution.
A restraint is a term in an IMP ScoringFunction.
void show(Hierarchy h, std::ostream &out=std::cout)
Print out a molecular hierarchy.
virtual ModelObjectsTemp do_get_inputs() const =0
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:20
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.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:73