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
protocols
loops
loop_mover
refine
LoopRefineInnerCycle.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
6
// (c) under license. The Rosetta software is developed by the contributing
7
// (c) members of the Rosetta Commons. For more information, see
8
// (c) http://www.rosettacommons.org. Questions about this can be addressed to
9
// (c) University of Washington UW TechTransfer,email:license@u.washington.edu.
10
11
/// @file protocols/loops/loop_mover/refine/LoopRefineInnerCycle.cc
12
/// @brief Abstract class to define interface for all types of "inner cycle" operations used for loop refinement.
13
/// @detailed
14
///
15
/// @author Brian D. Weitzner ( brian.weitzner@gmail.com )
16
17
// Unit headers
18
#include <
protocols/loops/loop_mover/refine/LoopRefineInnerCycle.hh
>
19
20
// Package headers
21
// #include <protocols/loops/loop_mover/LoopMover.hh>
22
#include <
protocols/loops/loop_mover/refine/LoopMover_CCD.hh
>
23
#include <
protocols/loops/Loops.hh
>
24
25
// Project headers
26
#include <
core/kinematics/MoveMap.hh
>
27
#include <
core/pack/task/TaskFactory.hh
>
28
#include <
core/pose/Pose.hh
>
29
#include <
core/scoring/ScoreFunction.hh
>
30
#include <
protocols/moves/MonteCarlo.hh
>
31
32
// Basic headers
33
#include <basic/options/keys/loops.OptionKeys.gen.hh>
34
#include <basic/options/option.hh>
35
#include <basic/Tracer.hh>
36
37
// Utility headers
38
#include <utility/excn/Exceptions.hh>
39
#include <utility/vector1.hh>
40
41
static
basic::Tracer
TR
(
"protocols.loops.loop_mover.refine.LoopRefineInnerCycle"
);
42
using namespace
core;
43
44
namespace
protocols {
45
namespace
loops {
46
namespace
loop_mover {
47
namespace
refine {
48
49
///////////////////////////////////////////////////////////////////////////////////////////////////////
50
////////////////////////////////////////////// BOILER PLATE CODE //////////////////////////////////////
51
///////////////////////////////////////////////////////////////////////////////////////////////////////
52
53
///@brief default constructor
54
LoopRefineInnerCycle::LoopRefineInnerCycle() : Mover()
55
{
56
init
();
57
}
58
59
///@brief copy constructor
60
LoopRefineInnerCycle::LoopRefineInnerCycle
(
LoopRefineInnerCycle
const
& rhs ) : Mover(rhs)
61
{
62
init_for_equal_operator_and_copy_constructor
( *
this
, rhs );
63
}
64
65
///@brief assignment operator
66
LoopRefineInnerCycle
&
LoopRefineInnerCycle::operator=
(
LoopRefineInnerCycle
const
& rhs ){
67
//abort self-assignment
68
if
(
this
== &rhs )
return
*
this
;
69
Mover::operator=( rhs );
70
init_for_equal_operator_and_copy_constructor
( *
this
, rhs );
71
return
*
this
;
72
}
73
74
//destructor
75
LoopRefineInnerCycle::~LoopRefineInnerCycle
() {}
76
77
/// @brief Each derived class must specify its name.
78
std::string
LoopRefineInnerCycle::get_name
()
const
79
{
80
return
type
();
81
}
82
83
///@brief This mover retains state such that a fresh version is needed if the input Pose is about to change
84
bool
LoopRefineInnerCycle::reinitialize_for_new_input
()
const
85
{
86
return
true
;
87
}
88
89
void
LoopRefineInnerCycle::register_options
()
90
{
91
/// PUT THE LIST OF OPTIONS THAT ARE USED HERE ///
92
93
/// RECURSIVELY CALL REGISTER OPTIONS ON ALL MOVERS THAT THIS CLASS HAS AN OWNING_PTR TO ///
94
}
95
///////////////////////////////////////////////////////////////////////////////////////////////////////
96
/////////////////////////////////////// END OF BOILER PLATE CODE //////////////////////////////////////
97
///////////////////////////////////////////////////////////////////////////////////////////////////////
98
99
// constructor with arguments
100
LoopRefineInnerCycle::LoopRefineInnerCycle
(
101
LoopMover_Refine_CCDAP
loop_mover,
102
moves::MonteCarloOP
mc,
103
core::scoring::ScoreFunctionOP
scorefxn,
104
core::pack::task::TaskFactoryOP
tf
105
) : Mover()
106
{
107
init
( loop_mover, mc, scorefxn, tf );
108
}
109
void
LoopRefineInnerCycle::setup_objects
(
Pose
const
&
/* pose */
)
110
{
111
TR
<<
"Setting up data for "
+
get_name
() +
"."
<< std::endl;
112
113
/// Perform some sanity checks to ensure the data integrity before moving forward
114
using
utility::excn::EXCN_Msg_Exception;
115
116
if
(!
scorefxn_
) {
117
throw
EXCN_Msg_Exception(
"No ScoreFunction available in "
+
get_name
() +
"."
);
118
}
119
120
if
(!
tf_
) {
121
throw
EXCN_Msg_Exception(
"No TaskFactory available in "
+
get_name
() +
"."
);
122
}
123
124
if
(!
mc_
) {
125
throw
EXCN_Msg_Exception(
"No MonteCarlo instance available in "
+
get_name
() +
"."
);
126
}
127
128
if
(!
loop_mover_that_owns_me_
) {
129
throw
EXCN_Msg_Exception(
"No parent LoopMover available in "
+
get_name
() +
". This is needed to provide information on the progress of the simulation."
);
130
}
131
}
132
133
void
LoopRefineInnerCycle::init
()
134
{
135
init
( NULL, NULL, NULL, NULL );
136
}
137
138
void
LoopRefineInnerCycle::init
(
139
LoopMover_Refine_CCDAP
loop_mover,
140
moves::MonteCarloOP
mc,
141
core::scoring::ScoreFunctionOP
scorefxn,
142
core::pack::task::TaskFactoryOP
tf
143
) {
144
loop_mover_that_owns_me_
=
loop_mover
;
145
mc_
=
mc
;
146
scorefxn_
=
scorefxn
;
147
tf_
= tf;
148
149
type
(
"LoopRefineInnerCycle"
);
150
init_options
();
151
}
152
153
void
LoopRefineInnerCycle::init_for_equal_operator_and_copy_constructor
(
154
LoopRefineInnerCycle
& lhs,
155
LoopRefineInnerCycle
const
& rhs
156
)
157
{
158
// copy all data members from rhs to lhs
159
lhs.
debug_
= rhs.
debug_
;
160
lhs.
loop_mover_that_owns_me_
= rhs.
loop_mover_that_owns_me_
;
161
lhs.
mc_
= rhs.
mc_
;
162
lhs.
scorefxn_
= rhs.
scorefxn_
;
163
lhs.
tf_
= rhs.
tf_
;
164
lhs.
movemap_
= rhs.
movemap_
;
165
}
166
167
void
LoopRefineInnerCycle::init_options
()
168
{
169
using namespace
basic::options;
170
171
// Set options here.
172
set_debug
( option[
OptionKeys::loops::debug
].user() );
173
}
174
175
bool
LoopRefineInnerCycle::debug
()
const
176
{
177
return
debug_
;
178
}
179
180
void
LoopRefineInnerCycle::set_debug
(
bool
debug
)
181
{
182
debug_
=
debug
;
183
}
184
185
moves::MonteCarloOP
LoopRefineInnerCycle::mc
()
const
186
{
187
return
mc_
;
188
}
189
190
void
LoopRefineInnerCycle::set_mc
(
moves::MonteCarloOP
mc
)
191
{
192
mc_
=
mc
;
193
}
194
195
core::scoring::ScoreFunctionOP
LoopRefineInnerCycle::scorefxn
()
const
196
{
197
return
scorefxn_
;
198
}
199
200
void
LoopRefineInnerCycle::set_scorefxn
(
core::scoring::ScoreFunctionOP
scorefxn
)
201
{
202
scorefxn_
=
scorefxn
;
203
}
204
205
core::pack::task::TaskFactoryOP
LoopRefineInnerCycle::task_factory
()
const
206
{
207
return
tf_
;
208
}
209
210
void
LoopRefineInnerCycle::set_task_factory
(
core::pack::task::TaskFactoryOP
tf )
211
{
212
tf_
= tf;
213
}
214
215
core::kinematics::MoveMapOP
LoopRefineInnerCycle::movemap
()
const
216
{
217
// Lazily instantiate a movemap
218
if
(!
movemap_
){
movemap_
=
new
kinematics::MoveMap
; }
219
return
movemap_
;
220
}
221
222
void
LoopRefineInnerCycle::set_movemap
(
core::kinematics::MoveMapOP
movemap
)
223
{
224
movemap_
=
movemap
;
225
}
226
227
Loops
LoopRefineInnerCycle::get_one_random_loop
()
const
228
{
229
Loops::const_iterator
it(
loop_mover
()->loops()->one_random_loop() );
230
Loops
one_loop;
231
one_loop.
add_loop
( it );
232
return
one_loop;
233
}
234
235
LoopMover_Refine_CCDAP
LoopRefineInnerCycle::loop_mover
()
const
236
{
237
return
loop_mover_that_owns_me_
;
238
}
239
240
void
LoopRefineInnerCycle::set_loop_mover
(
LoopMover_Refine_CCDAP
new_owner_in_town )
241
{
242
loop_mover_that_owns_me_
= new_owner_in_town;
243
}
244
245
void
246
LoopRefineInnerCycle::show
( std::ostream & out )
247
{
248
out << *
this
;
249
}
250
251
std::ostream &
operator<<
(std::ostream& out,
LoopRefineInnerCycle
const
& loop_refine_inner_cycle )
252
{
253
out << loop_refine_inner_cycle.
get_name
() <<
" is an abstract class. Only subclasses can be used."
<< std::endl;
254
return
out;
255
}
256
257
}
// namespace refine
258
}
// namespace loop_mover
259
}
// namespace loops
260
}
// namespace protocols
Generated on Sat Jun 1 2013 11:58:54 for Rosetta 3.5 by
1.8.4