28 #include <basic/Tracer.hh>
30 #include <utility/vector1.hh>
35 namespace rotamer_set_operations {
37 static basic::Tracer
tr(
"protocols.toolbox.RotamerSetOperations.RigidBodyMoveRotSetOps");
47 using namespace core::pack::rotamer_set;
51 tr.Debug <<
"alter_rotamer_set with multiple rotamer types in source set: " << rotamer_set.
get_n_residue_types() << std::endl;
56 tr.Error <<
"alter_rotamer_set called at designed position: " << rotamer_set.
resid() << std::endl;
67 tr.Debug <<
"At seqpos " << sequence_position <<
" generated " << rigid_body_confs.size() <<
" alternate rb conformations." << std::endl;
69 if (rigid_body_confs.size() == 0 )
return;
77 concrete_residue = (*rotamer_set.
begin())->type();
81 concrete_residue = pose.
residue( sequence_position ).
type();
84 for (
core::Size i = 1; i <= rigid_body_confs.size(); i++)
86 runtime_assert( rigid_body_confs[i]->name3() == pose.
residue( sequence_position ).
name3() );
90 bool cast_succesful( dynamic_cast< core::pack::rotamer_set::RotamerSet_ * > (& rotamer_set) );
98 if( cast_succesful ) {
100 for (
Size ii = 1; ii <= concrete_residue->nchi(); ++ii ) {
101 rotset.
set_extra_samples( ptask, nneighbs, ii, concrete_residue, extra_chi_steps[ ii ] );
112 tr.Debug <<
"At seqpos " << sequence_position <<
" retrieved rotamer library." << std::endl;
116 tr.Debug <<
"At seqpos " << sequence_position <<
" no rotamer library." << std::endl;
121 for(
core::Size i = 1; i <= rigid_body_confs.size(); ++i )
133 rotlib->fill_rotamer_vector( pose, sfxn, ptask, packer_neighbor_graph, concrete_residue, existing_residue, extra_chi_steps, buried, suggested_rotamers_this_rbconf);
139 currot->orient_onto_residue( existing_residue );
140 suggested_rotamers_this_rbconf.push_back( currot );
144 for(
core::Size j = 1; j<= suggested_rotamers_this_rbconf.size(); ++j )
153 switch ( decision ) {
155 new_rots.push_back( new_rot );
158 runtime_assert ( new_rots.size() > 0 );
159 new_rots[ new_rots.size() ] = new_rot;
167 new_rots.push_back( new_rot );
173 for(
core::Size i = 1; i <= new_rots.size(); ++i)
179 "At seqpos " << sequence_position <<
" " <<
180 new_rots.size() <<
" rotamers were added to rotamer set that now contains " <<
181 rotamer_set.
num_rotamers() <<
" rotamers." << std::endl;
201 if( alternate_confs.size() > 0 )
203 runtime_assert( target_res.
name3() == alternate_confs[1]->name3() );
209 for(
Size i = 1; i <= alternate_confs.size(); ++i){
210 core::Vector dist_vect( center_pos - alternate_confs[i]->
xyz( nbr_atom ) );
211 core::Real sq_dist( dist_vect.length_squared() );
212 if( sq_dist > max_sq_dist ) max_sq_dist = sq_dist;
215 return std::sqrt( max_sq_dist );
227 seqpos_(other.seqpos_),
228 rigid_body_confs_(other.rigid_body_confs_)
242 runtime_assert(residue_index ==
seqpos_);