Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HotspotDisjointedFoldTreeMover.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/HotspotDisjointedFoldTreeMover
11 /// @author Sarel Fleishman (sarelf@uw.edu)
12 
13 //unit header
16 //project header
19 #include <core/pose/Pose.hh>
21 #include <core/kinematics/Stub.hh>
22 #include <core/kinematics/Jump.hh>
25 #include <numeric/xyzVector.hh>
26 // AUTO-REMOVED #include <numeric/random/random.hh>
27 #include <string>
29 #include <boost/foreach.hpp>
30 #define foreach BOOST_FOREACH
32 //#include <core/pose/Pose.hh>
33 
34 // AUTO-REMOVED #include <core/pack/task/PackerTask.hh>
40 #include <core/pose/selection.hh>
41 #include <utility/vector0.hh>
42 #include <utility/vector1.hh>
43 #include <utility/tag/Tag.hh>
44 // AUTO-REMOVED #include <numeric/xyz.functions.hh>
45 #include <basic/Tracer.hh>
46 
47 
48 namespace protocols {
49 namespace protein_interface_design {
50 namespace movers {
51 
52 using namespace protocols::moves;
53 using namespace core::chemical;
54 using namespace core::kinematics;
55 
56 static basic::Tracer TR( "protocols.protein_interface_design.movers.HotspotDisjointedFoldTreeMover" );
57 
59 {
61 }
62 
66 }
67 
70  return "HotspotDisjointedFoldTree";
71 }
72 
74  protocols::moves::Mover( HotspotDisjointedFoldTreeMoverCreator::mover_name() ),
75  ddG_threshold_( 1.0 ),
76  chain_( 2 ),
77  interface_radius_( 8.0 ),
78  scorefxn_( NULL )
79 {
80  residues_.clear();
81 }
82 
84 
87 }
88 
89 ///@details generates a foldtree that links the nearest residues on chain 1 to key residues on chain 2 and breaks the chain around the key residues on chain 2
92 {
93  using namespace core::kinematics;
94  FoldTreeOP ft = new FoldTree;
95 
96  TR<<"Fold tree before disjointed foldtree:\n"<<pose.fold_tree()<<std::endl;
97  ft->clear();
98  runtime_assert( chain() == 2 );
99 /// THIS will only work with chain==2, though reworking it should not be too difficult
100  core::Size head( *get_residues().begin()-1 );
101  std::set< core::Size > residues_on_target;
102  residues_on_target.clear();
103  core::Size jump( 1 );
104  foreach( core::Size const r, get_residues() ){
105 /// Connect the nearest residues on chain1 to key residues on chain2 leaving breaks in chain2 around each key residue
106  if( head < r - 1 ){
107 ///connect segments intervening between hot spots
108  ft->add_edge( head, r-1, Edge::PEPTIDE );
109  ft->add_edge( r-1, r, jump );
110  jump++;
111  }
112 /// connect anchor residue on target with hotspot residue
113  core::Size const target_res( find_nearest_residue_to_coord( pose, pose.residue( r ).xyz( nearest_atom_for_constraint( pose.residue( r ) )), chain() == 2 ? 1 : 2 ) );
114  ft->add_edge( target_res, r, jump );
115  residues_on_target.insert( target_res );
116  jump++;
117  head = r + 1;
118  }
119  core::Size target_head( pose.conformation().chain_begin( 1 ) );
120  foreach( core::Size const r, residues_on_target ){
121 /// connect chain1 with no breaks
122  ft->add_edge( target_head, r, Edge::PEPTIDE );
123  target_head = r;
124  }
125 /// connect the last anchor residue on the target chain with the last residue on the target chain
126  core::Size const target_end( *residues_on_target.rbegin() );
127  ft->add_edge( target_end, pose.conformation().chain_end( 1 ), Edge::PEPTIDE );
128 
129 /// refold chain2 from the first key residue to the beginning of the chain and from the last key residue to its end
130  core::Size const begin( *get_residues().begin() );
131  core::Size const end( *get_residues().rbegin() );
132  if( begin - 1 >= pose.conformation().chain_begin( chain() ) ){
133  ft->add_edge( begin, begin - 1, jump );
134  ft->add_edge( begin - 1, pose.conformation().chain_begin( chain() ), Edge::PEPTIDE );
135  jump++;
136  }
137  if( end + 1 <= pose.conformation().chain_end( chain() ) ){
138  ft->add_edge( end, end + 1, jump );
139  ft->add_edge( end + 1, pose.conformation().chain_end( chain() ), Edge::PEPTIDE );
140  }
141  ft->delete_self_edges();
142  ft->reorder( 1 );
143  TR<<"Fold tree after disjointed foldtree:\n"<<*ft<<std::endl;
144  return( ft );
145 }
146 
150 }
151 
152 void
154 {
155  using namespace protocols::toolbox::task_operations;
156  using namespace core::pack::task::operation;
157 
159  pido->repack_chain1( false );
160  pido->repack_chain2( true );
161  pido->design_chain2( true );
162  pido->interface_distance_cutoff( interface_radius() );
163  pido->jump( 1 );
164 
166  tf->push_back( pido );
167 
168  if( ddG_threshold() <= 100 ){
170  rbw.ddG_threshold( ddG_threshold() );
171  rbw.scorefxn( scorefxn() );
173  rbw.task_factory( tf );
174  utility::vector1< core::Size > const ala_scan_res( rbw.first_pass_ala_scan( pose ) );
175  foreach( core::Size const r, ala_scan_res ){ add_residue( r ); }
176  }// fi ddG_threshold
177  TR<<"Making a disjointed fold tree for residues: ";
178  foreach( core::Size const r, get_residues() )
179  TR<<r<<" ";
180  TR<<std::endl;
181  FoldTreeOP ft( make_disjointed_foldtree( pose ) );
182  pose.fold_tree( *ft );
184 }
185 
186 void
188 {
189  ddG_threshold( tag->getOption< core::Real >( "ddG_threshold", 1.0 ) );
190  if( ddG_threshold() >= 100.0 )
191  TR<<"Ala scan calculation will not be carried out. Only residues specifically chosen in the script will be selected"<<std::endl;
192  std::string const scorefxn_name( tag->getOption< std::string >( "scorefxn", "score12" ) );
193  scorefxn( data.get< core::scoring::ScoreFunction * >( "scorefxns", scorefxn_name ) );
194  chain( tag->getOption< core::Size >( "chain", 2 ) );
195  interface_radius( tag->getOption< core::Real >( "radius", 8.0 ) );
196  utility::vector1< core::Size > v1 = core::pose::get_resnum_list( tag, "resnums", pose );
197  foreach( core::Size const r, v1 ){ add_residue( r ); }
198 
199  runtime_assert( ddG_threshold() <= 100.0 || get_residues().size() );
200  TR<<"HotspotDisjointedFoldTreeMover with: chain "<<chain()<<" ddG_threshold "<<ddG_threshold()<<" and residues ";
201  foreach( core::Size const r, get_residues() ){ TR<<r<<" "; }
202  TR<<std::endl;
203 }
204 
205 void
207  residues_.insert( r );
208 }
209 
210 std::set< core::Size >
212  return( residues_ );
213 }
214 
215 void
217  chain_ = c;
218 }
219 
222  return( chain_ );
223 }
224 
227  return( ddG_threshold_ );
228 }
229 
230 void
232  ddG_threshold_ = d;
233 }
234 
235 void
238 }
239 
242  return scorefxn_;
243 }
244 
245 void
247 {
248  interface_radius_ = rad;
249 }
250 
253 {
254  return interface_radius_;
255 }
256 }//movers
257 }//protein_interface_design
258 }//protocols