Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BestHotspotCstMover.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 under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file protocols/protein_interface_design/movers/BestHotspotCstMover.cc
11 /// @brief
12 /// @author Sarel Fleishman (sarelf@u.washington.edu), Jacob Corn (jecorn@u.washington.edu)
13 
14 // Unit headers
21 #include <core/pose/PDBInfo.hh>
22 #include <core/pose/PDBPoseMap.hh>
23 #include <core/pose/Pose.hh>
25 #include <basic/Tracer.hh>
28 #include <utility/tag/Tag.hh>
29 
30 #include <core/id/AtomID.hh>
32 #include <utility/vector0.hh>
33 #include <utility/vector1.hh>
34 
35 
36 namespace protocols {
37 namespace protein_interface_design {
38 namespace movers {
39 
40 using namespace core;
41 using namespace std;
42 using namespace core::scoring;
43 using namespace protocols::moves;
44 
45 static basic::Tracer TR( "protocols.protein_interface_design.movers.BestHotspotCstMover" );
46 
49 {
51 }
52 
55  return new BestHotspotCstMover;
56 }
57 
60 {
61  return "BestHotspotCst";
62 }
63 
64 
66  protocols::moves::Mover( BestHotspotCstMoverCreator::mover_name() )
67 {}
68 
71  core::Size const host_chain,
72  core::Size const n_resi
73 ) :
74  protocols::moves::Mover( BestHotspotCstMoverCreator::mover_name() ),
75  host_chain_( host_chain ),
76  n_resi_( n_resi )
77 {
78  if( stub_set ) stub_set_ = new protocols::hotspot_hashing::HotspotStubSet( *stub_set );
79 }
80 
82  //utility::pointer::ReferenceCount(),
83  protocols::moves::Mover( init ),
84  host_chain_(init.host_chain_), n_resi_( init.n_resi_ )
85 {
87 }
88 
90 
91 
92 void
94 {
95  using namespace protocols::hotspot_hashing;
96  HotspotStubSetOP working_stub_set( new HotspotStubSet( *stub_set_ ) ); // stub_set_ needs to remain pristine for next rounds of execution.
97  core::scoring::ScoreFunctionCOP scorefxn( ScoreFunctionFactory::create_score_function( STANDARD_WTS, SCORE12_PATCH ) ); // default scorefxn for several definitions within the function
98 
99  // find the residues that have the best constraint backbone_stub_constraint scores
100  utility::vector1< core::Size > const best_cst_residues( best_bbcst_residues( pose, host_chain_, n_resi_ ) );
101 
102  // make a packer task containing only the best residues
104  for( core::Size i=1; i <= pose.total_residue(); ++i ) {
105  if(( find( best_cst_residues.begin(), best_cst_residues.end(), i ) != best_cst_residues.end() )) continue;
106  else packer_task->nonconst_residue_task( i ).prevent_repacking();
107  }
108 
109  // Assign a fixed residue (for the stub constraints)
110  core::Size fixed_res(1);
111  if ( host_chain_ == 1 ) fixed_res = pose.total_residue();
112  core::id::AtomID fixed_atom_id = core::id::AtomID( pose.residue(fixed_res).atom_index("CA"), fixed_res );
113 
114  // reapply cst's, but use the packer task to only count the best residues
115  working_stub_set->remove_all_hotspot_constraints( pose );
116  working_stub_set->add_hotspot_constraints_to_pose(
117  pose,
118  fixed_atom_id,
119  packer_task,
120  working_stub_set,
122  -0.5, //worst allowed stub bonus
123  true, // apply_self_energies
124  8.0, // bump_cutoff
125  true ///apply_ambiguous constraints
126  );
127 
128  TR<<"Reapplied constraints to residues ";
129  for( core::Size i=1; i<=best_cst_residues.size(); ++i ) {
130  TR<< best_cst_residues[i] << " ";
131  }
132  TR << std::endl;
133 }
134 
138 }
139 
141 {
142  using namespace protocols::hotspot_hashing;
143 
144  core::pose::PDBPoseMap const pose_map( pose.pdb_info()->pdb2pose() );
145 
146  host_chain_ = tag->getOption<core::Size>( "chain_to_design", 2 );
147  n_resi_ = tag->getOption<core::Size>( "best_n", 3 );
148  cb_force_constant_ = tag->getOption< core::Real >( "cb_force", 1.0 );
149 
150  std::string const hs( "hotspot_stubset" );
151  stub_set_ = data.get< HotspotStubSet * >( "constraints", hs );
152 
153  TR<<"BestHotspotCst mover on chain "<<host_chain_<<" with cbeta force " << cb_force_constant_ << "\n";
154 }
155 
156 } //movers
157 } //protein_interface_design
158 } //protocols