IMP  2.3.1
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 flase positive rate.
5  *
6  * Copyright 2007-2014 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/kernel/Restraint.h>
15 
16 IMPISD_BEGIN_NAMESPACE
17 /** A restraint for ambiguous cross-linking MS data and multiple state approach.
18  It marginalizes the false positive rate and depends on the expected fpr and
19  an uncertainty parameter beta.
20  */
21 
22 class IMPISDEXPORT CrossLinkMSRestraint : public kernel::Restraint {
23 
28  double length_;
29  double slope_;
30  int constr_;
31 
32  double sphere_cap(float r1, float r2, float d) const;
33 
34  public:
35  //! Create the restraint.
36  /** Restraints should store the particles they are to act on,
37  preferably in a Singleton or PairContainer as appropriate.
38  */
39 
40  CrossLinkMSRestraint(IMP::kernel::Model* m, double length,
41  std::string name = "CrossLinkMSRestraint%1%");
42 
45  std::string name = "CrossLinkMSRestraint%1%");
46 
47  CrossLinkMSRestraint(IMP::kernel::Model* m, double length, double slope,
48  std::string name = "CrossLinkMSRestraint%1%");
49 
50  void add_contribution(const IMP::kernel::ParticleIndexPair& pps,
51  const IMP::kernel::ParticleIndexPair& sigmas,
52  const IMP::kernel::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  unsigned int get_number_of_contributions() const { return ppis_.size(); }
61 
62  /** This macro declares the basic needed methods: evaluate and show
63  */
64  virtual double unprotected_evaluate(
68 };
69 
70 IMPISD_END_NAMESPACE
71 
72 #endif /* IMPISD_CROSS_LINK_MSRESTRAINT_H */
Various general useful functions for IMP.
Class for adding derivatives from restraints to the model.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
A class to store an fixed array of same-typed values.
Definition: Array.h:33
Abstract base class for all restraints.
A restraint is a term in an IMP ScoringFunction.
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 storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:73