home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
develop.63b38c487d,2024/12/21
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
include
IMP
isd
version 20241221.develop.63b38c487d
MarginalNOERestraint.h
Go to the documentation of this file.
1
/**
2
* \file IMP/isd/MarginalNOERestraint.h
3
* \brief A lognormal restraint that uses the ISPA model to model NOE-derived
4
* distance fit.
5
*
6
* Copyright 2007-2022 IMP Inventors. All rights reserved.
7
*
8
*/
9
10
#ifndef IMPISD_MARGINAL_NOE_RESTRAINT_H
11
#define IMPISD_MARGINAL_NOE_RESTRAINT_H
12
13
#include <IMP/isd/isd_config.h>
14
#include <
IMP/Restraint.h
>
15
#include <
IMP/PairContainer.h
>
16
17
IMPISD_BEGIN_NAMESPACE
18
19
//! Apply an NOE distance restraint between two particles.
20
/** Marginal of the NOE lognormal model. Since restraint is complicated,
21
pass individual particles to add_contribution() command. Supports
22
ambiguous NOEs and derivatives.
23
24
\f[p(D|X,I) = SS^{-\frac{N-1}{2}} \quad
25
SS = \sum_{i=1}^N \log^2\left(\frac{V_i^{exp}}{d_i^{-6}(X)
26
\hat{\gamma}}\right) \quad
27
\hat{\gamma} = \left(\prod_{i=1}^N \frac{V_i^{exp}}{d_i^{-6}}\right)^{1/N}
28
\f]
29
*/
30
class
IMPISDEXPORT
MarginalNOERestraint
:
public
Restraint
{
31
PairContainers
contribs_;
32
std::vector<double> volumes_;
33
double
loggammahat_;
34
void
set_log_gammahat(
double
loggammahat) { loggammahat_ = loggammahat; }
35
double
SS_;
36
void
set_SS(
double
SS) { SS_ = SS; }
37
38
public
:
39
//! Create the restraint.
40
MarginalNOERestraint
(
Model
*m)
41
:
Restraint
(m,
"MarginalNOERestraint%1%"
) {};
42
43
// add a contribution: simple case
44
void
add_contribution(
Particle
*p1,
Particle
*p2,
45
double
Iexp);
46
47
// add a contribution: general case
48
void
add_contribution(
PairContainer
*pc,
double
Iexp);
49
50
// return the estimate of gamma given the current structure.
51
double
get_log_gammahat()
const
{
return
loggammahat_; }
52
53
// return the sum of squares wrt current structure.
54
double
get_SS()
const
{
return
SS_; }
55
56
unsigned
get_number_of_contributions()
const
{
return
volumes_.size(); }
57
58
/* call for probability */
59
double
get_probability()
const
{
return
exp(-
unprotected_evaluate
(
nullptr
)); }
60
61
virtual
double
unprotected_evaluate
(
IMP::DerivativeAccumulator
*accum)
62
const override
;
63
virtual
IMP::ModelObjectsTemp
do_get_inputs
()
const override
;
64
IMP_OBJECT_METHODS
(
MarginalNOERestraint
);
65
};
66
67
IMPISD_END_NAMESPACE
68
69
#endif
/* IMPISD_MARGINAL_NOE_RESTRAINT_H */
IMP::PairContainer
A shared container for Pairs.
Definition:
PairContainer.h:39
IMP_OBJECT_METHODS
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition:
object_macros.h:25
IMP::Restraint::unprotected_evaluate
virtual double unprotected_evaluate(DerivativeAccumulator *da) const
Return the unweighted score for the restraint.
IMP::isd::MarginalNOERestraint::MarginalNOERestraint
MarginalNOERestraint(Model *m)
Create the restraint.
Definition:
MarginalNOERestraint.h:40
IMP::Vector< IMP::Pointer< PairContainer > >
IMP::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
Model.h:86
PairContainer.h
A container for Pairs.
IMP::Particle
Class to handle individual particles of a Model object.
Definition:
Particle.h:43
Restraint.h
Abstract base class for all restraints.
IMP::isd::MarginalNOERestraint
Apply an NOE distance restraint between two particles.
Definition:
MarginalNOERestraint.h:30
IMP::ModelObject::do_get_inputs
virtual ModelObjectsTemp do_get_inputs() const =0
IMP::DerivativeAccumulator
Class for adding derivatives from restraints to the model.
Definition:
DerivativeAccumulator.h:24
IMP::Restraint
A restraint is a term in an IMP ScoringFunction.
Definition:
Restraint.h:56