51 #include <basic/Tracer.hh>
55 #include <numeric/conversions.hh>
56 #include <numeric/xyz.functions.hh>
59 #include <utility/vector1.hh>
66 static basic::Tracer
TR(
"protocols.simple_moves.ConstrainToIdealMover" );
69 namespace simple_moves {
107 : protocols::moves::
Mover(
"ConstrainToIdealMover"),
109 mm_(new core::kinematics::MoveMap()),
110 supplied_movemap_(false)
123 if (
this == &rhs)
return *
this;
134 return "ConstrainToIdealMover";
185 utility::vector1< std::pair< core::id::AtomID, core::id::AtomID > > & bonded_atom_list ) {
187 for (
core::Size n = 1; n <= bonded_atom_list.size(); n++ ) {
188 if( atom_id1 == bonded_atom_list[ n ].first && atom_id2 == bonded_atom_list[ n ].second )
return true;
189 if( atom_id2 == bonded_atom_list[ n ].first && atom_id1 == bonded_atom_list[ n ].second )
return true;
202 for (
core::Size n = 1; n <= bond_angle_list.size(); n++ ) {
203 if( atom_id1 == bond_angle_list[ n ].first ) {
204 if( atom_id2 == bond_angle_list[ n ].second.first && atom_id3 == bond_angle_list[ n ].second.second )
return true;
205 if( atom_id3 == bond_angle_list[ n ].second.first && atom_id2 == bond_angle_list[ n ].second.second )
return true;
216 utility::vector1< std::pair< core::id::AtomID, core::id::AtomID > > & bonded_atom_list,
222 using namespace core::scoring;
223 using namespace core::scoring::constraints;
228 if ( !pose_reference.
residue( atom_id1.
rsd() ).has( atom_name1 ) )
return;
229 if ( !pose_reference.
residue( atom_id2.
rsd() ).has( atom_name2 ) )
return;
232 bonded_atom_list.push_back( std::make_pair( atom_id1, atom_id2 ) );
237 pose_reference.
residue( atom_id2.
rsd() ).
xyz( atom_name2 ) ).length();
247 TR <<
"PUTTING CONSTRAINT ON DISTANCE: " <<
248 atom_id2.
rsd() <<
" " << atom_name1 <<
"; " <<
249 atom_id1.
rsd() <<
" " << atom_name2 <<
" " <<
270 using namespace core::scoring;
271 using namespace core::scoring::constraints;
272 using namespace numeric::conversions;
274 if (atom_id2 == atom_id3)
return;
280 if ( !pose_reference.
residue( atom_id1.
rsd() ).has( atom_name1 ) )
return;
281 if ( !pose_reference.
residue( atom_id2.
rsd() ).has( atom_name2 ) )
return;
282 if ( !pose_reference.
residue( atom_id3.
rsd() ).has( atom_name3 ) )
return;
285 bond_angle_list.push_back( std::make_pair( atom_id1, std::make_pair( atom_id2, atom_id3 ) ) );
288 core::Real const bond_angle_sd_( radians( 5.0 ) );
296 if (bond_angle < 0.001 )
TR <<
"WHAT THE HELL????????? " << std::endl;
303 TR <<
"PUTTING CONSTRAINT ON ANGLE: " <<
304 atom_id2.
rsd() <<
" " << pose_reference.
residue( atom_id2.
rsd() ).atom_name( atom_id2.
atomno() ) <<
"; " <<
305 atom_id1.
rsd() <<
" " << pose_reference.
residue( atom_id1.
rsd() ).atom_name( atom_id1.
atomno() ) <<
"; " <<
306 atom_id3.
rsd() <<
" " << pose_reference.
residue( atom_id3.
rsd() ).atom_name( atom_id3.
atomno() ) <<
" ==> " << degrees( bond_angle ) <<
" " << degrees( bond_angle_sd_ ) <<
321 if ( atom_id1.
rsd() == atom_id2.
rsd() )
return true;
327 if ( atom1->parent() == atom2 )
return true;
328 if ( atom2->parent() == atom1 )
return true;
368 using namespace core::id;
369 using namespace core::scoring;
370 using namespace core::scoring::constraints;
371 using namespace core::kinematics;
372 using namespace numeric::conversions;
379 std::map< AtomID, utility::vector1< AtomID > > lists_of_angle_bonded_atoms;
387 for (
core::Size j = 1; j <= residue.natoms(); j++ ) {
392 if ( current_atom->is_jump() )
continue;
396 if ( !input_stub_atom1 )
continue;
399 if ( input_stub_atom1->is_jump() )
continue;
404 if ( !input_stub_atom2 )
continue;
405 if ( input_stub_atom2 == current_atom )
continue;
408 if ( input_stub_atom2->is_jump() )
continue;
412 if ( !input_stub_atom3 )
continue;
414 if ( input_stub_atom3 == current_atom )
continue;
430 for (
core::Size j = 1; j <= residue.natoms(); j++ ) {
439 for (
core::Size n = 1; n <= nbrs.size(); n++ ) {
441 AtomID const & atom_id2( nbrs[ n ] );
451 pose, pose_reference, cst_set );
457 for (
core::Size m = 1; m <= nbrs.size(); m++ ) {
458 AtomID const & atom_id2( nbrs[ m ] );
465 for (
core::Size n = 1; n <= nbrs.size(); n++ ) {
466 AtomID const & atom_id3( nbrs[ n ] );
476 pose, pose_reference, cst_set );
498 using namespace core::scoring::rna;
501 core::Real const DELTA_CUTOFF( rna_fitted_torsion_info.delta_cutoff() );
505 if ( delta > DELTA_CUTOFF ) {
520 using namespace core::chemical;