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
pack
dunbrack
DunbrackConstraint.cc
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/pack/dunbrack/DunbrackConstraint.cc
11
/// @brief
12
/// @author James Thompson
13
14
// Unit headers
15
#include <
core/pack/dunbrack/DunbrackConstraint.hh
>
16
#include <
core/pack/dunbrack/DunbrackConstraintCreator.hh
>
17
18
19
#include <
core/id/AtomID.hh
>
20
#include <
core/scoring/ScoreType.hh
>
21
#include <
core/scoring/EnergyMap.hh
>
22
#include <
core/pack/dunbrack/RotamerLibrary.hh
>
23
#include <
core/scoring/constraints/XYZ_Func.hh
>
24
25
#include <basic/Tracer.hh>
26
// AUTO-REMOVED #include <basic/options/option.hh>
27
28
#include <utility/vector1.hh>
29
30
31
namespace
core {
32
namespace
pack {
33
namespace
dunbrack {
34
35
static
basic::Tracer
TR
(
"core.pack.dunbrack.DunbrackConstraint"
);
36
37
DunbrackConstraintCreator::DunbrackConstraintCreator
() {}
38
DunbrackConstraintCreator::~DunbrackConstraintCreator
() {}
39
40
scoring::constraints::ConstraintOP
41
DunbrackConstraintCreator::create_constraint
()
const
{
42
return
new
DunbrackConstraint
;
43
}
44
45
std::string
DunbrackConstraintCreator::keyname
()
const
46
{
47
return
"Dunbrack"
;
48
}
49
50
DunbrackConstraint::DunbrackConstraint
() :
51
Constraint
( core::scoring::
dunbrack_constraint
),
52
bonus_( 0 ),
53
seqpos_( 0 ),
54
rot_vec_pos_( 0 ),
55
rot_bin_( 0 )
56
{}
57
58
DunbrackConstraint::~DunbrackConstraint
() {}
59
60
std::string
61
DunbrackConstraint::type
()
const
{
62
return
"Dunbrack"
;
63
}
64
65
Size
66
DunbrackConstraint::natoms
()
const
{
67
return
atom_ids_
.size();
68
}
69
70
id::AtomID
const
&
71
DunbrackConstraint::atom
(
Size
const
index )
const
{
72
return
atom_ids_
[index];
73
}
74
75
scoring::constraints::ConstraintOP
76
DunbrackConstraint::clone
()
const
{
77
return
new
DunbrackConstraint
( *
this
);
78
}
79
80
// Calculates a score for this constraint using XYZ_Func, and puts the
81
// UNWEIGHTED score into emap. Although the current set of weights currently is
82
// provided, Constraint objects should put unweighted scores into emap.
83
void
84
DunbrackConstraint::score
(
85
scoring::constraints::XYZ_Func
const
& xyz_func,
86
scoring::EnergyMap
const
& weights,
87
scoring::EnergyMap
& emap
88
)
const
{
89
if
( weights[ this->
score_type
() ] == 0 )
return
;
// what's the point?
90
91
conformation::Residue
const
& rsd( xyz_func.
residue
(
seqpos_
) );
92
93
pack::dunbrack::RotVector
rot
;
94
pack::dunbrack::rotamer_from_chi
( rsd, rot );
95
// don't try to restrain angles that don't exist
96
if
( rot.size() >
rot_vec_pos_
)
return
;
97
if
( rot[
rot_vec_pos_
] ==
rot_bin_
) {
98
emap[ this->
score_type
() ] +=
bonus_
;
99
}
100
}
101
102
void
103
DunbrackConstraint::fill_f1_f2
(
104
AtomID
const
& ,
//atom,
105
scoring::constraints::XYZ_Func
const
&,
106
Vector
& ,
//F1,
107
Vector
& ,
//F2,
108
scoring::EnergyMap
const
&
//weights
109
)
const
{
110
// Do nothing.
111
// Derivative of this restraint is effectively zero (because it's constant
112
// within each rotamer well), so we just "add zero" to F1 and F2.
113
// APL Note: these derivatives will be wrong for phi and psi, since a change in phi or psi
114
// will cause a change in the energy of the lowest rotamer in a well. This ought to be fixed.
115
}
116
117
void
DunbrackConstraint::show
( std::ostream & out )
const
{
118
out <<
type
() <<
" "
<<
seqpos_
119
<<
" "
<<
rot_vec_pos_
<<
" "
<<
rot_bin_
120
<<
" "
<<
bonus_
;
121
out << std::endl;
122
}
123
124
/// @brief Format should look like:
125
/// Dunbrack seqpos_ rot_vec_pos_ rot_bin_ bonus_
126
void
DunbrackConstraint::read_def
(
127
std::istream & in,
128
pose::Pose
const
&
/* pose */
,
129
scoring::constraints::FuncFactory
const
&
/* func_factory */
130
) {
131
in >>
seqpos_
>>
rot_vec_pos_
>>
rot_bin_
>>
bonus_
;
132
if
(
seqpos_
== 0 ||
rot_vec_pos_
== 0 ||
rot_bin_
== 0 || bonus_ == 0 ) {
133
in.setstate( std::ios_base::failbit );
134
}
135
}
136
137
}
// namespace constraints
138
}
// namespace scoring
139
}
// namespace core
Generated on Sat Jun 1 2013 11:33:13 for Rosetta 3.5 by
1.8.4