IMP
2.2.0
The Integrative Modeling Platform
IMP Mainpage
All IMP Modules
Related Pages
Modules
Namespaces
Classes
Files
Examples
Indexes
File List
File Members
MarginalHBondRestraint.h
Go to the documentation of this file.
1
/**
2
* \file IMP/isd/MarginalHBondRestraint.h
3
* \brief A lognormal restraint that uses the ISPA model to model HBond-derived
4
* distance fit.
5
*
6
* Copyright 2007-2014 IMP Inventors. All rights reserved.
7
*
8
*/
9
10
#ifndef IMPISD_MARGINAL_HBOND_RESTRAINT_H
11
#define IMPISD_MARGINAL_HBOND_RESTRAINT_H
12
13
#include <IMP/isd/isd_config.h>
14
#include <
IMP/kernel/Restraint.h
>
15
#include <
IMP/PairContainer.h
>
16
17
IMPISD_BEGIN_NAMESPACE
18
19
//! Apply a lognormal distance restraint between two particles.
20
/** Marginal of the lognormal model for NOEs where only \f$\sigma\f$ was
21
marginalized, and \f$\gamma\f$ was set to 1.
22
Since the restraint is complicated, pass individual particles to
23
add_contribution() command.
24
25
\f[p(D|X,I) =
26
\left(\sum_{i=1}^N \log^2\left(\frac{V_i^{exp}}
27
{d_i^{-6}(X)}\right)\right)^{-\frac{N}{2}}
28
\f]
29
*/
30
class
IMPISDEXPORT
MarginalHBondRestraint
:
public
kernel::Restraint
{
31
PairContainers
contribs_;
32
std::vector<double> volumes_;
33
double
logsquares_;
34
void
set_logsquares(
double
logsquares) { logsquares_ = logsquares; }
35
36
public
:
37
//! Create the restraint.
38
/** kernel::Restraints should store the particles they are to act on,
39
preferably in a Singleton or PairContainer as appropriate.
40
*/
41
MarginalHBondRestraint
(
kernel::Model
*m)
42
:
Restraint
(m,
"MarginalHBondRestraint%1%"
) {};
43
44
// add a contribution: simple case
45
void
add_contribution(
kernel::Particle
*p1,
kernel::Particle
*p2,
46
double
Iexp);
47
48
// add a contribution: general case
49
void
add_contribution(
PairContainer
*pc,
double
Iexp);
50
51
// return the sum inside the parentheses
52
double
get_logsquares()
const
{
return
logsquares_; }
53
54
unsigned
get_number_of_contributions()
const
{
return
volumes_.size(); }
55
56
/* call for probability */
57
double
get_probability()
const
{
return
exp(-unprotected_evaluate(
nullptr
)); }
58
59
/** This macro declares the basic needed methods: evaluate and show
60
*/
61
virtual
double
unprotected_evaluate(
IMP::kernel::DerivativeAccumulator
*accum)
62
const
IMP_OVERRIDE;
63
virtual
IMP::kernel::ModelObjectsTemp
do_get_inputs
() const IMP_OVERRIDE;
64
IMP_OBJECT_METHODS
(
MarginalHBondRestraint
);
65
};
66
67
IMPISD_END_NAMESPACE
68
69
#endif
/* IMPISD_MARGINAL_HBOND_RESTRAINT_H */
IMP::kernel::DerivativeAccumulator
Class for adding derivatives from restraints to the model.
Definition:
kernel/DerivativeAccumulator.h:25
IMP::kernel::PairContainer
A shared container for Pairs.
Definition:
kernel/PairContainer.h:37
IMP::base::Vector
Definition:
base/Vector.h:37
IMP::kernel::PairContainers
IMP::base::Vector< IMP::base::Pointer< PairContainer > > PairContainers
Definition:
kernel/base_types.h:103
PairContainer.h
Import IMP/kernel/PairContainer.h in the namespace.
Restraint.h
Abstract base class for all restraints.
IMP::kernel::Restraint
A restraint is a term in an IMP ScoringFunction.
Definition:
kernel/Restraint.h:52
IMP_OBJECT_METHODS
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition:
base/object_macros.h:25
IMP::kernel::Particle
Class to handle individual model particles.
Definition:
kernel/Particle.h:34
IMP::isd::MarginalHBondRestraint
Apply a lognormal distance restraint between two particles.
Definition:
MarginalHBondRestraint.h:30
IMP::kernel::ModelObject::do_get_inputs
virtual ModelObjectsTemp do_get_inputs() const =0
IMP::isd::MarginalHBondRestraint::MarginalHBondRestraint
MarginalHBondRestraint(kernel::Model *m)
Create the restraint.
Definition:
MarginalHBondRestraint.h:41
IMP::kernel::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
kernel/Model.h:72