IMP
2.0.1
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
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-2013 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
<score_functor::Statistical<Key,
61
BIPARTITE,
62
INTERPOLATE,
63
SPARSE> > {
64
typedef
score_functor::Statistical
<Key,
65
BIPARTITE,
66
INTERPOLATE,
67
SPARSE>
S
;
68
typedef
score_functor::DistancePairScore<S >
P
;
69
public
:
70
/** \param[in] k The attribute to use for determining the particle types
71
\param[in] threshold The maximum distance to score
72
\param[in] data_file Where to load the file from.
73
*/
74
StatisticalPairScore
(
IntKey
k,
75
double
threshold,
76
base::TextInput
data_file):
77
P
(
S
(k, threshold, data_file))
78
{ }
79
/** \param[in] k The attribute to use for determining the particle types
80
\param[in] threshold The maximum distance to score
81
\param[in] data_file Where to load the file from.
82
\param[in] shift The offset for the types of the second set of types.
83
eg, if the score is on protein and ligand atoms, the ligand atom types
84
start with the value shift.
85
*/
86
StatisticalPairScore
(
IntKey
k,
87
double
threshold,
88
base::TextInput
data_file,
89
unsigned
int
shift):
P
(
S
(k, threshold, data_file, shift))
90
{}
91
};
92
IMPCORE_END_NAMESPACE
93
94
#endif
/* IMPCORE_STATISTICAL_PAIR_SCORE_H */