home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.22.0
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
include
IMP
core
version 2.22.0
StatisticalPairScore.h
Go to the documentation of this file.
1
/**
2
* \file IMP/core/StatisticalPairScore.h
3
* \brief Functions to read mol2s
4
*
5
* Copyright 2007-2022 IMP Inventors. All rights reserved.
6
*
7
*/
8
9
#ifndef IMPCORE_STATISTICAL_PAIR_SCORE_H
10
#define IMPCORE_STATISTICAL_PAIR_SCORE_H
11
12
#include <IMP/core/core_config.h>
13
#include <
IMP/generic.h
>
14
#include <
IMP/Model.h
>
15
#include <
IMP/score_functor/DistancePairScore.h
>
16
#include <
IMP/score_functor/Statistical.h
>
17
#include <
IMP/Particle.h
>
18
#include <
IMP/PairScore.h
>
19
#include <
IMP/algebra/Vector3D.h
>
20
#include "
XYZ.h
"
21
#include <
IMP/file.h
>
22
#include <limits>
23
24
IMPCORE_BEGIN_NAMESPACE
25
/** Create a pairwise statistical potential from a file. The Keys passed
26
as a template argument are used to determine how to map the names of
27
the types as described in the loaded file to indexes. That is, if
28
atom::ResidueKey is passed as the Keys, the potential will expect a file
29
which has one line for each pair of residue names.
30
31
The expected file format is:
32
\verbatim
33
bin_width number_a number_b [offset]
34
key_0a key_0b bin0 bin1 bin2...
35
key_1a key_1b bin0 bin1 bin2...
36
\endverbatim
37
38
The order of the lines (after the first one) does not matter.
39
The bin_width is how much distance is allocated per bin (the distance used
40
is that between the points). number_a and number_b are the numbers of
41
particle types (number_b should only be specified if BIPARTITE is set).
42
43
\note The values read in the file are for bins. That is, the first bin
44
is from offset to offset+width. The second is offset+width to offset+
45
2width.
46
As a result, when interpolation is used, the function achieves the
47
bin value at the center of the bin.
48
49
\param[in] Key is an IMP::Key which maps between names and indices
50
\param[in] BIPARTITE If true, the two sets of particles being stored are
51
different (e.g. a protein atom and a ligand atom), otherwise they are
52
assumed to both be the same. Appropriate values must be provided
53
in the file.
54
\param[in] INTERPOLATE If true, even the scores without derivatives are
55
spline interpolated. If false, only the evaluation of derivatives is
56
interpolated with a spline.
57
*/
58
template
<
class
Key,
bool
BIPARTITE,
bool
INTERPOLATE,
bool
SPARSE = false>
59
class
StatisticalPairScore
60
:
public
score_functor::DistancePairScore
<
61
score_functor::Statistical<Key, BIPARTITE, INTERPOLATE, SPARSE> > {
62
typedef
score_functor::Statistical<Key, BIPARTITE, INTERPOLATE, SPARSE>
S
;
63
typedef
score_functor::DistancePairScore<S>
P
;
64
65
public
:
66
/** \param[in] k The attribute to use for determining the particle types
67
\param[in] threshold The maximum distance to score
68
\param[in] data_file Where to load the file from.
69
*/
70
StatisticalPairScore
(
IntKey
k,
double
threshold,
TextInput
data_file)
71
:
P
(
S
(k, threshold, data_file)) {}
72
/** \param[in] k The attribute to use for determining the particle types
73
\param[in] threshold The maximum distance to score
74
\param[in] data_file Where to load the file from.
75
\param[in] shift The offset for the types of the second set of types.
76
eg, if the score is on protein and ligand atoms, the ligand atom types
77
start with the value shift.
78
*/
79
StatisticalPairScore
(
IntKey
k,
double
threshold,
TextInput
data_file,
80
unsigned
int
shift)
81
:
P
(
S
(k, threshold, data_file, shift)) {}
82
};
83
IMPCORE_END_NAMESPACE
84
85
#endif
/* IMPCORE_STATISTICAL_PAIR_SCORE_H */
DistancePairScore.h
A Score on the distance between a pair of particles.
IMP::core::StatisticalPairScore::StatisticalPairScore
StatisticalPairScore(IntKey k, double threshold, TextInput data_file, unsigned int shift)
Definition:
StatisticalPairScore.h:79
Model.h
Storage of a model, its restraints, constraints and particles.
file.h
Handling of file input/output.
IMP::core::StatisticalPairScore
Definition:
StatisticalPairScore.h:59
IMP::core::StatisticalPairScore::StatisticalPairScore
StatisticalPairScore(IntKey k, double threshold, TextInput data_file)
Definition:
StatisticalPairScore.h:70
IMP::score_functor::DistancePairScore
Create efficient distance-based pair scores.
Definition:
score_functor/DistancePairScore.h:31
IMP::TextInput
Definition:
file.h:89
XYZ.h
Simple XYZ decorator.
IMP::score_functor::Statistical
Definition:
Statistical.h:53
PairScore.h
Define PairScore.
IMP::Key< 1 >
Particle.h
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Vector3D.h
Simple 3D vector class.
generic.h
Compile-time generic restraint and constraint support.
Statistical.h
A Score on the distance between a pair of particles.