22 #include <numeric/xyzVector.hh>
46 #include <utility/tag/Tag.hh>
47 #include <boost/foreach.hpp>
48 #define foreach BOOST_FOREACH
50 #include <utility/exit.hh>
56 #include <basic/options/option.hh>
57 #include <basic/options/keys/packing.OptionKeys.gen.hh>
58 #include <basic/options/keys/hotspot.OptionKeys.gen.hh>
59 #include <utility/vector1.hh>
61 #include <basic/Tracer.hh>
67 #include <utility/vector0.hh>
74 using namespace core::scoring;
76 static basic::Tracer
TR(
"protocols.protein_interface_design.movers.PlaceUtils" );
79 namespace protein_interface_design {
82 using namespace protocols::moves;
90 using namespace numeric;
104 Vector const res1_CB_CA = (res1_CB - res1_CA);
105 Vector const res1_C_N = (res1_C - res1_N);
107 Vector const res2_CB_CA = (res2_CB - res2_CA);
108 Vector const res2_C_N = (res2_C - res2_N);
110 C_N_angle = angle_of( res2_C_N, res1_C_N );
111 CB_CA_angle = angle_of( res2_CB_CA, res1_CB_CA );
113 if( cos_of( res1_C_N, res2_C_N ) <= threshold ||
114 cos_of( res1_CB_CA, res2_CB_CA ) <= threshold )
122 using namespace core::scoring::constraints;
128 using namespace core::conformation;
129 using namespace core::chemical;
132 AA const aa = rsd_i.
aa();
134 using namespace core::id;
155 cst.push_back(
new CoordinateConstraint(
AtomID( rsd_type.atom_index(
"NH2" ), resnum ) , anchor_atom, rsd_i.
xyz(
"NH2" ),coord_cst_func ) );
167 cst.push_back(
new CoordinateConstraint(
AtomID( rsd_type.atom_index(
"ND1" ), resnum ) , anchor_atom, rsd_i.
xyz(
"ND1" ),coord_cst_func ) );
180 cst.push_back(
new CoordinateConstraint(
AtomID( rsd_type.atom_index(
"CD1" ), resnum ), anchor_atom, rsd_i.
xyz(
"CD1" ), coord_cst_func ) );
181 cst.push_back(
new CoordinateConstraint(
AtomID( rsd_type.atom_index(
"CD2" ), resnum ), anchor_atom, rsd_i.
xyz(
"CD2" ), coord_cst_func ) );
184 cst.push_back(
new CoordinateConstraint(
AtomID( rsd_type.atom_index(
"CG1" ), resnum ), anchor_atom, rsd_i.
xyz(
"CG1" ), coord_cst_func ) );
185 cst.push_back(
new CoordinateConstraint(
AtomID( rsd_type.atom_index(
"CD1" ), resnum ), anchor_atom, rsd_i.
xyz(
"CD1" ), coord_cst_func ) );
186 cst.push_back(
new CoordinateConstraint(
AtomID( rsd_type.atom_index(
"CG2" ), resnum ), anchor_atom, rsd_i.
xyz(
"CG2" ), coord_cst_func ) );
195 cst.push_back(
new CoordinateConstraint(
AtomID( rsd_type.atom_index(
"OG1" ), resnum ), anchor_atom, rsd_i.
xyz(
"OG1" ), coord_cst_func ) );
196 cst.push_back(
new CoordinateConstraint(
AtomID( rsd_type.atom_index(
"CG2" ), resnum ), anchor_atom, rsd_i.
xyz(
"CG2" ), coord_cst_func ) );
203 cst.push_back(
new CoordinateConstraint(
AtomID( rsd_type.atom_index(
"CG1" ), resnum ), anchor_atom, rsd_i.
xyz(
"CG1" ), coord_cst_func ) );
204 cst.push_back(
new CoordinateConstraint(
AtomID( rsd_type.atom_index(
"CG2" ), resnum ), anchor_atom, rsd_i.
xyz(
"CG2" ), coord_cst_func ) );
211 utility_exit_with_message(
"ERROR: Residue not supported by Placement coordinate constraint machinery" );
214 TR<<
"Constraining residue "<<pose.
residue( resnum ).
name()<<resnum<<std::endl;
236 runtime_assert( nearest_res );
237 return( nearest_res );
243 using namespace core::chemical;
244 AA const aa = residue.
aa();
246 using namespace core::id;
254 case(
aa_tyr ) :
return(
"CG" );
256 case(
aa_gln ) :
return(
"CD" );
257 case(
aa_arg ) :
return(
"NE" );
258 case(
aa_lys ) :
return(
"NZ" );
259 case(
aa_met ) :
return(
"SD" );
260 case(
aa_ile ) :
return(
"CG1" );
261 case(
aa_cys ) :
return(
"SG" );
264 case(
aa_thr ) :
return(
"CB" );
265 case(
aa_ser ) :
return(
"HG" );
266 case(
aa_gly ) :
return(
"CA" );
268 utility_exit_with_message(
"ERROR: Residue not supported by Placement coordinate constraint machinery" );
276 using namespace core::scoring::constraints;
282 TR<<
"Anchor residue for the coordinate constraint is "<<fixed_res<<std::endl;
289 coord_cst_func->sd( coord_sdev );
298 using namespace utility::tag;
299 using namespace core::pack::task;
300 if( !data.
has(
"TaskFactory",
"placement" ) ){
302 data.
add(
"TaskFactory",
"placement", task_factory );
305 task_factory = data.
get<
TaskFactory * >(
"TaskFactory",
"placement" );
306 if( tag->getName() !=
"NotifyMovers" )
return;
308 foreach(
TagPtr const ta_tag, ta_tags ){
310 std::map< std::string const, MoverOP >::const_iterator find_mover( movers.find( mover_name ));
311 bool const mover_found( find_mover != movers.end() );
315 TR<<
"Setting the task factory of mover "<<find_mover->first<<
" to be aware of PlaceSimultaneously's rotamer and sidechain choices.\n";
316 drOP->task_factory( task_factory );
326 using namespace core::scoring;
328 stub_scorefxn->
reset();
330 stub_scorefxn->set_weight(
fa_rep, 0.44 );
331 stub_scorefxn->set_weight(
fa_dun, 0.56 );
334 return( stub_scorefxn );
339 using namespace utility::tag;
340 using namespace protocols::hotspot_hashing;
344 bool contain_StubSet(
false );
347 for( ; ss_tag != btags.end(); ++ss_tag ){
348 if( (*ss_tag)->getName() ==
"StubSets" ){
349 contain_StubSet =
true;
353 if( !contain_StubSet )
359 if( data.
has(
"hotspot_library", stub_fname ) ){
361 TR<<
"Associated mover with an already read stubset named "<<stub_fname<<std::endl;
364 TR<<
"Associating mover with stub file "<<stub_fname<<std::endl;
365 stubset->read_data( stub_fname );
367 stub_sets.push_back(std::make_pair(stubset, std::make_pair(
new HotspotStub(), 0)));
372 task->initialize_from_command_line().or_include_current(
true );
377 core::Size const chain_begin( ala_pose->conformation().chain_begin( host_chain ) );
378 core::Size const chain_end( ala_pose->conformation().chain_end( host_chain ) );
382 if( i >= chain_begin && i <=chain_end ) {
383 core::Size const restype( ala_pose->residue(i).aa() );
385 task->nonconst_residue_task(i).prevent_repacking();
387 task->nonconst_residue_task(i).restrict_absent_canonical_aas( allowed_aas );
390 task->nonconst_residue_task( i ).prevent_repacking();
393 if( basic::options::option[basic::options::OptionKeys::packing::resfile].user() )
398 (*scorefxn)( *ala_pose );