Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LHSnugFitLegacy.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
6 // (c) under license. The Rosetta software is developed by the contributing
7 // (c) members of the Rosetta Commons. For more information, see
8 // (c) http://www.rosettacommons.org. Questions about this can be addressed to
9 // (c) University of Washington UW TechTransfer, email:license@u.washington.edu
10 
11 /// @file protocols/antibody2/LHSnugFitLegacy.cc
12 /// @brief Build a homology model of an antibody2
13 /// @detailed
14 ///
15 ///
16 /// @author Jianqing Xu (xubest@gmail.com)
17 
18 
19 
21 
22 #include <basic/options/option.hh>
23 #include <basic/options/keys/in.OptionKeys.gen.hh>
24 #include <basic/Tracer.hh>
25 
28 #include <protocols/loops/Loop.hh>
31 
32 
33 #include <core/pose/util.hh>
34 #include <core/pose/Pose.hh>
35 #include <core/pose/PDBInfo.hh>
36 #include <core/pose/util.hh>
39 
40 
42 
43 
44 
55 
56 
57 #include <ObjexxFCL/format.hh>
58 #include <ObjexxFCL/string.functions.hh>
59 using namespace ObjexxFCL::fmt;
60 
72 
73 
74 
75 
76 
77 
79 //JQX:: this header file took care of the "CUTPOINT_LOWER" options below
80 
81 
82 
83 using basic::T;
84 using basic::Error;
85 using basic::Warning;
86 
87 static basic::Tracer TR("protocols.antibody2.LHSnugFitLegacy");
88 
89 
90 
91 
92 using namespace core;
93 namespace protocols {
94 namespace antibody2 {
95 
96 
97 
98 
99 
100 
101 
102 
103 // default constructor
104 LHSnugFitLegacy::LHSnugFitLegacy() : Mover() {
105 
106 }
107 
108 
110  user_defined_ = true;
111  init(loops_in, false);
112 }
113 
114 
116  user_defined_ = true;
117  init(antibody_in->get_AllCDRs_in_loopsop(),false);
118 }
119 
120 LHSnugFitLegacy::LHSnugFitLegacy(antibody2::AntibodyInfoOP antibody_in, bool camelid) : Mover() {
121  user_defined_ = true;
122  init(antibody_in->get_AllCDRs_in_loopsop(), camelid);
123 }
124 
125 
126 // default destructor
128 
129 //clone
131  return( new LHSnugFitLegacy() );
132 }
133 
134 
135 
136 
137 
138 void LHSnugFitLegacy::init(loops::LoopsOP loops_in, bool camelid )
139 {
140  is_camelid_ = camelid;
141  all_loops_ = loops_in;
142 }
143 
144 
146  min_type_="dfpmin_armijo_nonmonotone";
147  rot_mag_ = 5.0 ;
148  trans_mag_ = 0.1 ;
149  temperature_ = 0.8;
150 }
151 
152 
154  return "LHSnugFitLegacy";
155 }
156 
157 
158 
159 
160 
161 
162 
163 
164 
165 
167 
168 
169  using namespace moves;
170  bool nb_list = true;
171  Size nres = pose.total_residue();
172 
173  // rb minimization
174  Real min_threshold ( 15.0 ); /* score unit */
175 
176  // score functions
177  using namespace core::scoring;
178  core::scoring::ScoreFunctionOP dock_scorefxn;
179  dock_scorefxn = core::scoring::ScoreFunctionFactory::create_score_function( "docking", "docking_min" );
180  dock_scorefxn->set_weight( core::scoring::chainbreak, 1.0 );
181  dock_scorefxn->set_weight( core::scoring::overlap_chainbreak, 10./3. );
182 
183  // score functions
184  core::scoring::ScoreFunctionOP pack_scorefxn;
186 
187  // remove cutpoints variants for all cdrs
188  // "true" forces removal of variants even from non-cutpoints
189  loops::remove_cutpoint_variants( pose, true );
190 
191  using namespace core::chemical;
192  for ( loops::Loops::const_iterator it = all_loops_->begin(),
193  it_end = all_loops_->end(); it != it_end; ++it ) {
196  }
197 
198  //setting MoveMap
199  kinematics::MoveMapOP cdr_dock_map;
200  cdr_dock_map = new kinematics::MoveMap();
201 
202  *cdr_dock_map=ab_info_->get_MoveMap_for_LoopsandDock(pose, *ab_info_->get_AllCDRs_in_loopsop(), false, true, 10.0);
203 
204  //set up minimizer movers
205  simple_moves::MinMoverOP min_mover = new simple_moves::MinMover( cdr_dock_map, dock_scorefxn, min_type_, min_threshold, nb_list );
206 
207  //set up rigid body movers
209  *cdr_dock_map, rot_mag_, trans_mag_, rigid::partner_downstream, true );
210 
211 
212  //set up sidechain movers for rigid body jump and loop & neighbors
213  utility::vector1_size rb_jump;
214  rb_jump.push_back( 1 );
215  using namespace core::pack::task;
216  using namespace core::pack::task::operation;
217 
218  // selecting movable c-terminal residues
219  utility::vector1< bool> sc_is_flexible( nres, false );
220  select_loop_residues( pose, *all_loops_, true/*include_neighbors*/, sc_is_flexible);
221 
222  ObjexxFCL::FArray1D_bool loop_residues( nres, false );
223  for( Size i = 1; i <= nres; i++ )
224  loop_residues( i ) = sc_is_flexible[ i ]; // check mapping
225  using namespace protocols::toolbox::task_operations;
226  tf_->push_back( new RestrictToInterface( rb_jump, loop_residues ) );
227 
228 
229 
230  simple_moves::RotamerTrialsMoverOP pack_rottrial = new simple_moves::RotamerTrialsMover( pack_scorefxn, tf_ );
231 
232  simple_moves::PackRotamersMoverOP pack_interface_repack = new simple_moves::PackRotamersMover( pack_scorefxn );
233  pack_interface_repack->task_factory(tf_);
234 
235 
236  MonteCarloOP mc = new MonteCarlo( pose, *dock_scorefxn, temperature_ );
237 
238  TrialMoverOP pack_interface_trial = new TrialMover(pack_interface_repack, mc );
239 
241  TrialMoverOP scmin_trial = new TrialMover( scmin_mover, mc );
242 
243  SequenceMoverOP rb_mover = new SequenceMover;
244  rb_mover->add_mover( rb_perturb );
245  rb_mover->add_mover( pack_rottrial );
246 
247  JumpOutMoverOP rb_mover_min = new JumpOutMover( rb_mover, min_mover, dock_scorefxn, min_threshold);
248  TrialMoverOP rb_mover_min_trial = new TrialMover( rb_mover_min, mc );
249 
250  SequenceMoverOP repack_step = new SequenceMover;
251  repack_step->add_mover( rb_mover_min_trial );
252  repack_step->add_mover( pack_interface_trial );
253  repack_step->add_mover( scmin_trial );
254 
255  CycleMoverOP rb_mover_min_trial_repack = new CycleMover;
256  for ( Size i=1; i < 8; ++i )
257  rb_mover_min_trial_repack->add_mover( rb_mover_min_trial );
258  rb_mover_min_trial_repack->add_mover( repack_step );
259 
260  //set up initial repack mover
261  SequenceMoverOP initial_repack = new SequenceMover;
262  initial_repack->add_mover( pack_interface_trial );
263  initial_repack->add_mover( scmin_trial );
264 
265  //set up initial and final min_trial movers for docking
266  TrialMoverOP minimize_trial = new TrialMover( min_mover, mc );
267 
268  //set up mcm cycles and mcm_repack cycles
269  RepeatMoverOP mcm_four_cycles = new RepeatMover( rb_mover_min_trial, 4 );
270 
271  Size cycles = 3;
272  if ( benchmark_ ) cycles = 1;
273  RepeatMoverOP mcm_final_cycles = new RepeatMover( rb_mover_min_trial_repack, cycles );
274 
275  SequenceMoverOP snugfit_mcm = new SequenceMover;
276  snugfit_mcm->add_mover( initial_repack );
277  snugfit_mcm->add_mover( minimize_trial );
278  snugfit_mcm->add_mover( mcm_four_cycles );
279  snugfit_mcm->add_mover( mcm_final_cycles );
280  snugfit_mcm->add_mover( minimize_trial );
281 
282  snugfit_mcm->apply ( pose );
283 
284  return;
285 }
286 
287 
288 
289 
290 
291 
292 
293 
294 
295 
296 
297 
298 
299 } // namespace antibody2
300 } // namespace protocols
301 
302 
303 
304 
305