home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.16.0
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
include
IMP
isd
version 2.16.0
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-2021 IMP Inventors. All rights reserved.
7
*
8
*/
9
10
#ifndef IMPISD_CROSS_LINK_MSRESTRAINT_H
11
#define IMPISD_CROSS_LINK_MSRESTRAINT_H
12
#include <IMP/isd/isd_config.h>
13
#include <
IMP/Restraint.h
>
14
#include <
IMP/particle_index.h
>
15
#include <
IMP/isd/Scale.h
>
16
17
IMPISD_BEGIN_NAMESPACE
18
19
//! A restraint for ambiguous cross-linking MS data and multiple state approach.
20
/** It marginalizes the false positive rate and depends on the expected fpr and
21
an uncertainty parameter beta.
22
*/
23
class
IMPISDEXPORT
CrossLinkMSRestraint
:
public
Restraint
{
24
25
IMP::ParticleIndexPairs
ppis_;
26
IMP::ParticleIndexPairs
sigmass_;
27
IMP::ParticleIndex
lengthi_;
28
IMP::ParticleIndexes
psis_;
29
double
length_;
30
double
slope_;
31
int
constr_;
32
bool
get_log_prob_;
33
34
double
sphere_cap(
float
r1,
float
r2,
float
d)
const
;
35
36
public
:
37
//! Create the restraint.
38
CrossLinkMSRestraint
(
IMP::Model
* m,
double
length,
39
bool
get_log_prob =
false
,
40
std::string name =
"CrossLinkMSRestraint%1%"
);
41
42
CrossLinkMSRestraint
(
IMP::Model
* m,
43
IMP::ParticleIndexAdaptor
lengthi,
44
bool
get_log_prob =
false
,
45
std::string name =
"CrossLinkMSRestraint%1%"
);
46
47
CrossLinkMSRestraint
(
IMP::Model
* m,
double
length,
double
slope,
48
bool
get_log_prob =
false
,
49
std::string name =
"CrossLinkMSRestraint%1%"
);
50
51
void
add_contribution(
const
IMP::ParticleIndexPair
& pps,
52
const
IMP::ParticleIndexPair
& sigmas,
53
IMP::ParticleIndex
psi) {
54
ppis_.push_back(pps);
55
sigmass_.push_back(sigmas);
56
psis_.push_back(psi);
57
}
58
59
double
get_probability()
const
;
60
61
//! Get the length of this restraint
62
/** Note that if the restraint was constructed with a length Scale,
63
this can change during sampling. */
64
double
get_length
()
const
{
65
if
(constr_ == 1) {
66
return
isd::Scale
(get_model(), lengthi_).get_scale();
67
}
else
{
68
return
length_;
69
}
70
}
71
72
double
get_slope()
const
{
return
slope_; }
73
74
//! Get the sigma particle indexes from a contribution
75
ParticleIndexPair
get_contribution_sigma_indexes
(
int
i)
const
{
76
return
sigmass_[i];
77
}
78
79
//! Get the psi particle index from a contribution
80
ParticleIndex
get_contribution_psi_index
(
int
i)
const
{
81
return
psis_[i];
82
}
83
84
//! Get the particle indexes from a contribution
85
ParticleIndexPair
get_contribution_particle_indexes
(
int
i)
const
{
86
return
ppis_[i];
87
}
88
89
unsigned
int
get_number_of_contributions()
const
{
return
ppis_.size(); }
90
91
virtual
double
unprotected_evaluate(
92
IMP::DerivativeAccumulator
* accum)
const
IMP_OVERRIDE
;
93
virtual
IMP::ModelObjectsTemp
do_get_inputs
() const
IMP_OVERRIDE
;
94
IMP_OBJECT_METHODS
(
CrossLinkMSRestraint
);
95
};
96
97
IMPISD_END_NAMESPACE
98
99
#endif
/* IMPISD_CROSS_LINK_MSRESTRAINT_H */
IMP::isd::CrossLinkMSRestraint
A restraint for ambiguous cross-linking MS data and multiple state approach.
Definition:
CrossLinkMSRestraint.h:23
particle_index.h
Functions and adaptors for dealing with particle indexes.
IMP::Array< 2, ParticleIndex >
IMP_OBJECT_METHODS
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition:
object_macros.h:25
IMP::ParticleIndexAdaptor
Take Decorator, Particle or ParticleIndex.
Definition:
particle_index.h:32
IMP::Index< ParticleIndexTag >
Scale.h
A decorator for scale parameters particles.
IMP::isd::Scale
Add scale parameter to particle.
Definition:
Scale.h:24
IMP::isd::CrossLinkMSRestraint::get_contribution_particle_indexes
ParticleIndexPair get_contribution_particle_indexes(int i) const
Get the particle indexes from a contribution.
Definition:
CrossLinkMSRestraint.h:85
IMP::Vector< ParticleIndexPair >
IMP::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
Model.h:73
IMP::isd::CrossLinkMSRestraint::get_contribution_sigma_indexes
ParticleIndexPair get_contribution_sigma_indexes(int i) const
Get the sigma particle indexes from a contribution.
Definition:
CrossLinkMSRestraint.h:75
IMP::isd::CrossLinkMSRestraint::get_length
double get_length() const
Get the length of this restraint.
Definition:
CrossLinkMSRestraint.h:64
Restraint.h
Abstract base class for all restraints.
IMP::isd::CrossLinkMSRestraint::get_contribution_psi_index
ParticleIndex get_contribution_psi_index(int i) const
Get the psi particle index from a contribution.
Definition:
CrossLinkMSRestraint.h:80
IMP::ModelObject::do_get_inputs
virtual ModelObjectsTemp do_get_inputs() const =0
IMP_OVERRIDE
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Definition:
compiler_macros.h:78
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:54