24 #include <numeric/xyz.functions.hh>
26 #include <boost/foreach.hpp>
27 #define foreach BOOST_FOREACH
30 #include <numeric/random/random.hh>
32 #include <basic/Tracer.hh>
35 #include <utility/vector0.hh>
36 #include <utility/vector1.hh>
37 #include <utility/excn/Exceptions.hh>
38 #include <utility/tag/Tag.hh>
46 static numeric::random::RandomGenerator
RG(456732);
47 static basic::Tracer
TR(
"protocols.rigid.RollMover" );
63 coords.resize( nres );
65 for (
Size i=1; i<= nres; ++i ) {
67 core::Size const number_atoms_this_residue( rsd.natoms() );
68 if ( number_atoms_this_residue ) {
69 coords[i].resize( number_atoms_this_residue );
70 for (
Size j=1; j <= number_atoms_this_residue; ++j ) {
71 coords[i][j] = rsd.atom( j ).xyz();
76 angle_ = min_angle_ + ( max_angle_ - min_angle_ ) *
RG.uniform();
79 for (
core::Size i =start_res_; i <= stop_res_; ++i ) {
80 for (
core::Size j = 1; j <= coords[i].size(); ++j ) {
86 coords[i][j] = coords[i][j] - translate_;
87 coords[i][j] = rotation_matrix * coords[i][j];
88 coords[i][j] = coords[i][j] + translate_;
94 for (
core::Size i =start_res_; i <= stop_res_; ++i ) {
95 for (
core::Size j = 1; j <= coords[i].size(); ++j ) {
97 pose.
set_xyz(
id, coords[i][j]);
108 min_angle_ = min_angle;
109 max_angle_ = max_angle;
113 RollMover::get_name()
const {
118 RollMover::parse_my_tag(
126 start_res_ = ( tag->hasOption(
"start_res") ) ? tag->getOption<
core::Size>(
"start_res") : 1;
130 if( tag->hasOption(
"min_angle") ) {
131 min_angle_ = tag->getOption<
core::Real>(
"min_angle");
133 throw utility::excn::EXCN_RosettaScriptsOption(
"RollMover requires min_angle option");
137 if( tag->hasOption(
"max_angle") ) {
138 max_angle_ = tag->getOption<
core::Real>(
"max_angle");
140 throw utility::excn::EXCN_RosettaScriptsOption(
"RollMover requires max_angle option");
143 bool axis_option_parsed =
false;
144 bool translate_option_parsed =
false;
146 if( tag->hasOption(
"axis") ) {
147 switch(tag->getOption<
char>(
"axis")) {
158 axis_option_parsed =
true;
164 if( name ==
"axis" ) {
167 axis_option_parsed =
true;
168 }
else if ( name ==
"translate") {
171 translate_option_parsed =
true;
176 if ( !axis_option_parsed ) {
177 throw utility::excn::EXCN_RosettaScriptsOption(
"RollMover requires axis option");
179 if ( !translate_option_parsed ) {
181 TR <<
"No translation given, using the pose's center of mass" << std::endl;
188 RollMoverCreator::keyname()
const
190 return RollMoverCreator::mover_name();
194 RollMoverCreator::mover_name()
201 RollMoverCreator::create_mover()
const {
207 RollMover::fresh_instance()
const
220 RollMover::RollMover(
235 start_res_(start_res),
237 min_angle_(min_angle),
238 max_angle_(max_angle),
240 translate_(translate)