Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
scoring
SmoothEnvPairPotential.hh
Go to the documentation of this file.
1
// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2
// vi: set ts=2 noet:
3
//
4
// (c) Copyright Rosetta Commons Member Institutions.
5
// (c) This file is part of the Rosetta software suite and is made available under license.
6
// (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7
// (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8
// (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9
10
/// @file core/scoring/methods/SmoothEnvPairPotential.cc
11
/// @brief Smooth, differentiable version of centroid env and pair terms
12
/// @author Frank DiMaio
13
14
#ifndef INCLUDED_core_scoring_SmoothEnvPairPotential_hh
15
#define INCLUDED_core_scoring_SmoothEnvPairPotential_hh
16
17
#include <
core/scoring/SmoothEnvPairPotential.fwd.hh
>
18
19
#include <
core/conformation/Residue.fwd.hh
>
20
#include <
core/pose/Pose.fwd.hh
>
21
#include <
core/types.hh
>
22
23
#include <numeric/constants.hh>
24
25
#include <basic/datacache/CacheableData.hh>
26
27
// AUTO-REMOVED #include <ObjexxFCL/FArray1D.hh>
28
// AUTO-REMOVED #include <ObjexxFCL/FArray2D.hh>
29
// AUTO-REMOVED #include <ObjexxFCL/FArray3D.hh>
30
31
#include <utility/vector1_bool.hh>
32
33
#include <utility/vector1.hh>
34
#include <numeric/xyzVector.hh>
35
36
37
38
namespace
core {
39
namespace
scoring {
40
41
////////////////////////////////////////////////////////////////////////////////////////////////////
42
/// @brief Keep track of the cenlist information
43
/// stores both centroid counts (T = Real)
44
/// as well as d_centroid_counts (T = Vector)
45
template
<
class
T>
46
class
SigmoidWeightedCenList :
public
basic::datacache::CacheableData {
47
public
:
48
SigmoidWeightedCenList
():
calculated_
(false) {};
49
SigmoidWeightedCenList
(
SigmoidWeightedCenList
const
& src ) :
50
CacheableData() {
51
fcen6_
= src.fcen6_;
52
fcen10_
= src.fcen10_;
53
fcen12_
= src.fcen12_;
54
calculated_
= src.calculated_;
55
}
56
57
basic::datacache::CacheableDataOP
clone
()
const
{
58
return
new
SigmoidWeightedCenList
( *
this
);
59
}
60
61
Size
size
()
const
{
return
fcen6_
.size();}
62
63
T
fcen6
(
Size
const
seqpos )
const
{
return
fcen6_
[ seqpos ]; }
64
T
&
fcen6
(
Size
const
seqpos ) {
return
fcen6_
[ seqpos ]; }
65
66
T
fcen10
(
Size
const
seqpos )
const
{
return
fcen10_
[ seqpos ]; }
67
T
&
fcen10
(
Size
const
seqpos ) {
return
fcen10_
[ seqpos ]; }
68
69
T
fcen12
(
Size
const
seqpos )
const
{
return
fcen12_
[ seqpos ]; }
70
T
&
fcen12
(
Size
const
seqpos ) {
return
fcen12_
[ seqpos ]; }
71
72
bool
calculated
()
const
{
return
calculated_
; }
73
bool
&
calculated
() {
return
calculated_
; }
74
75
void
initialize
(
Size
nres,
T
val ) {
76
fcen6_
.resize( nres );
77
fcen10_
.resize( nres );
78
fcen12_
.resize( nres );
79
std::fill(
fcen6_
.begin(),
fcen6_
.end(), val );
80
std::fill(
fcen12_
.begin(),
fcen12_
.end(), val );
81
std::fill(
fcen10_
.begin(),
fcen10_
.end(), val );
82
}
83
84
// Setter functions
85
void
set_fcen6
(
Size
const
seqpos,
T
value ) {
86
fcen6_
[ seqpos ] = value;
87
}
88
89
void
set_fcen10
(
Size
const
seqpos,
T
value ) {
90
fcen10_
[ seqpos ] = value;
91
}
92
93
void
set_fcen12
(
Size
const
seqpos,
T
value ) {
94
fcen12_
[ seqpos ] = value;
95
}
96
97
private
:
98
utility::vector1< T >
fcen6_
;
99
utility::vector1< T >
fcen10_
;
100
utility::vector1< T >
fcen12_
;
101
bool
calculated_
;
102
};
103
104
105
106
///////////////////////////////////////////////////////////////////////////////////////////////
107
108
109
110
////////////////////////
111
// fpd helper class holds some # of gaussian + sigmoid coeffs + a shift
112
class
SmoothScoreTermCoeffs
{
113
public
:
114
SmoothScoreTermCoeffs
() :
shift_
(0.0) {}
115
116
void
add_sigmoid
(
numeric::xyzVector< Real >
s_in ) {
117
sigmoid_coeffs_
.push_back( s_in );
118
}
119
void
add_gaussian
(
numeric::xyzVector< Real >
g_in ) {
120
// normalize gaussian
121
g_in[0] /= sqrt(2*numeric::constants::f::pi*g_in[2]*g_in[2]);
122
gaussian_coeffs_
.push_back( g_in );
123
}
124
void
shift
(
Real
s_in) {
shift_
=s_in; }
125
126
Size
nsigmoids
() {
return
sigmoid_coeffs_
.size(); }
127
Size
ngaussians
() {
return
gaussian_coeffs_
.size(); }
128
129
numeric::xyzVector< Real >
sigmoid
(
Size
i ) {
130
return
sigmoid_coeffs_
[i];
131
}
132
numeric::xyzVector< Real >
gaussian
(
Size
i ) {
133
return
gaussian_coeffs_
[i];
134
}
135
Real
shift
() {
return
shift_
; }
136
137
void
clear
() {
138
sigmoid_coeffs_
.clear();
139
gaussian_coeffs_
.clear();
140
shift_
= 0;
141
}
142
143
Real
func
(
Real
x )
const
;
144
Real
dfunc
(
Real
x )
const
;
145
146
private
:
147
utility::vector1< numeric::xyzVector< Real >
>
sigmoid_coeffs_
;
148
utility::vector1< numeric::xyzVector< Real >
>
gaussian_coeffs_
;
149
Real
shift_
;
150
};
151
152
////////////////////////
153
////////////////////////
154
155
class
SmoothEnvPairPotential
:
public
utility::pointer::ReferenceCount
{
156
public
:
157
SmoothEnvPairPotential
();
158
159
///
160
void
161
compute_centroid_environment
(
162
pose::Pose
& pose
163
)
const
;
164
165
///
166
void
167
compute_dcentroid_environment
(
168
pose::Pose
& pose
169
)
const
;
170
171
void
172
finalize
(
pose::Pose
& pose )
const
;
173
174
///
175
void
176
evaluate_env_and_cbeta_scores
(
177
pose::Pose
const
& pose,
178
conformation::Residue
const
& rsd,
179
Real
& env_score,
180
Real
& cb_score6,
181
Real
& cb_score12
182
)
const
;
183
184
///
185
void
186
evaluate_pair_and_cenpack_score
(
187
conformation::Residue
const
& rsd1,
188
conformation::Residue
const
& rsd2,
189
Real
const
cendist,
190
Real
& pair_contribution,
191
Real
& cenpack_contribution
192
)
const
;
193
194
///
195
void
196
evaluate_env_and_cbeta_deriv
(
197
pose::Pose
const
& pose,
198
conformation::Residue
const
& rsd,
199
numeric::xyzVector<Real>
& d_env_score,
200
numeric::xyzVector<Real>
& d_cb_score6,
201
numeric::xyzVector<Real>
& d_cb_score12
202
)
const
;
203
204
///
205
void
206
evaluate_pair_and_cenpack_deriv
(
207
conformation::Residue
const
& rsd1,
208
conformation::Residue
const
& rsd2,
209
Real
const
cendist,
210
Real
& d_pair,
211
Real
& d_cenpack
212
)
const
;
213
214
protected
:
215
Real
cen_dist_cutoff_12_pad
;
216
217
SigmoidWeightedCenList< Real >
const
&
cenlist_from_pose
(
pose::Pose
const
& )
const
;
218
SigmoidWeightedCenList< Real >
&
nonconst_cenlist_from_pose
(
pose::Pose
& )
const
;
219
220
SigmoidWeightedCenList< numeric::xyzVector<Real>
>
const
&
dcenlist_from_pose
(
pose::Pose
const
& )
const
;
221
SigmoidWeightedCenList< numeric::xyzVector<Real>
> &
nonconst_dcenlist_from_pose
(
pose::Pose
& )
const
;
222
223
private
:
224
225
void
226
fill_smooth_cenlist
(
227
SigmoidWeightedCenList< Real >
& cenlist,
228
Size
const
res1,
229
Size
const
res2,
230
Real
const
cendist
231
)
const
;
232
233
void
234
fill_smooth_dcenlist
(
235
SigmoidWeightedCenList
<
numeric::xyzVector<Real>
> & dcenlist,
236
Size
const
res1,
237
Size
const
res2,
238
numeric::xyzVector<Real>
const
cendist
239
)
const
;
240
241
//fpd no need for this function anymore; functions are all defined (and well behaved) over all x
242
//void truncate_cenlist_values( SigmoidWeightedCenList & cenlist ) const;
243
244
private
:
// data
245
//fpd --- just store the coefficients and compute as needed
246
SmoothScoreTermCoeffs
cbeta6_
;
247
SmoothScoreTermCoeffs
cbeta12_
;
248
SmoothScoreTermCoeffs
cenpack_
;
249
utility::vector1< SmoothScoreTermCoeffs >
env_
;
// for each restype
250
utility::vector1< utility::vector1< SmoothScoreTermCoeffs >
>
pair_
;
// for each restype pair
251
};
252
253
}
// ns scoring
254
}
// ns core
255
256
#endif
Generated on Sat Jun 1 2013 11:40:17 for Rosetta 3.5 by
1.8.4