Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LHRepulsiveRamp.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/LHRepulsiveRamp.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 #include <basic/Tracer.hh>
23 #include <protocols/loops/Loop.hh>
26 #include <core/pose/util.hh>
27 #include <core/pose/Pose.hh>
28 #include <core/pose/PDBInfo.hh>
32 
33 
34 using basic::T;
35 using basic::Error;
36 using basic::Warning;
37 
38 static basic::Tracer TR("protocols.antibody2.LHRepulsiveRamp");
39 
40 
41 using namespace core;
42 namespace protocols {
43 namespace antibody2 {
44 
45 
46 
47 // default constructor
48 LHRepulsiveRamp::LHRepulsiveRamp() : Mover() {}
49 
50 
52  core::scoring::ScoreFunctionCOP dock_scorefxn,
53  core::scoring::ScoreFunctionCOP pack_scorefxn ) : Mover(){
54  user_defined_ = true;
55  jump_ = movable_jumps;
56  dock_scorefxn_ = new core::scoring::ScoreFunction(*dock_scorefxn);
57  pack_scorefxn_ = new core::scoring::ScoreFunction(*pack_scorefxn);
58 
59  init();
60 }
61 
62 
63 // default destructor
65 
66 //clone
68  return( new LHRepulsiveRamp() );
69 }
70 
71 
72 
74 {
75  set_default();
76 
77 
78 
79  //JQX: Jeff wants this repulsive ramping mover to be more general, therefore, no default
80  // tf, movemap, and scorefxn are set up here, to avoid any unnecessary confusion.
81 }
82 
83 
85  benchmark_ = false;
86  sc_min_ =false;
87  rt_min_ =false;
88 
89 
90  rep_ramp_cycles_ = 3 ;
91  rot_mag_ = 2.0 ;
92  trans_mag_ = 0.1 ;
93  num_repeats_ = 4;
94 
95  if(!user_defined_){
96 
97  }
98 
99 }
100 
101 
102 
103 
104 ///////////////////////////////////////////////////////////////////////////
105 /// @begin repulsive_ramp
106 ///
107 /// @brief ramping up the fullatom repulsive weight slowly to allow the
108 /// partners to relieve clashes and make way for each other
109 ///
110 /// @detailed This routine is specially targetted to the coupled
111 /// optimization of docking partners and the loop region. The
112 /// loop modelling & all previous steps involve mainly
113 /// centroid mode .On switching on fullatom mode, one is bound
114 /// to end up with clashes.To relieve the clashes, it is
115 /// essential to slowly dial up the repulsive weight instead of
116 /// turning it on to the maximum value in one single step
117 ///
118 /// @param[in] input pose which is assumed to have a docking fold tree
119 ///
120 /// @global_read fa_rep : fullatom repulsive weight
121 ///
122 /// @remarks A particular portion is commented out,which can be
123 /// uncommented if one uses a low resolution homology model.
124 /// Check details in the beginning of the commented out region
125 ///
126 ///////////////////////////////////////////////////////////////////////////
127 
129  TR<<"start apply function ..."<<std::endl;
130 
131  //JQX: the fold_tree and variants should have been set up in "pose"
132  // executed outside of this class
133 
134 
135  // add scores to map
136  ( *dock_scorefxn_ )( pose );
137 
138  // dampen fa_rep weight
139  core::Real rep_weight_max = dock_scorefxn_->get_weight( core::scoring::fa_rep );
140 
141  if( benchmark_ ) {
142  rep_ramp_cycles_ = 1;
143  num_repeats_ = 1;
144  }
145 
146 
147 
148  core::Real rep_ramp_step = (rep_weight_max - 0.02) / core::Real(rep_ramp_cycles_-1);
150 
151  for ( Size i = 1; i <= rep_ramp_cycles_; i++ ) {
152  core::Real rep_weight = 0.02 + rep_ramp_step * Real(i-1);
153  TR<<" repulsive ramp cycle "<<i<<": rep_weight = "<<rep_weight<<std::endl;
154  temp_dock_scorefxn->set_weight( core::scoring::fa_rep, rep_weight );
155 
156 
157  docking::DockMCMCycleOP dockmcm_cyclemover = new docking::DockMCMCycle( jump_, temp_dock_scorefxn, pack_scorefxn_ );
158  //TODO: print scoring function in apply and move "new" out
159  dockmcm_cyclemover->set_rot_magnitude(rot_mag_);
160  dockmcm_cyclemover->set_task_factory(tf_);
161  dockmcm_cyclemover->set_move_map(movemap_);
162  if(sc_min_) {dockmcm_cyclemover->set_scmin(true);}
163  if(sc_min_) {dockmcm_cyclemover->set_scmin(true);}
164 
165  for (Size j=1; j<=num_repeats_; j++) {
166  dockmcm_cyclemover -> apply(pose);
167  TR<<" doing rb_mover_min_trial in the DockMCMCycle ... "<<j<<std::endl;
168  }
169  dockmcm_cyclemover -> reset_cycle_index(); //JQX: only do the rb_mover_min_trial (index<7)
170  dockmcm_cyclemover -> get_mc()->recover_low( pose ); //chose the pose having the lowest score
171 
172  }
173 
174  TR<<"finish apply function !!!"<<std::endl;
175 
176 }
177 
178 
179 
181  return "LHRepulsiveRamp";
182 }
183 
185  tf_ = new pack::task::TaskFactory(*tf);
186 }
187 
189  movemap_ = new kinematics::MoveMap(*movemap);
190 }
191 
192 
194  jump_ = jump;
195 }
196 
197 
198 
199 } // namespace antibody2
200 } // namespace protocols
201