IMP logo
IMP Reference Guide  2.13.0
The Integrative Modeling Platform
CrossLinkMSRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/CrossLinkMSRestraint.h
3  * \brief A pmf based likelihood function
4  * with prior knowledge on the false positive rate.
5  *
6  * Copyright 2007-2020 IMP Inventors. All rights reserved.
7  *
8  */
9 
10 #ifndef IMPISD_CROSS_LINK_MSRESTRAINT_H
11 #define IMPISD_CROSS_LINK_MSRESTRAINT_H
12 #include "isd_config.h"
13 #include <IMP/Restraint.h>
14 #include <IMP/particle_index.h>
15 
16 IMPISD_BEGIN_NAMESPACE
17 
18 //! A restraint for ambiguous cross-linking MS data and multiple state approach.
19 /** It marginalizes the false positive rate and depends on the expected fpr and
20  an uncertainty parameter beta.
21  */
22 class IMPISDEXPORT CrossLinkMSRestraint : public Restraint {
23 
25  IMP::ParticleIndexPairs sigmass_;
26  IMP::ParticleIndex lengthi_;
28  double length_;
29  double slope_;
30  int constr_;
31  bool get_log_prob_;
32 
33  double sphere_cap(float r1, float r2, float d) const;
34 
35  public:
36  //! Create the restraint.
37  CrossLinkMSRestraint(IMP::Model* m, double length,
38  bool get_log_prob = false,
39  std::string name = "CrossLinkMSRestraint%1%");
40 
43  bool get_log_prob = false,
44  std::string name = "CrossLinkMSRestraint%1%");
45 
46  CrossLinkMSRestraint(IMP::Model* m, double length, double slope,
47  bool get_log_prob = false,
48  std::string name = "CrossLinkMSRestraint%1%");
49 
50  void add_contribution(const IMP::ParticleIndexPair& pps,
51  const IMP::ParticleIndexPair& sigmas,
52  IMP::ParticleIndex psi) {
53  ppis_.push_back(pps);
54  sigmass_.push_back(sigmas);
55  psis_.push_back(psi);
56  }
57 
58  double get_probability() const;
59 
60  //! Get the particle indexes from a contribution
61  ParticleIndexPair get_contribution_particle_indexes(int i) const { return ppis_[i]; }
62 
63  unsigned int get_number_of_contributions() const { return ppis_.size(); }
64 
65  virtual double unprotected_evaluate(
69 };
70 
71 IMPISD_END_NAMESPACE
72 
73 #endif /* IMPISD_CROSS_LINK_MSRESTRAINT_H */
A restraint for ambiguous cross-linking MS data and multiple state approach.
Various general useful functions for IMP.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
ParticleIndexPair get_contribution_particle_indexes(int i) const
Get the particle indexes from a contribution.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
Abstract base class for all restraints.
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