Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Ubiquitin_E2C_Modeler.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,
10 // (c) email: license@u.washington.edu.
11 
12 /// @author Aroop Sircar ( aroopsircar@yahoo.com )
13 
14 
15 // AUTO-REMOVED #include <core/chemical/ChemicalManager.hh>
19 // AUTO-REMOVED #include <core/fragment/FragSet.hh>
20 // AUTO-REMOVED #include <core/fragment/FragData.hh>
21 // AUTO-REMOVED #include <core/io/pdb/pose_io.hh>
22 // AUTO-REMOVED #include <core/io/silent/SilentStruct.hh>
23 // AUTO-REMOVED #include <core/io/silent/SilentStructFactory.hh>
26 // AUTO-REMOVED #include <basic/options/keys/antibody.OptionKeys.gen.hh>
27 // AUTO-REMOVED #include <basic/options/keys/in.OptionKeys.gen.hh>
28 // AUTO-REMOVED #include <basic/options/keys/out.OptionKeys.gen.hh>
29 #include <basic/options/option.hh>
40 #include <core/pose/Pose.hh>
41 #include <core/pose/PDBInfo.hh>
43 // AUTO-REMOVED #include <core/pose/util.hh>
44 #include <core/scoring/Energies.hh>
45 // AUTO-REMOVED #include <protocols/scoring/InterchainPotential.hh>
49 // AUTO-REMOVED #include <core/scoring/constraints/ConstraintFactory.hh>
50 // AUTO-REMOVED #include <core/scoring/constraints/ConstraintIO.hh>
52 #include <basic/datacache/BasicDataCache.hh>
53 #include <basic/datacache/DiagnosticData.hh>
54 #include <basic/Tracer.hh>
55 
56 #include <numeric/random/random.hh>
57 
58 #include <ObjexxFCL/format.hh>
59 #include <ObjexxFCL/string.functions.hh>
60 using namespace ObjexxFCL::fmt;
61 
64 // AUTO-REMOVED #include <protocols/docking/DockingLowRes.hh>
66 // AUTO-REMOVED #include <protocols/loops/loops_main.hh>
81 
82 //#include <utility/vector1.hh>
83 // AUTO-REMOVED #include <utility/tag/Tag.hh> // REQUIRED FOR WINDOWS
84 
86 #include <utility/vector0.hh>
87 #include <utility/vector1.hh>
88 
89 //Auto Headers
91 
92 using basic::T;
93 using basic::Error;
94 using basic::Warning;
95 
96 static basic::Tracer TR("protocols.ub_e2c.ubi_e2c_modeler");
97 
98 namespace protocols {
99 namespace ub_e2c {
100 
101 #ifndef WIN32
102  // Aroop's Magic number, do not change it
103  // (and dont try and use it anywhere else)
104  static numeric::random::RandomGenerator RG(22849284);
105 
106  using namespace core;
107  using namespace core::scoring;
108 
109  // default constructor
110  ubi_e2c_modeler::ubi_e2c_modeler() : Mover(),
111  e2_k48r_jump_( 1 ),
112  e2_d77_jump_( 2 ),
113  max_k48_cter_dist_( 15.00 ),
114  temperature_( 0.8 ),
115  flex_cter_( 3 ),
116  CA( 2 ),
117  max_repeats_( 100000 ),
118  centroid_allowed_CSP_fraction_( 0.7 ),
119  fullatom_allowed_CSP_fraction_( 0.7 ),
120  centroid_CSP_weight_( 5.0 ),
121  centroid_non_CSP_weight_( 5.0 ),
122  fullatom_CSP_weight_( 1000.0 ),
123  fullatom_non_CSP_weight_( 1000.0 ),
124  cen_vdw_( 1.00 ),
125  cen_constraint_( 10.00 ),
126  full_vdw_( 1.00 ),
127  refinement_mode_( false ), // false for initial run
128  cov_bond_only_flag_( true ), // false for initial run
129  monoub_mode_( false ), // false for our model system ::: SET THIS TO FALSE
130  higher_d77_pert_mode_( false ) // false for regular runs ::: SET THIS TO TRUE
131  {
132  Mover::type( "ubi_e2c_modeler" );
133  set_default();
134  }
135 
136  // default destructor
138 
139  //clone
141  return( new ubi_e2c_modeler() );
142  }
143 
145  using namespace basic::options;
146  using namespace basic::options::OptionKeys;
147  TR << "UBI Setting up default settings" << std::endl;
148 
149  // README
150  // The 76th residue (C-terminal) of Ub1 (UbK48R) is linked to the 48th
151  // Lysine of Ub2 (UbD77)
152  // The 48th residue of Ub1 (UbK48R) has a spin labeled tag
153  // The 75th residue of Ub2 (UbD77) has a spin labeled tag
154  e2_ctr_of_mass_ = 0;
155  k48r_ctr_of_mass_ = 0;
156  d77_ctr_of_mass_ = 0;
157  e2_end_ = 0;
158  k48r_end_ = 0;
159  d77_end_ = 0;
160  k48r_48_lys_ = 0;
161  d77_48_lys_ = 0;
162  k48r_trim_end_ = 0 ;
163  d77_trim_end_ = 0;
164  d77_trim_ctr_mass_ = 0;
165 
166  k48r_swap_ = false;
167 
168  k48r_48k_mtsl_ = 0;
169  d77_75g_mtsl_ = 0;
170 
173 
174  applied_fullatom_pert_ = false;
175 
176  min_tolerance_ = 0.1;
177  min_type_ = std::string( "dfpmin_armijo_nonmonotone" );
178  nb_list_ = true;
179 
180  if( cov_bond_only_flag_ )
181  full_constraint_ = 100000.00;
182  else
183  full_constraint_ = 100.00;
184 
185  if( monoub_mode_ )
186  fullatom_constraint_cutoff_ = 3 * 1.5;
187  else
189 
191  create_score_function("interchain_cen");
194  cen_constraint_ );
195 
197  create_score_function( "cen_std" );
200 
202  create_score_function("interchain_cen");
203  // adding constraints
205  cen_constraint_ );
208  cen_vdw_ );
209 
211  create_score_function( "cen_std" );
212  // adding constraints
214  cen_constraint_ );
217 
219  create_score_function("standard");
220 
222  create_score_function( "docking" );
223  //dockfa_scorefxn_->set_weight( core::scoring::fa_sol, full_vdw_ );
224  //dockfa_scorefxn_->set_weight( core::scoring::fa_rep, full_vdw_ );
225 
227  create_score_function( "docking", "docking_min" );
228  //dockfa_min_scorefxn_->set_weight( core::scoring::fa_sol, full_vdw_ );
229  //dockfa_min_scorefxn_->set_weight( core::scoring::fa_rep, full_vdw_ );
230 
232  create_score_function( "docking" );
233  //dockfa_cst_scorefxn_->set_weight( core::scoring::fa_sol, full_vdw_ );
234  //dockfa_cst_scorefxn_->set_weight( core::scoring::fa_rep, full_vdw_ );
237 
239  create_score_function( "docking", "docking_min" );
240  //dockfa_cst_min_scorefxn_->set_weight( core::scoring::fa_sol, full_vdw_ );
241  //dockfa_cst_min_scorefxn_->set_weight( core::scoring::fa_rep, full_vdw_ );
244 
246  create_score_function("standard");
247  // adding constraints
250  // pack_cst_scorefxn_->set_weight( core::scoring::fa_sol, full_vdw_ );
251 
253  create_score_function( "cen_std" );
254 
256  create_score_function( "docking" );
257 
258  TR << "UBI Done:Setting up default settings" << std::endl;
259 
260  return;
261  } // set_default
262 
264 
265  TR << "UBI Assigning Trimmed CSPs" << std::endl;
266 
267  for( Size i = 1; i <= CSP_.size(); i++ ) {
268  if( CSP_[i] <= ( k48r_end_ - ( flex_cter_ + 1)))
269  CSP_trim_.push_back( CSP_[i] );
270  else if( CSP_[i] <= ( e2_end_ - ( flex_cter_ + 1)))
271  CSP_trim_.push_back( CSP_[i] - (flex_cter_ + 1));
272  }
273 
274  for( Size i = 1; i <= non_CSP_.size(); i++ ) {
275  if( non_CSP_[i] <= ( k48r_end_ - ( flex_cter_ + 1)))
276  non_CSP_trim_.push_back( non_CSP_[i] );
277  else if( non_CSP_[i] <= ( e2_end_ - ( flex_cter_ + 1)))
278  non_CSP_trim_.push_back( CSP_[i] - (flex_cter_ + 1));
279  }
280 
281  TR << "UBI Done: Assigning Trimmed CSPs" << std::endl;
282 
283  return;
284  } // compute_trim_CSPs
285 
287 
288  TR << "UBI Assigning Swap Trimmed CSPs" << std::endl;
289 
290  Size ub_trim = d77_trim_end_ - k48r_trim_end_;
291 
292  for( Size i = 1; i <= CSP_.size(); i++ ) {
293  if( CSP_[i] <= e2_end_ )
294  CSP_swap_trim_.push_back( CSP_[i] );
295  else if( CSP_[i] <= k48r_end_ - (flex_cter_ + 1 ))
296  CSP_swap_trim_.push_back( CSP_[i] + ub_trim );
297  else if( CSP_[i] <= d77_end_ - (flex_cter_ + 1 ))
298  CSP_swap_trim_.push_back( CSP_[i] - ( ub_trim + flex_cter_ + 1));
299  }
300 
301  for( Size i = 1; i <= non_CSP_.size(); i++ ) {
302  if( non_CSP_[i] <= e2_end_ )
303  non_CSP_swap_trim_.push_back( non_CSP_[i] );
304  else if( non_CSP_[i] <= k48r_end_ - (flex_cter_ + 1 ))
305  non_CSP_swap_trim_.push_back( non_CSP_[i] + ub_trim );
306  else if( non_CSP_[i] <= d77_end_ - (flex_cter_ + 1 ))
307  non_CSP_swap_trim_.push_back( non_CSP_[i]-(ub_trim + flex_cter_ +1));
308  }
309 
310  TR << "UBI Done: Assigning Swap Trimmed CSPs" << std::endl;
311 
312  return;
313  } // compute_swap_trim_CSPs
314 
316  const pose::Pose & pose_in ) {
317 
318  TR << "UBI Assigning CSPs" << std::endl;
319 
320  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 23 ) );
321  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 24 ) );
322  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 25 ) );
323  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 26 ) );
324  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 29 ) );
325  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 32 ) );
326  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 33 ) );
327  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 34 ) );
328  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 36 ) );
329  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 40 ) );
330  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 41 ) );
331  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 42 ) );
332  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 52 ) );
333  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 53 ) );
334  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 54 ) );
335  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 57 ) );
336  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 58 ) );
337  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 74 ) );
338  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 160 ) );
339  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 164 ) );
340  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 14 ) );
341  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 17 ) );
342  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 18 ) );
343  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 27 ) );
344  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 35 ) );
345  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 38 ) );
346  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 39 ) );
347  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 43 ) );
348  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 46 ) );
349  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 50 ) );
350  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 51 ) );
351  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 56 ) );
352  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 59 ) );
353  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 60 ) );
354  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 90 ) );
355  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 163 ) );
356 
357  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 7 ) );
358  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 13 ) );
359  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 45 ) );
360  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 47 ) );
361  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 48 ) );
362  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 49 ) );
363  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 65 ) );
364  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 68 ) );
365  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 69 ) );
366  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 70 ) );
367  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 71 ) );
368  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 73 ) );
369  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 74 ) );
370  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 6 ) );
371  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 8 ) );
372  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 11 ) );
373  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 14 ) );
374  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 23 ) );
375  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 32 ) );
376  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 42 ) );
377  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 43 ) );
378  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 51 ) );
379  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 54 ) );
380  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 66 ) );
381  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 67 ) );
382  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 72 ) );
383  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 76 ) );
384 
385  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 7 ) );
386  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 43 ) );
387  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 48 ) );
388  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 70 ) );
389  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 71 ) );
390  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 23 ) );
391  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 29 ) );
392  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 45 ) );
393  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 51 ) );
394  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 69 ) );
395  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 73 ) );
396 
397  assign_non_CSPs( pose_in );
398 
401 
402  TR << "UBI Done: Assigning CSPs" << std::endl;
403 
404  return;
405  } // assign_CSPs
406 
408  const pose::Pose & pose_in ) {
409 
410  TR << "UBI Assigning non CSPs" << std::endl;
411 
412  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 4 ) );
413  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 5 ) );
414  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 6 ) );
415  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 7 ) );
416  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 8 ) );
417  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 9 ) );
418  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 10 ) );
419  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 11 ) );
420  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 12 ) );
421  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 13 ) );
422  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 15 ) );
423  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 16 ) );
424  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 19 ) );
425  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 22 ) );
426  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 30 ) );
427  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 31 ) );
428  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 37 ) );
429  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 45 ) );
430  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 47 ) );
431  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 48 ) );
432  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 49 ) );
433  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 62 ) );
434  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 63 ) );
435  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 64 ) );
436  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 66 ) );
437  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 67 ) );
438  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 70 ) );
439  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 71 ) );
440  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 72 ) );
441  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 73 ) );
442  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 75 ) );
443  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 76 ) );
444  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 77 ) );
445  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 78 ) );
446  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 79 ) );
447  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 81 ) );
448  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 82 ) );
449  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 83 ) );
450  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 85 ) );
451  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 86 ) );
452  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 87 ) );
453  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 88 ) );
454  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 89 ) );
455  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 91 ) );
456  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 92 ) );
457  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 93 ) );
458  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 94 ) );
459  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 95 ) );
460  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 97 ) );
461  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 98 ) );
462  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 99 ) );
463  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 101 ) );
464  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 102 ) );
465  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 103 ) );
466  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 104 ) );
467  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 105 ) );
468  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 106 ) );
469  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 107 ) );
470  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 108 ) );
471  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 109 ) );
472  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 110 ) );
473  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 111 ) );
474  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 113 ) );
475  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 114 ) );
476  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 115 ) );
477  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 116 ) );
478  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 117 ) );
479  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 118 ) );
480  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 119 ) );
481  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 120 ) );
482  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 121 ) );
483  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 122 ) );
484  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 123 ) );
485  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 124 ) );
486  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 125 ) );
487  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 126 ) );
488  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 127 ) );
489  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 128 ) );
490  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 129 ) );
491  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 131 ) );
492  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 132 ) );
493  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 133 ) );
494  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 134 ) );
495  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 135 ) );
496  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 136 ) );
497  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 137 ) );
498  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 138 ) );
499  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 139 ) );
500  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 140 ) );
501  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 141 ) );
502  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 142 ) );
503  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 143 ) );
504  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 144 ) );
505  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 145 ) );
506  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 146 ) );
507  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 147 ) );
508  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 148 ) );
509  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 149 ) );
510  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 150 ) );
511  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 151 ) );
512  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 152 ) );
513  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 153 ) );
514  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 154 ) );
515  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 155 ) );
516  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 156 ) );
517  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 157 ) );
518  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 158 ) );
519  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 159 ) );
520  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 161 ) );
521  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 162 ) );
522  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 165 ) );
523 
524  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 2 ) );
525  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 3 ) );
526  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 4 ) );
527  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 5 ) );
528  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 10 ) );
529  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 12 ) );
530  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 15 ) );
531  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 16 ) );
532  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 17 ) );
533  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 18 ) );
534  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 20 ) );
535  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 21 ) );
536  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 22 ) );
537  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 25 ) );
538  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 26 ) );
539  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 27 ) );
540  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 28 ) );
541  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 29 ) );
542  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 30 ) );
543  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 31 ) );
544  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 33 ) );
545  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 34 ) );
546  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 35 ) );
547  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 36 ) );
548  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 39 ) );
549  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 40 ) );
550  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 41 ) );
551  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 44 ) );
552  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 50 ) );
553  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 52 ) );
554  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 55 ) );
555  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 56 ) );
556  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 57 ) );
557  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 58 ) );
558  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 59 ) );
559  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 60 ) );
560  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 61 ) );
561  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 62 ) );
562  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 63 ) );
563  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 64 ) );
564 
565  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 2 ) );
566  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 3 ) );
567  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 4 ) );
568  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 5 ) );
569  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 6 ) );
570  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 8 ) );
571  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 10 ) );
572  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 11 ) );
573  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 12 ) );
574  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 13 ) );
575  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 14 ) );
576  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 15 ) );
577  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 16 ) );
578  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 17 ) );
579  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 18 ) );
580  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 20 ) );
581  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 21 ) );
582  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 22 ) );
583  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 25 ) );
584  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 26 ) );
585  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 27 ) );
586  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 28 ) );
587  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 30 ) );
588  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 31 ) );
589  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 32 ) );
590  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 33 ) );
591  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 34 ) );
592  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 35 ) );
593  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 36 ) );
594  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 39 ) );
595  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 40 ) );
596  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 41 ) );
597  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 42 ) );
598  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 44 ) );
599  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 47 ) );
600  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 49 ) );
601  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 50 ) );
602  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 52 ) );
603  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 54 ) );
604  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 55 ) );
605  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 56 ) );
606  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 57 ) );
607  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 58 ) );
608  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 59 ) );
609  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 60 ) );
610  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 61 ) );
611  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 62 ) );
612  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 63 ) );
613  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 64 ) );
614  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 65 ) );
615  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 66 ) );
616  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 67 ) );
617  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 68 ) );
618  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 72 ) );
619  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 74 ) );
620  non_CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'C', 76 ) );
621 
622  TR << "UBI Done: Assigning non CSPs" << std::endl;
623 
624  return;
625  } // assign_non_CSPs
626 
627 
629  using namespace basic::options;
630  using namespace basic::options::OptionKeys;
631  using namespace core::scoring;
632  using namespace core::scoring::constraints;
633  using namespace chemical;
634  using namespace id;
635  //using namespace jobdist;
636  //using pose::datacache::CacheableDataType::SCORE_MAP;
638 
639  // control monoubiquitin monomer
640  if( monoub_mode_ ) {
641  monoub_apply( pose_in );
642  return;
643  }
644 
645  /*
646  {
647  evaluate_native( pose_in );
648  return;
649  }
650  */
651 
654  mtsl_constraint->apply( pose_in );
655 
656  const pose::Pose start_pose( pose_in );
657 
658  // setup key residues
659  setup_key_residues( start_pose );
660 
661  // assign Chemical Shift Perturbations
662  assign_CSPs( start_pose );
663 
664  // setup Move Maps
665  setup_move_maps();
666 
667  // Residue movers
670  protocols::simple_moves::ReturnSidechainMover recover_sidechains( start_pose);
671 
672  // centroid mode
673  // Filter distance for K48-Cterminal
674  Real ubi_cov_bond_dist( 100.00 );
675  Size tries = 0;
676 
677  if( !cov_bond_only_flag_ ) {
678  //start loop of decoy creation until filters are all passed
679  for (Size r = 1; r <= max_repeats_; r++){
680  tries = r;
681  pose_in = start_pose;
682 
683  if( !refinement_mode_ ) {
684  // convert to centroid mode
685  to_centroid.apply( pose_in );
686  ubi_cov_bond_dist = centroid_mode_perturbation( pose_in );
687 
688  // add scores to map for output
689  score_map_[ "AD_k48_CA_CA" ] = ubi_cov_bond_dist;
691 
692  // check low-res docking filter
693  ( *dock_lowres_cst_scorefxn_ )( pose_in );
695  } // if( !refinement_mode_ )
696 
697  applied_fullatom_pert_ = false;
698 
699  // fullatom mode
701  //pose_in.dump_pdb( "main_passed_centroid.pdb" );
702  // convert to full atom
703  if( !refinement_mode_ ) {
704  to_all_atom.apply( pose_in );
705  recover_sidechains.apply( pose_in );
706  } // if( !refinement_mode_ )
707  ubi_cov_bond_dist = fullatom_mode_perturbation( pose_in );
708 
709  // add scores to map for output
710  score_map_[ "AD_k48_CA_CA" ] = ubi_cov_bond_dist;
712 
713  // check highres docking filter
714  ( *dockfa_cst_scorefxn_ )( pose_in );
716  } // if fullatom mode
717  // pose_in.dump_pdb( "fullatom.pdb" );
718 
720  else TR <<"UBI Repeating structure " << r << " times" << std::endl;
721 
722  } // for max_repeats_
723  }
724 
725  if( !refinement_mode_ ) {
726  optimize_cov_bond( pose_in );
727  ( *dockfa_cst_scorefxn_ )( pose_in );
728  fullatom_filter( pose_in );
729  } // if ( !refinement_mode_ )
730 
731  // add scores to map for output
733  ( *output_full_scorefxn_ )( pose_in );
735  }
736  else {
737  ( *output_cen_scorefxn_ )( pose_in );
739  }
740 
741  if( !cov_bond_only_flag_ ) {
742  score_map_["AJ_k48r_rms"] = calc_Lrmsd( pose_in, start_pose,
743  e2_k48r_jump_ );
744  score_map_["AK_d77_rms"] = calc_Lrmsd( pose_in, start_pose,
745  e2_d77_jump_ );
746  score_map_["AI_rms"] = score_map_["AJ_k48r_rms"] +
747  score_map_["AK_d77_rms"];;
748  }
749  else
750  score_map_["AL_k48r_tail_rmsg"] = calc_Lrmsd( pose_in, start_pose,
751  flex_cter_ ); // option
752 
753  pose_in.data().set( core::pose::datacache::CacheableDataType::SCORE_MAP, new basic::datacache::
754  DiagnosticData(score_map_));
755 
756  TR << "UBI Outputing structure after " << tries << " times" << std::endl;
757 
758  //constraints::ConstraintFactory cst_factory;
759  //constraints::ConstraintOP cst_op;
760  //cst_op = cst_factory.newConstraint( "AtomPair" );
761  //cst_op->read_def( "AtomPair CA 213 CA 74 BOUNDED 0.0 15.0 4.0", pose_in, func_factory );
762  }// end apply
763 
766  return "ubi_e2c_modeler";
767  }
768 
769  void
771  const pose::Pose & pose_in ) {
772 
773  TR << "UBI Setting Up Key Residues" << std::endl;
774 
775  pose::PDBInfoCOP pdb_info = pose_in.pdb_info();
776  d77_end_ = pose_in.total_residue();
777 
778  char chain = '_';
779  char old_chain = '_';
780  Size next_chain( 0 );
781  for( Size i = 1; i <= d77_end_; i++ ) {
782  chain = pdb_info->chain( i );
783 
784  // if initial condition
785  if( i == 1 )
786  old_chain = pdb_info->chain( i );
787 
788  if( chain != old_chain ) {
789  if ( next_chain == 0 ) {
790  next_chain = 1;
791  e2_end_ = i - 1;
792  }
793  else {
794  k48r_end_ = i -1;
795  }
796  } // if new chain
797  old_chain = chain;
798  }// for i <= d77_end_
799 
801  e2_end_ );
803  e2_end_ + 1,
804  k48r_end_ );
806  k48r_end_ + 1,
807  d77_end_ );
808 
809  // C-terminal trimmed parameters default
813 
814  k48r_48_lys_ = pose_in.pdb_info()->pdb2pose( 'B', 48 );
815  d77_48_lys_ = pose_in.pdb_info()->pdb2pose( 'C', 48 );
816  k48r_48k_mtsl_ = pose_in.pdb_info()->pdb2pose( 'B', 48 );
817  d77_75g_mtsl_ = pose_in.pdb_info()->pdb2pose( 'C', 75 );
818 
819  TR << "UBI Done: Setting Up Key Residues" << std::endl;
820 
821  //utility::exit( EXIT_FAILURE, __FILE__, __LINE__);
822  } // setup_key_residues
823 
824  void
826  using namespace core;
827  using namespace kinematics;
828 
829  if( init_all_dof_map_ ) {
830  all_dof_map_ = new MoveMap( *init_all_dof_map_ );
831  k48r_docking_map_ = new MoveMap( *init_k48r_docking_map_ );
832  d77_docking_map_ = new MoveMap( *init_d77_docking_map_ );
833  docking_map_ = new MoveMap( *init_docking_map_ );
834  flex_cter_map_ = new MoveMap( *init_flex_cter_map_ );
835 
836  TR << "UBI Reinitializing Move Maps" << std::endl;
837  return;
838  }
839 
840  TR << "UBI Setting Up Move Maps" << std::endl;
841 
842  bool bb = false;
843  bool chi = true;
844 
845  k48r_docking_map_ = new MoveMap();
846  k48r_docking_map_->clear();
847  k48r_docking_map_->set_chi( chi );
848  k48r_docking_map_->set_bb( bb );
849  k48r_docking_map_->set_jump( e2_k48r_jump_, true );
850  k48r_docking_map_->set_jump( e2_d77_jump_, false );
851 
852  d77_docking_map_ = new MoveMap();
853  d77_docking_map_->clear();
854  d77_docking_map_->set_chi( chi );
855  d77_docking_map_->set_bb( bb );
856  d77_docking_map_->set_jump( e2_k48r_jump_, false );
857  d77_docking_map_->set_jump( e2_d77_jump_, true );
858 
859  docking_map_ = new MoveMap();
860  docking_map_->clear();
861  docking_map_->set_chi( chi );
862  docking_map_->set_bb( bb );
863  docking_map_->set_jump( e2_k48r_jump_, true );
864  docking_map_->set_jump( e2_d77_jump_, true );
865 
866  flex_cter_map_ = new MoveMap();
867  flex_cter_map_->clear();
868  flex_cter_map_->set_chi( chi );
869  flex_cter_map_->set_bb( bb );
870  flex_cter_map_->set_jump( e2_k48r_jump_, false );
871  flex_cter_map_->set_jump( e2_d77_jump_, false );
872  for( Size i = 0; i <= flex_cter_; i++ ) {
873  flex_cter_map_->set_bb( k48r_end_ - i, true );
874  flex_cter_map_->set_bb( d77_end_ - i, true );
875  }
876 
877  if( cov_bond_only_flag_ ) {
878  // allow 2 additional residues of d77 C-terminal tail to move
879  flex_cter_map_->set_bb( d77_end_ - ( flex_cter_ + 1 ), true );
880  flex_cter_map_->set_bb( d77_end_ - ( flex_cter_ + 2 ), true );
881  }
882 
883  all_dof_map_ = new MoveMap();
884  all_dof_map_->clear();
885  all_dof_map_->set_chi( chi );
886  all_dof_map_->set_bb( bb );
887  all_dof_map_->set_jump( e2_k48r_jump_, true );
888  all_dof_map_->set_jump( e2_d77_jump_, true );
889  for( Size i = 0; i <= flex_cter_; i++ ) {
890  all_dof_map_->set_bb( k48r_end_ - i, true );
891  all_dof_map_->set_bb( d77_end_ - i, true );
892  }
893 
899 
900  TR << "UBI Done: Setting Up Move Maps" << std::endl;
901 
902  return;
903  } // setup_move_maps
904 
905  void
907  pose::Pose & pose_in,
908  bool trim ) {
909 
910  using namespace kinematics;
911 
912  TR << "UBI Setting up complex fold tree" << std::endl;
913 
914  FoldTree f;
915  f.clear();
916  Size nres = d77_end_;
917  Size jumppoint1 = e2_ctr_of_mass_;
918  Size jumppoint2 = k48r_ctr_of_mass_;
919  Size jumppoint3 = d77_ctr_of_mass_;
920  Size cutpoint1 = e2_end_;
921  Size cutpoint2 = k48r_end_;
922 
923  if( trim ) {
924  nres = d77_end_ - ( 2 * ( flex_cter_ + 1 ));
925  jumppoint1 = e2_ctr_of_mass_;
926  jumppoint2 = k48r_ctr_of_mass_;
927  jumppoint3 = d77_ctr_of_mass_ - ( flex_cter_ + 1 );
928  cutpoint1 = e2_end_;
929  cutpoint2 = k48r_end_ - ( flex_cter_ + 1 );
930  }
931 
932  f.add_edge( 1, jumppoint1, Edge::PEPTIDE );
933  f.add_edge( jumppoint1, cutpoint1, Edge::PEPTIDE );
934  f.add_edge( cutpoint1 + 1, jumppoint2, Edge::PEPTIDE );
935  f.add_edge( jumppoint2, cutpoint2, Edge::PEPTIDE );
936  f.add_edge( cutpoint2 + 1, jumppoint3, Edge::PEPTIDE );
937  f.add_edge( jumppoint3, nres, Edge::PEPTIDE );
938  f.add_edge( jumppoint1, jumppoint2, e2_k48r_jump_ );
939  f.add_edge( jumppoint1, jumppoint3, e2_d77_jump_ );
940  f.reorder( 1 );
941 
942  pose_in.fold_tree( f );
943 
944  TR << "UBI Done: Setting up complex fold tree" << std::endl;
945 
946  } // setup_complex_fold_tree
947 
948  void
950  pose::Pose & pose_in ) {
951  using namespace protocols::moves;
952 
953  TR << "UBI Initial C-Terminal Perturbation" << std::endl;
954 
955  setup_complex_fold_tree( pose_in );
956 
957  // idealize c-terminals
958  for( Size i = 0; i <= flex_cter_; i++ ) {
960  pose_in.conformation());
962  pose_in.conformation());
963  }
964 
965  // pose_in.dump_pdb( "idealized.pdb" );
966 
967  // extend c-terminals
968  Real const init_phi ( -150.0 );
969  Real const init_psi ( 150.0 );
970  Real const init_omega( 180.0 );
971 
972  for( Size i = 0; i <= flex_cter_; i++ ) {
973  if ( i != flex_cter_ ) {
974  pose_in.set_phi( k48r_end_ - i, init_phi );
975  pose_in.set_phi( d77_end_ - i, init_phi );
976  }
977  if ( i != 0 ) {
978  pose_in.set_psi( k48r_end_ - i, init_psi );
979  pose_in.set_psi( d77_end_ - i, init_psi );
980  }
981  if ( ( i != flex_cter_ ) && ( i != 0 ) ) {
982  pose_in.set_omega( k48r_end_ - i, init_omega );
983  pose_in.set_omega( d77_end_ - i, init_omega );
984  }
985  }
986 
987  // pose_in.dump_pdb( "extended.pdb" );
988 
989 
990  kinematics::MoveMapOP ub_cter_map( new kinematics::MoveMap() );
991  ub_cter_map->clear();
992  ub_cter_map->set_chi( true );
993  ub_cter_map->set_bb( false );
994  for( Size i = 0; i <= flex_cter_; i++ ) {
995  ub_cter_map->set_bb( k48r_end_ - i, true );
996  ub_cter_map->set_bb( d77_end_ - i, true );
997  }
998 
999  SequenceMoverOP perturb_min_cter( new SequenceMover() );
1000 
1002  temperature_, 8 );
1003  small_mover->angle_max( 90.0 );
1005  temperature_, 8 );
1006 
1007  shear_mover->angle_max( 90.0 );
1008 
1010  "linmin", min_tolerance_, nb_list_, false, false ) );
1011 
1012  perturb_min_cter->add_mover( small_mover );
1013  perturb_min_cter->add_mover( shear_mover );
1014  perturb_min_cter->add_mover( min_mover );
1015 
1016  MonteCarloOP mc;
1018  TrialMoverOP cter_pert_trial = new TrialMover( perturb_min_cter, mc );
1019  RepeatMoverOP cter_cycle;
1020  cter_cycle = new RepeatMover( cter_pert_trial, 40 ); // cycles
1021  cter_cycle->apply( pose_in );
1022  mc->recover_low( pose_in );
1023 
1024 
1025  TR << "UBI Done: Initial C-Terminal Perturbation" << std::endl;
1026 
1027  } // initial_cter_perturbation
1028 
1029  void
1031  Size jumppoint1,
1032  Size cutpoint,
1033  Size jumppoint2,
1034  Size nres,
1035  pose::Pose & pose_in ) {
1036 
1037  using namespace kinematics;
1038 
1039  TR << "UBI Setting up simple fold tree" << std::endl;
1040 
1041  FoldTree f;
1042  f.clear();
1043 
1044  f.add_edge( 1, jumppoint1, Edge::PEPTIDE );
1045  f.add_edge( jumppoint1, cutpoint, Edge::PEPTIDE );
1046  f.add_edge( cutpoint + 1, jumppoint2, Edge::PEPTIDE );
1047  f.add_edge( jumppoint2, nres, Edge::PEPTIDE );
1048  f.add_edge( jumppoint1, jumppoint2, e2_k48r_jump_ );
1049  f.reorder( 1 );
1050 
1051  pose_in.fold_tree( f );
1052 
1053  TR << "UBI Done: Setting up simple fold tree" << std::endl;
1054 
1055  } // setup_simple_fold_tree
1056 
1057  void
1059  pose::Pose & pose_in ) {
1060 
1061  TR << "UBI Trimming C-terminal" << std::endl;
1062 
1063  for( Size i = 0; i <= flex_cter_; i++ )
1064  pose_in.delete_polymer_residue( d77_end_ - i );
1065 
1066  for( Size i = 0; i <= flex_cter_; i++ )
1067  pose_in.delete_polymer_residue( k48r_end_ - i );
1068 
1069  k48r_trim_end_ = k48r_end_ - ( flex_cter_ + 1 );
1070  d77_trim_end_ = pose_in.total_residue();
1072 
1073  TR << "UBI Done: Trimming C-terminal" << std::endl;
1074 
1075  return;
1076  } // trim_cter
1077 
1078  void
1080  pose::Pose & pose_in,
1081  pose::Pose without_cter ) {
1082 
1083  TR << "UBI Restoring C-terminal" << std::endl;
1084 
1085  setup_complex_fold_tree( pose_in );
1086  Size ub_trim_size = d77_trim_end_ - k48r_trim_end_;
1087  Size ub_size = d77_end_ - k48r_end_;
1088  pose::Pose k48r( without_cter, e2_end_ + 1, k48r_trim_end_ );
1089  pose::Pose d77( without_cter, k48r_trim_end_ + 1, d77_trim_end_ );
1090 
1091  for( Size i = 0, j = 0; i <= flex_cter_; i++, j++ ) {
1093  pose_in.residue( k48r_end_ - (flex_cter_ - i ) ), ub_trim_size +
1094  j, true);
1096  pose_in.residue( d77_end_ - (flex_cter_ - i ) ), ub_trim_size +
1097  j, true);
1098  }
1099 
1100  pose_in.copy_segment( ub_size, k48r, e2_end_ + 1, 1 );
1102  to_centroid.apply( pose_in );
1103  pose_in.copy_segment( ub_size, d77, k48r_end_ + 1, 1 );
1104  to_centroid.apply( pose_in );
1105 
1106  //pose_in.dump_pdb( "post_append.pdb" );
1107  setup_complex_fold_tree( pose_in );
1108 
1109  TR << "UBI Done: Restoring C-terminal" << std::endl;
1110 
1111  return;
1112  } // restore_cter
1113 
1114  void
1116  pose::Pose & pose_in ) {
1117  //using pose::datacache::CacheableDataType::INTERFACE_INFO;
1118  using namespace core::scoring;
1119  using namespace protocols::docking;
1120  using namespace protocols::moves;
1121 
1122  TR << "UBI Initial K48R Perturbation" << std::endl;
1123 
1124  pose::Pose e2_k48r( pose_in, 1, k48r_trim_end_ );
1125 
1126  Size ub_trim_size = d77_trim_end_ - k48r_trim_end_;
1127 
1128  Size jumppoint1 = e2_ctr_of_mass_;
1129  Size cutpoint = e2_end_;
1130  Size jumppoint2 = k48r_ctr_of_mass_;
1131  Size nres = k48r_trim_end_;
1132  setup_simple_fold_tree( jumppoint1, cutpoint, jumppoint2, nres, e2_k48r);
1133 
1135  to_centroid.apply( e2_k48r );
1136 
1137  // make starting perturbations based on command-line flags
1138  DockingInitialPerturbationOP init_e2_mono_ub_dock( new
1139  DockingInitialPerturbation( e2_k48r_jump_,true/*slide into contact*/));
1140  // pose_in.dump_pdb( "pre.pdb" );
1143  15, // rot magnitude
1144  5 ); // trans magnitude
1145  mover.apply( e2_k48r );
1147  spin.apply( e2_k48r );
1149  slide.apply( e2_k48r );
1150  }
1151  else
1152  init_e2_mono_ub_dock->apply( e2_k48r );
1153 
1154  {
1155  // dock movers
1156  rigid::RigidBodyPerturbNoCenterMoverOP dock_e2_mono_ub( new
1157  rigid::RigidBodyPerturbNoCenterMover( e2_k48r_jump_, 10.0, // rot_magnitude
1158  1.0 ) ); // trans_magnitude_
1159  MonteCarloOP mc;
1160  mc = new moves::MonteCarlo( e2_k48r, *dock_lowres_scorefxn_,
1161  temperature_ );
1162  TrialMoverOP dock_trial = new TrialMover( dock_e2_mono_ub, mc );
1163  Size const cycles( 50 );
1164  RepeatMoverOP rbp_cycle = new RepeatMover( dock_trial, cycles );
1165  rbp_cycle->apply( e2_k48r );
1166  mc->recover_low( e2_k48r );
1167  }
1168  pose_in.copy_segment( ub_trim_size, e2_k48r, e2_end_ + 1, e2_end_ + 1 );
1169  to_centroid.apply( pose_in );
1170 
1171  Size e2_k48r_ctr_of_mass = geometry::residue_center_of_mass( pose_in,
1172  1, k48r_trim_end_ );
1173  // pose_in.dump_pdb( "mid.pdb" );
1174 
1175  jumppoint1 = e2_k48r_ctr_of_mass;
1176  cutpoint = k48r_trim_end_;
1177  jumppoint2 = d77_trim_ctr_mass_;
1178  nres = d77_trim_end_;
1179  setup_simple_fold_tree( jumppoint1, cutpoint, jumppoint2, nres, pose_in);
1180  if( higher_d77_pert_mode_ && !k48r_swap_ ) {
1182  15, // rot magnitude
1183  5 ); // trans magnitude
1184  mover.apply( pose_in );
1186  spin.apply( pose_in );
1188  slide.apply( pose_in );
1189  }
1190  else
1191  init_e2_mono_ub_dock->apply( pose_in );
1192  {
1193  // dock movers
1195  new rigid::RigidBodyPerturbNoCenterMover( e2_k48r_jump_, 10.0, // rot_magnitude
1196  1.0 ) ); // trans_magnitude_
1197 
1198  setup_complex_fold_tree( pose_in, true );
1200  tri_interface->add_jump( e2_d77_jump_ );
1201  pose_in.data().set( core::pose::datacache::CacheableDataType::INTERFACE_INFO, tri_interface );
1202  Real score = ( *dock_lowres_scorefxn_ )( pose_in );
1203  Real current_CSP_fraction = CSP_fraction( pose_in,
1204  false, // non_CSP
1205  true, // trim
1206  k48r_swap_);
1207  Real current_non_CSP_fraction = CSP_fraction( pose_in,
1208  true, // non_CSP
1209  true, // trim
1210  k48r_swap_);
1211  Real last_accepted_CSP_score = score
1212  + ( centroid_non_CSP_weight_ * current_non_CSP_fraction)
1213  - ( centroid_CSP_weight_ * current_CSP_fraction );
1214  Real lowest_CSP_score = last_accepted_CSP_score;
1215  setup_simple_fold_tree( jumppoint1, cutpoint, jumppoint2, nres,
1216  pose_in);
1218  pose_in.data().set( core::pose::datacache::CacheableDataType::INTERFACE_INFO, one_interface );
1219  pose::Pose best_CSP_pose( pose_in );
1220  pose::Pose lowest_CSP_score_pose( pose_in );
1221 
1222  for( Size i = 1; i <= 50 ; i++ ) {
1223  dock_e2_mono_ub->apply( pose_in );
1224  ( *dock_lowres_scorefxn_ )( pose_in );
1225  setup_complex_fold_tree( pose_in, true );
1226  pose_in.data().set( core::pose::datacache::CacheableDataType::INTERFACE_INFO, tri_interface );
1227  score = ( *dock_lowres_scorefxn_ )( pose_in );
1228  current_CSP_fraction = CSP_fraction(pose_in, false, true,k48r_swap_);
1229  current_non_CSP_fraction=CSP_fraction(pose_in,true,true, k48r_swap_);
1230  Real current_CSP_score = score
1231  + ( centroid_non_CSP_weight_ * current_non_CSP_fraction )
1232  - ( centroid_CSP_weight_ * current_CSP_fraction );
1233  Real boltz_factor = ( last_accepted_CSP_score - current_CSP_score ) /
1234  temperature_;
1235  Real probability = std::exp( std::min (40.0, std::max(-40.0,
1236  boltz_factor)));
1237  Real random = RG.uniform();
1238  if( (current_CSP_score < last_accepted_CSP_score) ||
1239  ( random < probability ) ) {
1240  last_accepted_CSP_score = current_CSP_score;
1241  best_CSP_pose = pose_in;
1242  if( current_CSP_score < lowest_CSP_score ) {
1243  lowest_CSP_score = current_CSP_score;
1244  lowest_CSP_score_pose = pose_in;
1245  }
1246  }
1247  pose_in = best_CSP_pose;
1248  setup_simple_fold_tree( jumppoint1, cutpoint, jumppoint2, nres,
1249  pose_in);
1250  pose_in.data().set( core::pose::datacache::CacheableDataType::INTERFACE_INFO, one_interface );
1251  }
1252  pose_in = lowest_CSP_score_pose;
1253  setup_simple_fold_tree( jumppoint1, cutpoint, jumppoint2, nres,
1254  pose_in);
1255  pose_in.data().set( core::pose::datacache::CacheableDataType::INTERFACE_INFO, one_interface );
1256  }
1257 
1258  // setup_complex_fold_tree( pose_in );
1259  // pose_in.dump_pdb( "final.pdb" );
1260 
1261  TR << "UBI Done: Initial K48R Perturbation" << std::endl;
1262 
1263  return;
1264  } // init_k48r_perturbation
1265 
1266  void
1268  pose::Pose & pose_in ) {
1269 
1270  TR << "UBI Initial D77 Perturbation" << std::endl;
1271 
1272  pose::Pose e2_k48r( pose_in, 1, k48r_trim_end_ );
1273  pose::Pose e2_d77( e2_k48r );
1274  Size ub_trim_size = d77_trim_end_ - k48r_trim_end_;
1275  e2_d77.copy_segment( ub_trim_size, pose_in, e2_end_ + 1,
1276  k48r_trim_end_ + 1 );
1277 
1279  to_centroid.apply( e2_d77 );
1280 
1281  pose_in.copy_segment( ub_trim_size,e2_k48r, k48r_trim_end_+1, e2_end_+1);
1282  to_centroid.apply( pose_in );
1283  pose_in.copy_segment( ub_trim_size, e2_d77, e2_end_ + 1, e2_end_+1);
1284  to_centroid.apply( pose_in );
1285 
1286  init_k48r_perturbation( pose_in );
1287 
1288  pose::Pose pseudo_e2_k48r( pose_in, 1, k48r_trim_end_ );
1289  pose::Pose pseudo_e2_d77( e2_k48r );
1290  pseudo_e2_d77.copy_segment( ub_trim_size, pose_in,e2_end_ + 1,
1291  k48r_trim_end_ + 1 );
1292  to_centroid.apply( pseudo_e2_d77 );
1293 
1294  pose_in.copy_segment( ub_trim_size, pseudo_e2_k48r, k48r_trim_end_ + 1,
1295  e2_end_ + 1 );
1296  to_centroid.apply( pose_in );
1297  pose_in.copy_segment( ub_trim_size,pseudo_e2_d77,e2_end_+1, e2_end_ + 1);
1298  to_centroid.apply( pose_in );
1299 
1300  TR << "UBI Done: Initial D77 Perturbation" << std::endl;
1301 
1302  return;
1303  } // init_d77_perturbation
1304 
1305  Real
1307  pose::Pose & pose_in ) {
1308  //using pose::datacache::CacheableDataType::INTERFACE_INFO;
1309  using namespace core::scoring;
1310  using namespace protocols::docking;
1311  using namespace protocols::moves;
1312 
1313  TR << "UBI Initial Perturbation" << std::endl;
1314 
1316  pose_in.data().set( core::pose::datacache::CacheableDataType::INTERFACE_INFO, one_interface );
1317 
1318  // initial_cter_perturbation( pose_in );
1319 
1320  pose::Pose without_cter( pose_in );
1321 
1322  trim_cter( without_cter );
1323 
1324  Real k48r_vs_d77 = RG.uniform();
1325  if( k48r_vs_d77 < 0.5 ) {
1326  k48r_swap_ = false;
1327  init_k48r_perturbation( without_cter );
1328  }
1329  else {
1330  k48r_swap_ = true;
1331  init_d77_perturbation( without_cter );
1332  }
1333 
1334  restore_cter( pose_in, without_cter );
1335  initial_cter_perturbation( pose_in );
1336 
1337  /*
1338  // make starting perturbations based on command-line flags
1339  DockingInitialPerturbationOP init_e2_k48r_dock( new
1340  DockingInitialPerturbation( e2_k48r_jump_,
1341  true)); // slide into contact
1342  DockingInitialPerturbationOP init_e2_d77_dock( new
1343  DockingInitialPerturbation( e2_d77_jump_,
1344  true)); // slide into contact
1345 
1346  SequenceMoverOP init_e2_k48r_d77_docker( new SequenceMover() );
1347  init_e2_k48r_d77_docker->add_mover( init_e2_k48r_dock );
1348  init_e2_k48r_d77_docker->add_mover( init_e2_d77_dock );
1349  SequenceMoverOP init_e2_d77_k48r_docker( new SequenceMover() );
1350  init_e2_d77_k48r_docker->add_mover( init_e2_d77_dock );
1351  init_e2_d77_k48r_docker->add_mover( init_e2_k48r_dock );
1352 
1353  RandomMoverOP init_docker( new RandomMover() );
1354  init_docker->add_mover( init_e2_k48r_d77_docker, 0.5 );
1355  init_docker->add_mover( init_e2_d77_k48r_docker, 0.5 );
1356 
1357  init_docker->apply( pose_in );
1358  //pose_in.dump_pdb( "init_perturb.pdb" );
1359  // checking distance on randomizing
1360  */
1361 
1362  Real current_ubi_cov_bond_dist( 100.00 );
1363  numeric::xyzVector_float d77_lys_CA(
1364  pose_in.residue( d77_48_lys_ ).xyz( CA ) ),
1365  k48r_gly_CA( pose_in.residue( k48r_end_ ).xyz( CA ) );
1366  current_ubi_cov_bond_dist = d77_lys_CA.distance( k48r_gly_CA );
1367 
1368  // Resetting Interfaces to three
1370  tri_interface->add_jump( e2_d77_jump_ );
1371  pose_in.data().set( core::pose::datacache::CacheableDataType::INTERFACE_INFO, tri_interface );
1372 
1373  TR << "UBI Done: Initial Perturbation" << std::endl;
1374 
1375  return( current_ubi_cov_bond_dist );
1376  } // initial_perturbation
1377 
1378  Real
1380  pose::Pose & pose_in ) {
1381 
1382  //using pose::datacache::CacheableDataType::INTERFACE_INFO;
1383  using namespace core::scoring;
1384  using namespace protocols::docking;
1385  using namespace protocols::moves;
1386 
1387  TR << "UBI Centroid Mode Perturbation" << std::endl;
1388 
1389  setup_complex_fold_tree( pose_in );
1390 
1392  tri_interface->add_jump( e2_d77_jump_ );
1393  pose_in.data().set( core::pose::datacache::CacheableDataType::INTERFACE_INFO, tri_interface );
1394 
1395  pose::Pose start_pose;
1396  start_pose = pose_in;
1397  Real max_di_ubi_dist = 1.25 * max_k48_cter_dist_;
1398  Real current_ubi_cov_bond_dist( 100.00 );
1399 
1400  Size init_trials(0);
1401  while( current_ubi_cov_bond_dist > max_di_ubi_dist ) {
1402  init_trials++;
1403  pose_in = start_pose;
1404  current_ubi_cov_bond_dist = initial_perturbation( pose_in );
1405  TR << "UBI Init Trial: " << init_trials
1406  << "\t" << "Cov Bond Distance: "
1407  << current_ubi_cov_bond_dist << std::endl;
1408  }
1409 
1410  //pose_in.dump_pdb( "final_init.pdb" );
1411 
1412  // movers
1413  // dock movers
1415  new rigid::RigidBodyPerturbNoCenterMover( e2_k48r_jump_, 5.0, // rot_magnitude
1416  0.7 ) ); // trans_magnitude_
1418  new rigid::RigidBodyPerturbNoCenterMover( e2_d77_jump_, 5.0, // rot_magnitude
1419  0.7 ) ); // trans_magnitude_
1420 
1421  RandomMoverOP docker( new RandomMover() );
1422  //docker->add_mover( dock_e2_k48r, 0.5 );
1423  //docker->add_mover( dock_k48r_d77, 0.5 );
1424 
1425  RepeatMoverOP cter_cycle;
1426 
1427  {
1428  //////////Small/ShearMovers//////////////////////////////////////
1429  SequenceMoverOP perturb_min_cter( new SequenceMover() );
1430 
1432  temperature_, 5 /*n_moves*/ );
1433  small_mover->angle_max( 90.0 );
1434 
1436  temperature_, 5 /*n_moves*/ );
1437  shear_mover->angle_max( 90.0 );
1438 
1440  "linmin", min_tolerance_, nb_list_, false /*deriv_check*/,
1441  false /* non verbose-deriv-check, default*/ ) );
1442 
1443  perturb_min_cter->add_mover( small_mover );
1444  perturb_min_cter->add_mover( shear_mover );
1445  perturb_min_cter->add_mover( min_mover );
1446 
1447  MonteCarloOP c_ter_mc;
1448  c_ter_mc = new moves::MonteCarlo( pose_in, *lowres_cst_scorefxn_,
1449  temperature_ );
1450  TrialMoverOP cter_pert_trial = new TrialMover( perturb_min_cter,
1451  c_ter_mc );
1452  cter_cycle = new RepeatMover( cter_pert_trial, 10 ); // cycles
1453  }
1454 
1455  //SequenceMoverOP dock_n_perturb( new SequenceMover() );
1456  //dock_n_perturb->add_mover( docker );
1457  //dock_n_perturb->add_mover( cter_cycle );
1458 
1459  docker->add_mover( dock_e2_k48r, 0.375 );
1460  docker->add_mover( dock_k48r_d77, 0.375 );
1461  docker->add_mover( cter_cycle, 0.25 );
1462 
1463  //MonteCarloOP mc;
1464  //mc = new moves::MonteCarlo( pose_in, *dock_lowres_cst_scorefxn_,
1465  // temperature_ );
1466  //
1467  //TrialMoverOP dock_pert_trial = new TrialMover( dock_n_perturb, mc );
1468  //
1469  //Size const cycles( 50 );
1470  //RepeatMoverOP rbp_cycle = new RepeatMover( dock_pert_trial, cycles );
1471 
1472  //rbp_cycle->apply( pose_in );
1473  //mc->recover_low( pose_in );
1474 
1475  Real score = ( *dock_lowres_cst_scorefxn_ )( pose_in );
1476  Real last_accepted_CSP_score = score
1477  + ( centroid_non_CSP_weight_ * CSP_fraction( pose_in, true ) )
1478  - ( centroid_CSP_weight_ * CSP_fraction( pose_in ) );
1479  Real lowest_CSP_score = last_accepted_CSP_score;
1480  pose::Pose best_CSP_pose( pose_in );
1481  pose::Pose lowest_CSP_score_pose( pose_in );
1482 
1483  for( Size i = 1; i <= 50 ; i++ ) {
1484  docker->apply( pose_in );
1485  score = ( *dock_lowres_cst_scorefxn_ )( pose_in );
1486  Real current_CSP_fraction = CSP_fraction( pose_in );
1487  Real current_non_CSP_fraction = CSP_fraction( pose_in, true );
1488  Real current_CSP_score = score
1489  + ( centroid_non_CSP_weight_ * current_non_CSP_fraction )
1490  - ( centroid_CSP_weight_ * current_CSP_fraction );
1491  Real boltz_factor = ( last_accepted_CSP_score - current_CSP_score ) /
1492  temperature_;
1493  Real probability = std::exp( std::min (40.0, std::max(-40.0,
1494  boltz_factor)));
1495  Real random = RG.uniform();
1496  if( (current_CSP_score < last_accepted_CSP_score) ||
1497  ( random < probability ) ){
1498  last_accepted_CSP_score = current_CSP_score;
1499  best_CSP_pose = pose_in;
1500  if( current_CSP_score < lowest_CSP_score ) {
1501  lowest_CSP_score = current_CSP_score;
1502  lowest_CSP_score_pose = pose_in;
1503  }
1504  }
1505  pose_in = best_CSP_pose;
1506  }
1507  pose_in = lowest_CSP_score_pose;
1508 
1509  // pose_in.dump_pdb( "post_centroid.pdb" );
1510  numeric::xyzVector_float d77_lys_CA(
1511  pose_in.residue( d77_48_lys_ ).xyz( CA ) ),
1512  k48r_gly_CA( pose_in.residue( k48r_end_ ).xyz( CA ) );
1513  current_ubi_cov_bond_dist = d77_lys_CA.distance( k48r_gly_CA );
1514  TR << "UBI Done: Centroid Mode Perturbation" << std::endl;
1515 
1516  return( current_ubi_cov_bond_dist );
1517  } // centroid_mode_perturbation
1518 
1519  Real
1521  pose::Pose & pose_in ) {
1522  using namespace moves;
1523  using namespace pack::task;
1524  using namespace pack::task::operation;
1525 
1526  TR << "UBI Fullatom Mode Perturbation" << std::endl;
1527 
1528  initial_repack( pose_in ); // **REAL** REPACKING
1529 
1530  SequenceMoverOP fullatom_optimizer( new SequenceMover() ); // **MAIN**
1531 
1533  pack_scorefxn_ );
1534  pack_interface_repack->task_factory(tf_);
1535 
1536  //fullatom_optimizer->add_mover( pack_interface_repack ); // **MAIN**
1537  //pack_interface_repack->apply( pose_in );
1538 
1539  //set up minimizer movers
1550 
1552  pack_scorefxn_, tf_ );
1553 
1554  // set up rigid body movers
1555  Real trans_magnitude = 0.1; // default high-res docking values
1556  Real rot_magnitude = 5.0; // default high-res docking values
1558  e2_k48r_jump_, rot_magnitude, trans_magnitude , rigid::partner_downstream,
1559  true );
1561  e2_d77_jump_, rot_magnitude, trans_magnitude, rigid::partner_downstream,
1562  true );
1563 
1565  pack_scorefxn_, tf_ );
1566 
1567  MonteCarloOP mc;
1569 
1570  // cter movers
1571 
1572  RepeatMoverOP cter_mover_rot;
1573  //////////Small/ShearMovers//////////////////////////////////////
1574  SequenceMoverOP perturb_min_cter( new SequenceMover() );
1575 
1577  temperature_, 5 );
1578  small_mover->angle_max( 5.0 );
1580  temperature_, 5 );
1581  shear_mover->angle_max( 5.0 );
1582 
1583  perturb_min_cter->add_mover( small_mover );
1584  perturb_min_cter->add_mover( shear_mover );
1585  perturb_min_cter->add_mover( pack_rottrial );
1586  perturb_min_cter->add_mover( flex_cter_min_mover );
1587 
1588  TrialMoverOP cter_pert_trial = new TrialMover( perturb_min_cter, mc );
1589  cter_mover_rot = new RepeatMover( cter_pert_trial, 10 ); // cycles
1590 
1591  SequenceMoverOP cter_mover_repack( new SequenceMover() );
1592  cter_mover_repack->add_mover( cter_mover_rot );
1593  cter_mover_repack->add_mover( pack_interface_repack );
1594 
1595  ////////////////////////////////////////////////////////////////////
1596 
1597  cter_mover_repack->apply( pose_in ); // **REAL** FIRST C-TER RELAX
1598 
1599  SequenceMoverOP k48r_perturb_rot( new SequenceMover() );
1600  SequenceMoverOP d77_perturb_rot( new SequenceMover() );
1601  SequenceMoverOP cter_perturb_rot( new SequenceMover() );
1602 
1603 
1604  k48r_perturb_rot->add_mover( k48r_perturb );
1605  k48r_perturb_rot->add_mover( pack_rottrial );
1606 
1607  d77_perturb_rot->add_mover( d77_perturb );
1608  d77_perturb_rot->add_mover( pack_rottrial );
1609 
1610  RandomMoverOP random_moves( new RandomMover() );
1611  random_moves->add_mover( k48r_perturb_rot, 0.375 );
1612  random_moves->add_mover( d77_perturb_rot, 0.375 );
1613  random_moves->add_mover( perturb_min_cter, 0.25 );
1614 
1615  //TrialMoverOP mover_trial = new TrialMover( random_moves, mc );
1616 
1617  SequenceMoverOP min_n_repack( new SequenceMover() );
1618  min_n_repack->add_mover( pack_interface_repack );
1619 
1620  //CycleMoverOP mover_min_trial = new CycleMover;
1621  //for ( Size i=1; i < 8; ++i )
1622  // mover_min_trial->add_mover( mover_trial );
1623  //mover_min_trial->add_mover( min_n_repack );
1624 
1625  //RepeatMoverOP multi_cycles = new RepeatMover( mover_min_trial, 50 );
1626 
1627  Real score = ( *dockfa_cst_scorefxn_ )( pose_in );
1628  Real last_accepted_CSP_score = score
1629  + ( fullatom_non_CSP_weight_ * CSP_fraction( pose_in, true ) )
1630  - ( fullatom_CSP_weight_ * CSP_fraction( pose_in ) );
1631  Real lowest_CSP_score = last_accepted_CSP_score;
1632  pose::Pose best_CSP_pose( pose_in );
1633  pose::Pose lowest_CSP_score_pose( pose_in );
1634 
1635  for( Size i = 1; i <= 100 ; i++ ) {
1636  if( i == 1 )
1637  perturb_min_cter->apply( pose_in ); // **REAL** FIRST MIN CTER
1638  else if( i%8 == 0 )
1639  min_n_repack->apply( pose_in ); // **REAL** OCCASIONAL REPACK
1640  else
1641  random_moves->apply( pose_in ); // **REAL** RANDOM MOVE SELECTION
1642  score = ( *dockfa_cst_scorefxn_ )( pose_in );
1643  Real current_CSP_fraction = CSP_fraction( pose_in );
1644  Real current_non_CSP_fraction = CSP_fraction( pose_in, true );
1645  Real current_CSP_score = score
1646  + ( fullatom_non_CSP_weight_ * current_non_CSP_fraction )
1647  - ( fullatom_CSP_weight_ * current_CSP_fraction );
1648  Real boltz_factor = ( last_accepted_CSP_score - current_CSP_score ) /
1649  temperature_;
1650  Real probability = std::exp( std::min (40.0, std::max(-40.0,
1651  boltz_factor)));
1652  Real random = RG.uniform();
1653  if( ( current_CSP_score < last_accepted_CSP_score ) ||
1654  ( random < probability ) ) {
1655  last_accepted_CSP_score = current_CSP_score;
1656  best_CSP_pose = pose_in;
1657  if( current_CSP_score < lowest_CSP_score ) {
1658  lowest_CSP_score = current_CSP_score;
1659  lowest_CSP_score_pose = pose_in;
1660  }
1661  }
1662  pose_in = best_CSP_pose;
1663  }
1664  pose_in = lowest_CSP_score_pose;
1665 
1666  //pack_interface_repack->apply( pose_in );
1667 
1668  //fullatom_optimizer->add_mover( multi_cycles ); // **MAIN**
1669  fullatom_optimizer->add_mover( pack_interface_repack ); // **MAIN**
1670 
1671  fullatom_optimizer->apply( pose_in ); // **MAIN**
1672  rtmin->apply( pose_in );
1673  //mc->recover_low( pose_in );
1674  //pose_in.dump_pdb( "post_fullatom.pdb" );
1675 
1676  Real current_ubi_cov_bond_dist( 100.00 );
1677 
1678  numeric::xyzVector_float d77_lys_CA(
1679  pose_in.residue( d77_48_lys_ ).xyz( CA ) ),
1680  k48r_gly_CA( pose_in.residue( k48r_end_ ).xyz( CA ) );
1681  current_ubi_cov_bond_dist = d77_lys_CA.distance( k48r_gly_CA );
1682 
1683  applied_fullatom_pert_ = true;
1684 
1685  TR << "UBI Done: Fullatom Mode Perturbation" << std::endl;
1686 
1687  return( current_ubi_cov_bond_dist );
1688 
1689  } // fullatom_mode_perturbation
1690 
1691  void
1693  pose::Pose & pose_in ) {
1694  using namespace moves;
1695  using namespace pack::task;
1696  using namespace pack::task::operation;
1697 
1698  TR << "UBI Initial Repack" << std::endl;
1699 
1701  mc = new moves::MonteCarlo( pose_in, *pack_scorefxn_, temperature_ );
1702 
1703  setup_packer_task( pose_in );
1704  // restrict_to_interfacial_loop_packing( pose_in );
1705 
1707  pack_scorefxn_ );
1708  pack_interface_repack->task_factory(tf_);
1709  TrialMoverOP pack_interface_and_loops_trial = new TrialMover(
1710  pack_interface_repack, mc );
1711 
1712  if( !refinement_mode_ )
1713  pack_interface_and_loops_trial->apply( pose_in );
1714  //pose_in.dump_pdb( "post_initial_repack" );
1715  TR << "UBI Done: Initial Repack" << std::endl;
1716 
1717  return;
1718  } // initial_repack
1719 
1720  void
1722  pose::Pose & pose_in ) {
1723  // using namespace basic::options;
1724  using namespace pack::task;
1725  using namespace pack::task::operation;
1726 
1727 
1728  if( init_task_factory_ ) {
1729  tf_ = new TaskFactory( *init_task_factory_ );
1730  TR << "UBI Reinitializing Packer Task" << std::endl;
1731  return;
1732  }
1733  else
1734  tf_ = new TaskFactory;
1735 
1736  TR << "UBI Setting Up Packer Task" << std::endl;
1737 
1738  tf_->push_back( new OperateOnCertainResidues( new PreventRepackingRLT,
1739  new ResidueLacksProperty("PROTEIN") ) );
1740  tf_->push_back( new InitializeFromCommandline );
1741  tf_->push_back( new IncludeCurrent );
1742  tf_->push_back( new RestrictToRepacking );
1743  tf_->push_back( new NoRepackDisulfides );
1744 
1745  // incorporating Ian's UnboundRotamer operation.
1746  // note that nothing happens if unboundrot option is inactive!
1749  unboundrot->initialize_from_command_line();
1750  operation::AppendRotamerSetOP unboundrot_operation =
1751  new operation::AppendRotamerSet( unboundrot );
1752  tf_->push_back( unboundrot_operation );
1753  // adds scoring bonuses for the "unbound" rotamers, if any
1755 
1757 
1758  TR << "UBI Done: Setting Up Packer Task" << std::endl;
1759 
1760  } // setup_packer_task
1761 
1762  void
1764  pose::Pose & pose_in ) {
1765  using namespace pack::task;
1766  using namespace pack::task::operation;
1767 
1768  TR << "UBI Restricting To Interface" << std::endl;
1769 
1770  ( *pack_scorefxn_ )( pose_in );
1771 
1772  // selecting movable c-terminal residues
1773  ObjexxFCL::FArray1D_bool loop_residues( pose_in.total_residue(), false );
1774  for( Size i = 0; i <= flex_cter_; i++ ) {
1775  loop_residues( k48r_end_ - i) = true;
1776  loop_residues( d77_end_ - i) = true;
1777  }
1778 
1779  // setting up triple interfaces
1780  utility::vector1_size rb_jumps;
1781  rb_jumps.push_back( e2_k48r_jump_ );
1782  rb_jumps.push_back( e2_d77_jump_ );
1783  tf_->push_back( new protocols::toolbox::task_operations::RestrictToInterface( rb_jumps, loop_residues) );
1784 
1785  TR << "UBI Done: Restricting To Interface" << std::endl;
1786  return;
1787  } // restrict_to_interfacial_loop_packing
1788 
1789  void
1791  pose::Pose & pose_in ) {
1792 
1793  using namespace kinematics;
1794 
1795  TR << "UBI Setting up E2G2-DiUbiqutin Fold Tree" << std::endl;
1796 
1797  FoldTree f;
1798  f.clear();
1799  Size nres = d77_end_;
1800  Size jumppoint1 = e2_ctr_of_mass_;
1801  Size diubi_center_of_mass = geometry::residue_center_of_mass( pose_in,
1802  e2_end_ + 1, nres );
1803  Size jumppoint2 = diubi_center_of_mass;
1804  Size cutpoint = e2_end_;
1805 
1806  f.add_edge( 1, jumppoint1, Edge::PEPTIDE );
1807  f.add_edge( jumppoint1, cutpoint, Edge::PEPTIDE );
1808  f.add_edge( cutpoint + 1, jumppoint2, Edge::PEPTIDE );
1809  f.add_edge( jumppoint2, nres, Edge::PEPTIDE );
1810  f.add_edge( jumppoint1, jumppoint2, 1 );
1811  f.reorder( 1 );
1812 
1813  pose_in.fold_tree( f );
1814 
1815  TR << "UBI Done: Setting up E2G2-DiUbiqutin Fold Tree" << std::endl;
1816 
1817  return;
1818  } //set_e2g2_diubi_fold_tree
1819 
1820  Real
1822  const pose::Pose & pose_in,
1823  bool dimer ) {
1824  using namespace core::scoring;
1825 
1826  TR << "UBI Calculating Interaction Energy" << std::endl;
1827 
1828  ScoreFunctionOP docking_scorefxn;
1829  pose::Pose complex_pose = pose_in;
1830 
1831  moves::SequenceMoverOP separate( new moves::SequenceMover() );
1832  Real trans_magnitude = 1000;
1833  if( dimer ) {
1834  set_e2g2_diubi_fold_tree( complex_pose );
1835  rigid::RigidBodyTransMoverOP translate_away_diubi (
1836  new rigid::RigidBodyTransMover( complex_pose, 1 ) );
1837  translate_away_diubi->step_size( trans_magnitude );
1838  separate->add_mover( translate_away_diubi );
1839  }
1840  else {
1841  setup_complex_fold_tree( complex_pose );
1842  rigid::RigidBodyTransMoverOP translate_away_k48r (
1843  new rigid::RigidBodyTransMover( complex_pose, e2_k48r_jump_ ) );
1844  translate_away_k48r->step_size( trans_magnitude );
1845  rigid::RigidBodyTransMoverOP translate_away_d77 (
1846  new rigid::RigidBodyTransMover( complex_pose, e2_d77_jump_ ) );
1847  translate_away_d77->step_size( 0.00 - trans_magnitude );
1848  separate->add_mover( translate_away_k48r );
1849  separate->add_mover( translate_away_d77 );
1850  }
1851 
1852  if ( pose_in.is_fullatom() ) {
1854  "docking" );
1855  } else {
1857  "interchain_cen" );
1858  }
1859 
1860  Real bound_energy = ( *docking_scorefxn )( complex_pose );
1861  separate->apply( complex_pose );
1862  Real unbound_energy = ( *docking_scorefxn )( complex_pose );
1863 
1864  if( dimer )
1865  TR << "UBI Done: Calculating Dimer Interaction Energy" << std::endl;
1866  else
1867  TR << "UBI Done: Calculating Trimer Interaction Energy" << std::endl;
1868 
1869  return (bound_energy - unbound_energy);
1870  } // calc_interaction_energy
1871 
1872  core::Real
1874  const core::pose::Pose & pose_in,
1875  bool non_CSP,
1876  bool trim,
1877  bool swap ) {
1878 
1879  if( non_CSP && ( ( fullatom_non_CSP_weight_ == 0.00 ) ||
1880  ( centroid_non_CSP_weight_ == 0.00 ) ) )
1881  return( 0.00 );
1882 
1883  /*
1884  bool fullatom = pose_in.is_fullatom();
1885 
1886  if( fullatom )
1887  TR << "UBI Calculating Fullatom CSP Fraction" << std::endl;
1888  else
1889  TR << "UBI Calculating Centroid CSP Fraction" << std::endl;
1890  */
1891 
1892  utility::vector1<Size> current_CSP;
1893  if( !non_CSP ) {
1894  if( trim ) {
1895  if( swap )
1896  current_CSP = CSP_swap_trim_;
1897  else
1898  current_CSP = CSP_trim_;
1899  }
1900  else
1901  current_CSP = CSP_;
1902  }
1903  else {
1904  if( trim ) {
1905  if( swap )
1906  current_CSP = non_CSP_swap_trim_;
1907  else
1908  current_CSP = non_CSP_trim_;
1909  }
1910  else
1911  current_CSP = non_CSP_;
1912  }
1913 
1914  Size total_CSPs = current_CSP.size();
1915 
1916  Size nres = pose_in.total_residue();
1917  utility::vector1<bool> is_interface( nres, false );
1918 
1919  Size num_jump = 2;
1920  for( Size jj = 1; jj <= num_jump; jj++ ) {
1921  // "interface" is a reserved c++ keyword (on VC++ )
1922  protocols::scoring::Interface _interface( jj );
1923  // distance decided by inspection of PDB 2FUH
1924  _interface.distance( 8.0 );
1925  _interface.calculate( pose_in );
1926 
1927  for ( Size ii=1; ii <= nres; ++ii )
1928  if( _interface.is_interface(ii) )
1929  is_interface[ii] = true;
1930  }
1931 
1932  Size satisfied_CSPs = 0;
1933  for ( Size ii = 1; ii <= total_CSPs; ++ii )
1934  if( is_interface[ current_CSP[ii] ] )
1935  satisfied_CSPs++;
1936 
1937  Real CSP_fraction = ( (Real) satisfied_CSPs ) / ( (Real) total_CSPs);
1938 
1939  /*
1940  if( fullatom )
1941  TR << "UBI Done: Calculating Fullatom CSP Fraction " << CSP_fraction
1942  << std::endl;
1943  else
1944  TR << "UBI Done: Calculating Centroid CSP Fraction " << CSP_fraction
1945  << std::endl;
1946  */
1947 
1948  return( CSP_fraction );
1949 
1950  } // CSP_fraction
1951 
1952  bool
1954  using namespace core::scoring;
1955 
1956  TR << "UBI Checking Centroid Filter" << std::endl;
1957 
1958  bool passed_filter = true;
1959 
1960  if ( score_map_[ "AD_k48_CA_CA" ] >= max_k48_cter_dist_) {
1961  passed_filter = false;
1962  TR << "UBI Failed Centroid Filter K48_CA_CA: "
1963  << score_map_[ "AD_k48_CA_CA" ] << std::endl;
1964  }
1965  else {
1966  TR << "UBI Success Centroid Filter K48_CA_CA: "
1967  << score_map_[ "AD_k48_CA_CA" ] << std::endl;
1968  }
1969 
1971  ( *dock_lowres_cst_scorefxn_ )( pose_in );
1972  Real constraint_score = pose_in.energies().total_energies()[
1974  score_map_[ "AC_constraint" ] = constraint_score;
1975  if( passed_filter && ( constraint_score >= fullatom_constraint_cutoff_)){
1976  passed_filter = false;
1977  TR << "UBI Failed Centroid Filter Constraint Score: "
1978  << constraint_score
1979  << std::endl;
1980  }
1981  else {
1982  if ( constraint_score < fullatom_constraint_cutoff_ )
1983  TR << "UBI Success Centroid Filter Constraint Score: "
1984  << constraint_score
1985  << std::endl;
1986  }
1988  cen_constraint_ );
1989  ( *dock_lowres_cst_scorefxn_ )( pose_in );
1990 
1991  Real CSP_fraction_ratio = CSP_fraction( pose_in );
1992  score_map_[ "AA_CSP_fraction" ] = CSP_fraction_ratio;
1993  Real non_CSP_fraction_ratio = CSP_fraction( pose_in, true );
1994  score_map_[ "AB_non_CSP_fraction" ] = non_CSP_fraction_ratio;
1995 
1996  if( passed_filter && ( CSP_fraction_ratio <
1998  passed_filter = false;
1999  TR << "UBI Failed Centroid Filter CSP Fraction: "
2000  << CSP_fraction_ratio << std::endl;
2001  }
2002  else {
2003  if( CSP_fraction_ratio >= centroid_allowed_CSP_fraction_ )
2004  TR << "UBI Success Centroid Filter CSP Fraction: "
2005  << CSP_fraction_ratio << std::endl;
2006  }
2007 
2008  Real cen_score( 10000.00 );
2009  if( passed_filter ) {
2010  cen_score = ( *output_cen_scorefxn_ )( pose_in );
2011  }
2012  if( passed_filter && ( cen_score > 0.00 ) ) {
2013  passed_filter = false;
2014  TR << "UBI Failed Centroid Score: " << cen_score << std::endl;
2015  }
2016  else {
2017  if( cen_score <= 0.00 )
2018  TR << "UBI Success Centroid Score: " << cen_score << std::endl;
2019  }
2020 
2021  if ( !passed_filter )
2022  TR << "UBI STRUCTURE FAILED LOW-RES FILTER" << std::endl;
2023  else
2024  TR << "UBI Done: Successfully Passed Centroid Filter" << std::endl;
2025 
2026  return( passed_filter );
2027  } // centroid_filter
2028 
2029 
2030  bool
2032  using namespace core::scoring;
2033 
2034  TR << "UBI Checking Fullatom Filter" << std::endl;
2035 
2036  bool passed_filter = true;
2037 
2038  if (passed_filter && (score_map_["AD_k48_CA_CA"] >= max_k48_cter_dist_)) {
2039  passed_filter = false;
2040  TR << "UBI Failed Fullatom Filter K48_CA_CA: "
2041  << score_map_[ "AD_k48_CA_CA" ] << std::endl;
2042  }
2043  else {
2044  TR << "UBI Success Fullatom Filter K48_CA_CA: "
2045  << score_map_[ "AD_k48_CA_CA" ] << std::endl;
2046  }
2047 
2049  ( *dockfa_cst_scorefxn_ )( pose_in );
2050  Real constraint_score = pose_in.energies().total_energies()[
2052  if( refinement_mode_ )
2053  constraint_score = constraint_score / 1000000;
2054  score_map_[ "AC_constraint" ] = constraint_score;
2055  if ( passed_filter && ( constraint_score >= fullatom_constraint_cutoff_
2056  && !refinement_mode_ ) ) {
2057  passed_filter = false;
2058  TR << "UBI Failed Fullatom Filter Constraint Score: "
2059  << constraint_score
2060  << std::endl;
2061  }
2062  else {
2063  if( constraint_score < fullatom_constraint_cutoff_ )
2064  TR << "UBI Success Fullatom Filter Constraint Score: "
2065  << constraint_score
2066  << std::endl;
2067  }
2069  full_constraint_ );
2070  ( *dockfa_cst_scorefxn_ )( pose_in );
2071 
2072  Real CSP_fraction_ratio = CSP_fraction( pose_in );
2073  score_map_[ "AA_CSP_fraction" ] = CSP_fraction_ratio;
2074  Real non_CSP_fraction_ratio = CSP_fraction( pose_in, true );
2075  score_map_[ "AB_non_CSP_fraction" ] = non_CSP_fraction_ratio;
2076  if( passed_filter && ( CSP_fraction_ratio <
2078  passed_filter = false;
2079  TR << "UBI Failed Fullatom Filter CSP Fraction: "
2080  << CSP_fraction_ratio << std::endl;
2081  }
2082  else {
2083  if( CSP_fraction_ratio >= fullatom_allowed_CSP_fraction_ )
2084  TR << "UBI Success Fullatom Filter CSP Fraction: "
2085  << CSP_fraction_ratio << std::endl;
2086  }
2087 
2088  score_map_[ "AH_I_sc_trimer" ] = 10.00;
2089  //if( passed_filter )
2090  score_map_[ "AH_I_sc_trimer" ] = calc_interaction_energy( pose_in,
2091  false ); //dimer
2092 
2093  score_map_[ "AG_I_sc_e2_ubi" ] = calc_interaction_energy( pose_in );
2094 
2095  /*
2096  if ( passed_filter && score_map_[ "A_I_sc" ] >= 0.0) {
2097  passed_filter = false;
2098  TR << "UBI Failed Fullatom Filter I_sc: "
2099  << score_map_[ "A_I_sc" ] << std::endl;
2100  }
2101  else {
2102  if( score_map_[ "A_I_sc" ] < 0.0)
2103  TR << "UBI Success Fullatom Filter I_sc: "
2104  << score_map_ [ "A_I_sc" ] << std::endl;
2105  }
2106  */
2107 
2108  if ( !passed_filter )
2109  TR << "UBI STRUCTURE FAILED HIGH-RES FILTER" << std::endl;
2110  else
2111  TR << "UBI Done: Successfully Passed Fullatom Filter" << std::endl;
2112 
2113  return passed_filter;
2114  } // fullatom_filter
2115 
2116  core::Real
2118  const pose::Pose & pose_in,
2119  const pose::Pose & native_pose,
2120  Size ubiquitin ) {
2121 
2122  using namespace core::scoring;
2123 
2124  FArray1D_bool superpos_partner ( pose_in.total_residue(), false );
2125 
2126  Size compute_rmsd_start(0), compute_rmsd_end(0);
2127 
2128  if( ubiquitin == e2_k48r_jump_ ) {
2129  compute_rmsd_start = e2_end_ + 1;
2130  compute_rmsd_end = k48r_end_;
2131  }
2132  else if( ubiquitin == e2_d77_jump_ ) {
2133  compute_rmsd_start = k48r_end_ + 1;
2134  compute_rmsd_end = d77_end_;
2135  }
2136  else {
2137  compute_rmsd_start = k48r_end_ - flex_cter_;
2138  compute_rmsd_end = k48r_end_;
2139  }
2140 
2141  for ( Size i = compute_rmsd_start; i <= compute_rmsd_end; ++i )
2142  superpos_partner(i) = true;
2143 
2144  Real Lrmsd = rmsd_no_super_subset( native_pose, pose_in,
2145  superpos_partner, is_protein_CA );
2146  return ( Lrmsd );
2147  } // calc_Lrmsd
2148 
2149 
2150  void
2152  using namespace basic::options;
2153  using namespace basic::options::OptionKeys;
2154  using namespace core::scoring;
2155  using namespace core::scoring::constraints;
2156  using namespace chemical;
2157  using namespace id;
2158  //using namespace jobdist;
2159  //using pose::datacache::CacheableDataType::INTERFACE_INFO;
2161  using namespace moves;
2162  using namespace pack::task;
2163  using namespace pack::task::operation;
2164  using namespace kinematics;
2165 
2166  // score functions
2167  core::scoring::ScoreFunctionOP dock_lowres_score;
2168  core::scoring::ScoreFunctionOP lowres_score;
2169  core::scoring::ScoreFunctionOP pack_score;
2170  core::scoring::ScoreFunctionOP dockfa_score;
2171 
2172  dock_lowres_score = core::scoring::ScoreFunctionFactory::
2173  create_score_function("interchain_cen");
2175  create_score_function( "cen_std" );
2177  create_score_function( "docking" );
2179  create_score_function("standard");
2180 
2181  setup_key_residues( pose_in );
2182  setup_complex_fold_tree( pose_in );
2183 
2185  tri_interface->add_jump( e2_d77_jump_ );
2186  pose_in.data().set( core::pose::datacache::CacheableDataType::INTERFACE_INFO, tri_interface );
2187 
2188  pose::Pose start_pose;
2189  start_pose = pose_in;
2190 
2193  protocols::simple_moves::ReturnSidechainMover recover_sidechains( start_pose);
2194 
2195  Real score( 0.00 );
2196  to_centroid.apply( pose_in );
2197 
2198  score = ( *lowres_score )( pose_in );
2199  TR << "Native Cen Score : " << score << std::endl;
2200 
2201  score = ( *dock_lowres_score )( pose_in );
2202  TR << "Native DockLow Score : " << score << std::endl;
2203 
2204  to_all_atom.apply( pose_in );
2205  recover_sidechains.apply( pose_in );
2206 
2207  score = ( *dockfa_score )( pose_in );
2208  TR << "Native DockFA Score : " << score << std::endl;
2209 
2210  score = ( *pack_score )( pose_in );
2211  TR << "Native Pack Score : " << score << std::endl;
2212 
2213  setup_packer_task( pose_in );
2215  repack->task_factory( tf_ );
2216  repack->apply( pose_in );
2217 
2218  score = ( *dockfa_score )( pose_in );
2219  TR << "Packed DockFA Score : " << score << std::endl;
2220 
2221  score = ( *pack_score )( pose_in );
2222  TR << "Packed Pack Score : " << score << std::endl;
2223 
2224  set_e2g2_diubi_fold_tree( start_pose );
2225 
2226  Real trans_magnitude = 1000;
2227  rigid::RigidBodyTransMoverOP translate_away_diubi (
2228  new rigid::RigidBodyTransMover( start_pose, 1 ) );
2229  translate_away_diubi->step_size( trans_magnitude );
2230 
2231  Real bound_energy = ( *dockfa_score )( start_pose );
2232  translate_away_diubi->apply( start_pose );
2233  Real unbound_energy = ( *dockfa_score )( start_pose );
2234 
2235  TR << "Interaction Score : " << bound_energy - unbound_energy
2236  << std::endl;
2237 
2238  return;
2239  } // evaluate_native
2240 
2241  void
2243  pose::Pose & pose_in ) {
2244  using namespace kinematics;
2245  //using pose::datacache::CacheableDataType::INTERFACE_INFO;
2246  using namespace core::scoring;
2247  using namespace protocols::docking;
2248  using namespace protocols::moves;
2249 
2250  TR << "UBI Optimizing Covalent Bond" << std::endl;
2251 
2252  Real const local_full_constraint( 100000.00 );
2254  local_full_constraint );
2256  local_full_constraint );
2258  local_full_constraint );
2259 
2260 
2261  setup_complex_fold_tree( pose_in );
2262 
2264  tri_interface->add_jump( e2_d77_jump_ );
2265  pose_in.data().set( core::pose::datacache::CacheableDataType::INTERFACE_INFO, tri_interface );
2266 
2267  setup_packer_task( pose_in );
2268 
2270  packer->task_factory(tf_);
2271 
2272  //set up minimizer
2275 
2278 
2279  flex_cter_min_mover->apply( pose_in ); // **REAL** MINIMIZE C TER
2280 
2281  // cter movers
2282  SequenceMoverOP perturb_min_cter( new SequenceMover() );
2283 
2285  temperature_, 5 );
2286  small_mover->angle_max( 5.0 );
2288  temperature_, 5 );
2289  shear_mover->angle_max( 5.0 );
2290 
2291  perturb_min_cter->add_mover( small_mover );
2292  perturb_min_cter->add_mover( shear_mover );
2293  perturb_min_cter->add_mover( pack_rottrial );
2294  perturb_min_cter->add_mover( flex_cter_min_mover );
2295 
2296  Real score = ( *dockfa_cst_scorefxn_ )( pose_in );
2297  Real last_accepted_CSP_score = score
2298  + ( fullatom_non_CSP_weight_ * CSP_fraction( pose_in, true ) )
2299  - ( fullatom_CSP_weight_ * CSP_fraction( pose_in ) );
2300  Real lowest_CSP_score = last_accepted_CSP_score;
2301  pose::Pose best_CSP_pose( pose_in );
2302  pose::Pose lowest_CSP_score_pose( pose_in );
2303 
2304  for( Size i = 1; i <= 100 ; i++ ) {
2305  if( i%8 == 0 )
2306  packer->apply( pose_in );
2307  else
2308  perturb_min_cter->apply( pose_in ); // **REAL** C-TER MIN
2309  score = ( *dockfa_cst_scorefxn_ )( pose_in );
2310  Real current_CSP_fraction = CSP_fraction( pose_in );
2311  Real current_non_CSP_fraction = CSP_fraction( pose_in, true );
2312  Real current_CSP_score = score +
2313  ( fullatom_non_CSP_weight_ * current_non_CSP_fraction ) -
2314  ( fullatom_CSP_weight_ * current_CSP_fraction );
2315  Real boltz_factor = ( last_accepted_CSP_score - current_CSP_score ) /
2316  temperature_;
2317  Real probability = std::exp( std::min (40.0, std::max(-40.0,
2318  boltz_factor)));
2319  Real random = RG.uniform();
2320  if( ( current_CSP_score < last_accepted_CSP_score ) ||
2321  ( random < probability ) ) {
2322  last_accepted_CSP_score = current_CSP_score;
2323  best_CSP_pose = pose_in;
2324  if( current_CSP_score < lowest_CSP_score ) {
2325  lowest_CSP_score = current_CSP_score;
2326  lowest_CSP_score_pose = pose_in;
2327  }
2328  }
2329  pose_in = best_CSP_pose;
2330  }
2331  pose_in = lowest_CSP_score_pose;
2332 
2333  packer->apply( pose_in ); // **MAIN**
2334 
2335  Real ubi_cov_bond_dist( 100.00 );
2336 
2337  numeric::xyzVector_float d77_lys_CA(
2338  pose_in.residue( d77_48_lys_ ).xyz( CA ) ),
2339  k48r_gly_CA( pose_in.residue( k48r_end_ ).xyz( CA ) );
2340 
2341  ubi_cov_bond_dist = d77_lys_CA.distance( k48r_gly_CA );
2342 
2343  score_map_[ "AD_k48_CA_CA" ] = ubi_cov_bond_dist;
2344 
2345  Size const NZ_atom (9);
2346  Size const O_atom (4);
2347 
2348  numeric::xyzVector_float d77_lys_NZ(
2349  pose_in.residue( d77_48_lys_ ).xyz( NZ_atom ) ),
2350  k48r_gly_O( pose_in.residue( k48r_end_ ).xyz( O_atom ) );
2351  ubi_cov_bond_dist = d77_lys_NZ.distance( k48r_gly_O );
2352 
2353  score_map_[ "AE_k48_O_NZ" ] = ubi_cov_bond_dist;
2354 
2355  applied_fullatom_pert_ = true;
2356 
2357  // Restoring full atom constraint weights
2359  full_constraint_ );
2361  full_constraint_ );
2363  full_constraint_ );
2364 
2365  TR << "UBI Done: Optimizing Covalent Bond" << std::endl;
2366 
2367  return;
2368 
2369  } // optimize_cov_bond
2370 
2372  const pose::Pose & pose_in ) {
2373 
2374  TR << "UBI Mono Ubi Assigning CSPs" << std::endl;
2375 
2376  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 23 ) );
2377  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 24 ) );
2378  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 25 ) );
2379  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 26 ) );
2380  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 29 ) );
2381  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 32 ) );
2382  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 33 ) );
2383  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 34 ) );
2384  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 36 ) );
2385  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 40 ) );
2386  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 41 ) );
2387  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 43 ) );
2388  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 52 ) );
2389  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 53 ) );
2390  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 54 ) );
2391  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 57 ) );
2392  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 74 ) );
2393  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 17 ) );
2394  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 18 ) );
2395  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 27 ) );
2396  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 38 ) );
2397  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 39 ) );
2398  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 42 ) );
2399  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 46 ) );
2400  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 50 ) );
2401  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 58 ) );
2402  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 90 ) );
2403  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 160 ) );
2404  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 162 ) );
2405  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 163 ) );
2406  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'A', 164 ) );
2407 
2408  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 7 ) );
2409  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 13 ) );
2410  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 14 ) );
2411  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 32 ) );
2412  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 42 ) );
2413  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 45 ) );
2414  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 47 ) );
2415  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 48 ) );
2416  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 49 ) );
2417  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 68 ) );
2418  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 69 ) );
2419  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 70 ) );
2420  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 71 ) );
2421  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 75 ) );
2422  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 6 ) );
2423  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 8 ) );
2424  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 11 ) );
2425  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 15 ) );
2426  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 29 ) );
2427  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 34 ) );
2428  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 43 ) );
2429  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 51 ) );
2430  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 65 ) );
2431  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 66 ) );
2432  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 67 ) );
2433  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 72 ) );
2434  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 73 ) );
2435  CSP_.push_back( pose_in.pdb_info()->pdb2pose( 'B', 74 ) );
2436 
2437 
2438  TR << "UBI Done: Mono Ubi Assigning CSPs" << std::endl;
2439 
2440  return;
2441  } // monoub_assign_CSPs
2442 
2444  using namespace basic::options;
2445  using namespace basic::options::OptionKeys;
2446  using namespace core::scoring;
2447  using namespace core::scoring::constraints;
2448  using namespace chemical;
2449  using namespace id;
2450  //using namespace jobdist;
2451  //using pose::datacache::CacheableDataType::SCORE_MAP;
2453 
2454  TR << "UBI Mono Ubi Apply Start" << std::endl;
2455 
2458  mtsl_constraint->apply( pose_in );
2459 
2460  const pose::Pose start_pose( pose_in );
2461 
2462  // setup key residues
2463  monoub_setup_key_residues( start_pose );
2464 
2465  // assign Chemical Shift Perturbations
2466  monoub_assign_CSPs( start_pose );
2467 
2468  // setup Move Maps
2470 
2471  // Residue movers
2474  protocols::simple_moves::ReturnSidechainMover recover_sidechains( start_pose);
2475 
2476  // centroid mode
2477  Size tries = 0;
2478 
2479  //start loop of decoy creation until filters are all passed
2480  for (Size r = 1; r <= max_repeats_; r++){
2481  tries = r;
2482  pose_in = start_pose;
2483 
2484  // convert to centroid mode
2485  to_centroid.apply( pose_in );
2488 
2489  // check low-res docking filter
2490  ( *dock_lowres_cst_scorefxn_ )( pose_in );
2492 
2493  applied_fullatom_pert_ = false;
2494 
2495  // fullatom mode
2496  if( passed_centroid_filter_ || r == max_repeats_ ) {
2497  // convert to full atom
2498  to_all_atom.apply( pose_in );
2499  recover_sidechains.apply( pose_in );
2500 
2502 
2503  // add scores to map for output
2505 
2506  // check highres docking filter
2507  ( *dockfa_cst_scorefxn_ )( pose_in );
2509  } // if fullatom mode
2510 
2511  if ( passed_centroid_filter_ && passed_fullatom_filter_ ) break;
2512  else TR <<"UBI Mono Ubi Repeating structure " << r << " times"
2513  << std::endl;
2514  } // for max_repeats_
2515 
2516  // add scores to map for output
2517  if( applied_fullatom_pert_ ) {
2518  ( *output_full_scorefxn_ )( pose_in );
2520  }
2521  else {
2522  ( *output_cen_scorefxn_ )( pose_in );
2524  }
2525 
2526  score_map_["AJ_monoub_rms"] = monoub_calc_Lrmsd( pose_in, start_pose );
2527 
2528  pose_in.data().set( core::pose::datacache::CacheableDataType::SCORE_MAP, new basic::datacache::
2529  DiagnosticData(score_map_));
2530 
2531  TR << "UBI Mono Ubi Outputing structure after " << tries << " times"
2532  << std::endl;
2533 
2534  }// end monoub_apply
2535 
2536  void
2538  const pose::Pose & pose_in ) {
2539 
2540  TR << "UBI Mono Ubi Setting Up Key Residues" << std::endl;
2541 
2542  pose::PDBInfoCOP pdb_info = pose_in.pdb_info();
2543  monoub_end_ = pose_in.total_residue();
2544 
2545  char chain = '_';
2546  char old_chain = '_';
2547  for( Size i = 1; i <= monoub_end_; i++ ) {
2548  chain = pdb_info->chain( i );
2549 
2550  // if initial condition
2551  if( i == 1 )
2552  old_chain = pdb_info->chain( i );
2553 
2554  if( chain != old_chain ) {
2555  e2_end_ = i - 1;
2556  break;
2557  }
2558  old_chain = chain;
2559  }// for i <= monoub_end_
2560 
2562  e2_end_ );
2564  e2_end_ + 1,
2565  monoub_end_ );
2566 
2567  TR << "UBI Done: Mono Ubi Setting Up Key Residues" << std::endl;
2568 
2569  } // monoub_setup_key_residues
2570 
2571  void
2573  using namespace core;
2574  using namespace kinematics;
2575 
2576  if( init_all_dof_map_ ) {
2580 
2581  TR << "UBI Mono Ubi Reinitializing Move Maps" << std::endl;
2582  return;
2583  }
2584 
2585  TR << "UBI Mono Ubi Setting Up Move Maps" << std::endl;
2586 
2587  bool bb = false;
2588  bool chi = true;
2589 
2590  monoub_docking_map_ = new MoveMap();
2591  monoub_docking_map_->clear();
2592  monoub_docking_map_->set_chi( chi );
2593  monoub_docking_map_->set_bb( bb );
2594  monoub_docking_map_->set_jump( 1, true );
2595 
2596  monoub_flex_cter_map_ = new MoveMap();
2597  monoub_flex_cter_map_->clear();
2598  monoub_flex_cter_map_->set_chi( chi );
2599  monoub_flex_cter_map_->set_bb( bb );
2600  monoub_flex_cter_map_->set_jump( 1, false );
2601  for( Size i = 0; i <= flex_cter_; i++ ) {
2602  monoub_flex_cter_map_->set_bb( monoub_end_ - i, true );
2603  }
2604 
2605  monoub_all_dof_map_ = new MoveMap();
2606  monoub_all_dof_map_->clear();
2607  monoub_all_dof_map_->set_chi( chi );
2608  monoub_all_dof_map_->set_bb( bb );
2609  monoub_all_dof_map_->set_jump( 1, true );
2610  for( Size i = 0; i <= flex_cter_; i++ ) {
2611  monoub_all_dof_map_->set_bb( monoub_end_ - i, true );
2612  }
2613 
2617 
2618  TR << "UBI Done: Mono Ubi Setting Up Move Maps" << std::endl;
2619 
2620  return;
2621  } // monoub_setup_move_maps
2622 
2623  void
2625  pose::Pose & pose_in ) {
2626 
2627  using namespace kinematics;
2628 
2629  TR << "UBI Setting up mono ubi fold tree" << std::endl;
2630 
2631  FoldTree f;
2632  f.clear();
2633  Size nres = monoub_end_;
2634  Size jumppoint1 = e2_ctr_of_mass_;
2635  Size jumppoint2 = monoub_ctr_of_mass_;
2636  Size cutpoint1 = e2_end_;
2637 
2638  f.add_edge( 1, jumppoint1, Edge::PEPTIDE );
2639  f.add_edge( jumppoint1, cutpoint1, Edge::PEPTIDE );
2640  f.add_edge( cutpoint1 + 1, jumppoint2, Edge::PEPTIDE );
2641  f.add_edge( jumppoint2, nres, Edge::PEPTIDE );
2642  f.add_edge( jumppoint1, jumppoint2, 1 );
2643  f.reorder( 1 );
2644 
2645  pose_in.fold_tree( f );
2646 
2647  TR << "UBI Done: Setting up mono ubi fold tree" << std::endl;
2648 
2649  } // monoub_fold_tree
2650 
2651  void
2653  pose::Pose & pose_in ) {
2654  using namespace protocols::moves;
2655 
2656  TR << "UBI Mono Ubi Initial C-Terminal Perturbation" << std::endl;
2657 
2658  // idealize c-terminals
2659  for( Size i = 0; i <= flex_cter_; i++ ) {
2661  pose_in.conformation());
2662  }
2663 
2664  // pose_in.dump_pdb( "idealized.pdb" );
2665 
2666  // extend c-terminals
2667  Real const init_phi ( -150.0 );
2668  Real const init_psi ( 150.0 );
2669  Real const init_omega( 180.0 );
2670 
2671  for( Size i = 0; i <= flex_cter_; i++ ) {
2672  if ( i != flex_cter_ ) {
2673  pose_in.set_phi( monoub_end_ - i, init_phi );
2674  }
2675  if ( i != 0 ) {
2676  pose_in.set_psi( monoub_end_ - i, init_psi );
2677  }
2678  if ( ( i != flex_cter_ ) && ( i != 0 ) ) {
2679  pose_in.set_omega( monoub_end_ - i, init_omega );
2680  }
2681  }
2682 
2683  // pose_in.dump_pdb( "extended.pdb" );
2684 
2685 
2686  kinematics::MoveMapOP ub_cter_map( new kinematics::MoveMap() );
2687  ub_cter_map->clear();
2688  ub_cter_map->set_chi( true );
2689  ub_cter_map->set_bb( false );
2690  for( Size i = 0; i <= flex_cter_; i++ ) {
2691  ub_cter_map->set_bb( monoub_end_ - i, true );
2692  }
2693 
2694  SequenceMoverOP perturb_min_cter( new SequenceMover() );
2695 
2697  temperature_, 8 );
2698  small_mover->angle_max( 90.0 );
2700  temperature_, 8 );
2701 
2702  shear_mover->angle_max( 90.0 );
2703 
2705  "linmin", min_tolerance_, nb_list_, false, false ) );
2706 
2707  perturb_min_cter->add_mover( small_mover );
2708  perturb_min_cter->add_mover( shear_mover );
2709  perturb_min_cter->add_mover( min_mover );
2710 
2711  MonteCarloOP mc;
2713  TrialMoverOP cter_pert_trial = new TrialMover( perturb_min_cter, mc );
2714  RepeatMoverOP cter_cycle;
2715  cter_cycle = new RepeatMover( cter_pert_trial, 40 ); // cycles
2716  cter_cycle->apply( pose_in );
2717  mc->recover_low( pose_in );
2718 
2719  TR << "UBI Done: Mono Ubi Initial C-Terminal Perturbation" << std::endl;
2720 
2721  } // monoub_initial_cter_perturbation
2722 
2723  void
2725  pose::Pose & pose_in ) {
2726  //using pose::datacache::CacheableDataType::INTERFACE_INFO;
2727  using namespace core::scoring;
2728  using namespace protocols::docking;
2729  using namespace protocols::moves;
2730 
2731  TR << "UBI Mono Ubi First Perturbation" << std::endl;
2732 
2734  to_centroid.apply( pose_in );
2735 
2736  // make starting perturbations based on command-line flags
2737  DockingInitialPerturbationOP init_e2_mono_ub_dock( new
2738  DockingInitialPerturbation( 1 ,true/*slide into contact*/));
2739  // pose_in.dump_pdb( "pre.pdb" );
2740  init_e2_mono_ub_dock->apply( pose_in );
2741 
2742  // dock movers
2743  rigid::RigidBodyPerturbNoCenterMoverOP dock_e2_mono_ub( new
2744  rigid::RigidBodyPerturbNoCenterMover( 1 , 10.0, // rot_magnitude
2745  1.0 ) ); // trans_magnitude_
2746 
2748  pose_in.data().set( core::pose::datacache::CacheableDataType::INTERFACE_INFO, one_interface );
2749  Real score = ( *dock_lowres_scorefxn_ )( pose_in );
2750  Real current_CSP_fraction = monoub_CSP_fraction( pose_in );
2751  Real last_accepted_CSP_score = score
2752  - ( centroid_CSP_weight_ * current_CSP_fraction );
2753  Real lowest_CSP_score = last_accepted_CSP_score;
2754  pose::Pose best_CSP_pose( pose_in );
2755  pose::Pose lowest_CSP_score_pose( pose_in );
2756 
2757  for( Size i = 1; i <= 50 ; i++ ) {
2758  dock_e2_mono_ub->apply( pose_in );
2759  ( *dock_lowres_scorefxn_ )( pose_in );
2760  score = ( *dock_lowres_scorefxn_ )( pose_in );
2761  current_CSP_fraction = monoub_CSP_fraction( pose_in );
2762  Real current_CSP_score = score
2763  - ( centroid_CSP_weight_ * current_CSP_fraction );
2764  Real boltz_factor = ( last_accepted_CSP_score - current_CSP_score ) /
2765  temperature_;
2766  Real probability = std::exp( std::min (40.0, std::max(-40.0,
2767  boltz_factor)));
2768  Real random = RG.uniform();
2769  if( (current_CSP_score < last_accepted_CSP_score) ||
2770  ( random < probability ) ) {
2771  last_accepted_CSP_score = current_CSP_score;
2772  best_CSP_pose = pose_in;
2773  if( current_CSP_score < lowest_CSP_score ) {
2774  lowest_CSP_score = current_CSP_score;
2775  lowest_CSP_score_pose = pose_in;
2776  }
2777  }
2778  pose_in = best_CSP_pose;
2779  }
2780  pose_in = lowest_CSP_score_pose;
2781 
2782  TR << "UBI Done: Mono Ubi First Perturbation" << std::endl;
2783  return;
2784  } // monoub_first_perturbation
2785 
2786  void
2788  pose::Pose & pose_in ) {
2789  //using pose::datacache::CacheableDataType::INTERFACE_INFO;
2790  using namespace core::scoring;
2791  using namespace protocols::docking;
2792  using namespace protocols::moves;
2793 
2794  TR << "UBI Mono Ubi Initial Perturbation" << std::endl;
2795 
2797  pose_in.data().set( core::pose::datacache::CacheableDataType::INTERFACE_INFO, one_interface );
2798 
2799  monoub_first_perturbation( pose_in );
2801 
2802  TR << "UBI Done: Mono Ubi Initial Perturbation" << std::endl;
2803 
2804  return;
2805  } // monoub_initial_perturbation
2806 
2807  void
2809  pose::Pose & pose_in ) {
2810 
2811  //using pose::datacache::CacheableDataType::INTERFACE_INFO;
2812  using namespace core::scoring;
2813  using namespace protocols::docking;
2814  using namespace protocols::moves;
2815 
2816  TR << "UBI Centroid Mode Perturbation" << std::endl;
2817 
2818  monoub_fold_tree( pose_in );
2819 
2820  protocols::scoring::InterfaceInfoOP interface = new protocols::scoring::InterfaceInfo( 1 );
2821  pose_in.data().set( core::pose::datacache::CacheableDataType::INTERFACE_INFO, interface );
2822 
2823  monoub_initial_perturbation( pose_in );
2824 
2825  //pose_in.dump_pdb( "final_init.pdb" );
2826 
2827  // movers
2828  // dock movers
2829  rigid::RigidBodyPerturbNoCenterMoverOP dock_e2_monoub( new
2830  rigid::RigidBodyPerturbNoCenterMover( 1, 5.0, // rot_magnitude
2831  0.7 ) ); // trans_magnitude_
2832 
2833  RandomMoverOP docker( new RandomMover() );
2834 
2835  RepeatMoverOP cter_cycle;
2836 
2837  {
2838  //////////Small/ShearMovers//////////////////////////////////////
2839  SequenceMoverOP perturb_min_cter( new SequenceMover() );
2840 
2842  temperature_, 5 /*n_moves*/ );
2843  small_mover->angle_max( 90.0 );
2844 
2846  temperature_, 5 /*n_moves*/ );
2847  shear_mover->angle_max( 90.0 );
2848 
2851  false /*deriv_check*/,false /* non verbose-deriv-check,default*/));
2852 
2853  perturb_min_cter->add_mover( small_mover );
2854  perturb_min_cter->add_mover( shear_mover );
2855  perturb_min_cter->add_mover( min_mover );
2856 
2857  MonteCarloOP c_ter_mc;
2858  c_ter_mc = new moves::MonteCarlo( pose_in, *lowres_cst_scorefxn_,
2859  temperature_ );
2860  TrialMoverOP cter_pert_trial = new TrialMover( perturb_min_cter,
2861  c_ter_mc );
2862  cter_cycle = new RepeatMover( cter_pert_trial, 10 ); // cycles
2863  }
2864 
2865  docker->add_mover( dock_e2_monoub, 0.75 );
2866  docker->add_mover( cter_cycle, 0.25 );
2867 
2868  Real score = ( *dock_lowres_cst_scorefxn_ )( pose_in );
2869  Real last_accepted_CSP_score = score
2870  - ( centroid_CSP_weight_ * monoub_CSP_fraction( pose_in ) );
2871  Real lowest_CSP_score = last_accepted_CSP_score;
2872  pose::Pose best_CSP_pose( pose_in );
2873  pose::Pose lowest_CSP_score_pose( pose_in );
2874 
2875  for( Size i = 1; i <= 50 ; i++ ) {
2876  docker->apply( pose_in );
2877  score = ( *dock_lowres_cst_scorefxn_ )( pose_in );
2878  Real current_CSP_fraction = monoub_CSP_fraction( pose_in );
2879  Real current_CSP_score = score
2880  - ( centroid_CSP_weight_ * current_CSP_fraction );
2881  Real boltz_factor = ( last_accepted_CSP_score - current_CSP_score ) /
2882  temperature_;
2883  Real probability = std::exp( std::min (40.0, std::max(-40.0,
2884  boltz_factor)));
2885  Real random = RG.uniform();
2886  if( (current_CSP_score < last_accepted_CSP_score) ||
2887  ( random < probability ) ){
2888  last_accepted_CSP_score = current_CSP_score;
2889  best_CSP_pose = pose_in;
2890  if( current_CSP_score < lowest_CSP_score ) {
2891  lowest_CSP_score = current_CSP_score;
2892  lowest_CSP_score_pose = pose_in;
2893  }
2894  }
2895  pose_in = best_CSP_pose;
2896  }
2897  pose_in = lowest_CSP_score_pose;
2898 
2899  TR << "UBI Done: Mono UbiCentroid Mode Perturbation" << std::endl;
2900 
2901  return;
2902  } // monoub_centroid_mode_perturbation
2903 
2904  void
2906  pose::Pose & pose_in ) {
2907  using namespace moves;
2908  using namespace pack::task;
2909  using namespace pack::task::operation;
2910 
2911  TR << "UBI Mono Ubi Fullatom Mode Perturbation" << std::endl;
2912 
2913  initial_repack( pose_in ); // **REAL** REPACKING
2914 
2915  SequenceMoverOP fullatom_optimizer( new SequenceMover() ); // **MAIN**
2916 
2918  pack_scorefxn_ );
2919  pack_interface_repack->task_factory(tf_);
2920 
2921  //set up minimizer movers
2928 
2930  pack_scorefxn_, tf_ );
2931 
2932  // set up rigid body movers
2933  Real trans_magnitude = 0.1; // default high-res docking values
2934  Real rot_magnitude = 5.0; // default high-res docking values
2936  1, rot_magnitude, trans_magnitude , rigid::partner_downstream,
2937  true );
2939  pack_scorefxn_, tf_ );
2940 
2941  MonteCarloOP mc;
2943 
2944  // cter movers
2945 
2946  RepeatMoverOP cter_mover_rot;
2947  //////////Small/ShearMovers//////////////////////////////////////
2948  SequenceMoverOP perturb_min_cter( new SequenceMover() );
2949 
2951  temperature_, 5 );
2952  small_mover->angle_max( 5.0 );
2954  temperature_, 5 );
2955  shear_mover->angle_max( 5.0 );
2956 
2957  perturb_min_cter->add_mover( small_mover );
2958  perturb_min_cter->add_mover( shear_mover );
2959  perturb_min_cter->add_mover( pack_rottrial );
2960  perturb_min_cter->add_mover( flex_cter_min_mover );
2961 
2962  TrialMoverOP cter_pert_trial = new TrialMover( perturb_min_cter, mc );
2963  cter_mover_rot = new RepeatMover( cter_pert_trial, 10 ); // cycles
2964 
2965  SequenceMoverOP cter_mover_repack( new SequenceMover() );
2966  cter_mover_repack->add_mover( cter_mover_rot );
2967  cter_mover_repack->add_mover( pack_interface_repack );
2968 
2969  ////////////////////////////////////////////////////////////////////
2970 
2971  cter_mover_repack->apply( pose_in ); // **REAL** FIRST C-TER RELAX
2972 
2973  SequenceMoverOP monoub_perturb_rot( new SequenceMover() );
2974  monoub_perturb_rot->add_mover( monoub_perturb );
2975  monoub_perturb_rot->add_mover( pack_rottrial );
2976 
2977  RandomMoverOP random_moves( new RandomMover() );
2978  random_moves->add_mover( monoub_perturb_rot, 0.75 );
2979  random_moves->add_mover( perturb_min_cter, 0.25 );
2980 
2981  SequenceMoverOP min_n_repack( new SequenceMover() );
2982  min_n_repack->add_mover( pack_interface_repack );
2983 
2984  Real score = ( *dockfa_cst_scorefxn_ )( pose_in );
2985  Real last_accepted_CSP_score = score
2986  - ( fullatom_CSP_weight_ * monoub_CSP_fraction( pose_in ) );
2987  Real lowest_CSP_score = last_accepted_CSP_score;
2988  pose::Pose best_CSP_pose( pose_in );
2989  pose::Pose lowest_CSP_score_pose( pose_in );
2990 
2991  for( Size i = 1; i <= 100 ; i++ ) {
2992  if( i == 1 )
2993  perturb_min_cter->apply( pose_in ); // **REAL** FIRST MIN CTER
2994  else if( i%8 == 0 )
2995  min_n_repack->apply( pose_in ); // **REAL** OCCASIONAL REPACK
2996  else
2997  random_moves->apply( pose_in ); // **REAL** RANDOM MOVE SELECTION
2998  score = ( *dockfa_cst_scorefxn_ )( pose_in );
2999  Real current_CSP_fraction = monoub_CSP_fraction( pose_in );
3000  Real current_CSP_score = score
3001  - ( fullatom_CSP_weight_ * current_CSP_fraction );
3002  Real boltz_factor = ( last_accepted_CSP_score - current_CSP_score ) /
3003  temperature_;
3004  Real probability = std::exp( std::min (40.0, std::max(-40.0,
3005  boltz_factor)));
3006  Real random = RG.uniform();
3007  if( ( current_CSP_score < last_accepted_CSP_score ) ||
3008  ( random < probability ) ) {
3009  last_accepted_CSP_score = current_CSP_score;
3010  best_CSP_pose = pose_in;
3011  if( current_CSP_score < lowest_CSP_score ) {
3012  lowest_CSP_score = current_CSP_score;
3013  lowest_CSP_score_pose = pose_in;
3014  }
3015  }
3016  pose_in = best_CSP_pose;
3017  }
3018  pose_in = lowest_CSP_score_pose;
3019 
3020  fullatom_optimizer->add_mover( pack_interface_repack ); // **MAIN**
3021  fullatom_optimizer->apply( pose_in ); // **MAIN**
3022  rtmin->apply( pose_in );
3023 
3024  applied_fullatom_pert_ = true;
3025 
3026  TR << "UBI Done: Mono Ubi Fullatom Mode Perturbation" << std::endl;
3027 
3028  return;
3029  } // monoub_fullatom_mode_perturbation
3030 
3031  Real
3033  const pose::Pose & pose_in ) {
3034  using namespace core::scoring;
3035 
3036  TR << "UBI Mono Ubi Calculating Interaction Energy" << std::endl;
3037 
3038  ScoreFunctionOP docking_scorefxn;
3039  pose::Pose complex_pose = pose_in;
3040 
3041  moves::SequenceMoverOP separate( new moves::SequenceMover() );
3042  Real trans_magnitude = 1000;
3043 
3044  monoub_fold_tree( complex_pose );
3045  rigid::RigidBodyTransMoverOP translate_away_ubi (
3046  new rigid::RigidBodyTransMover( complex_pose, 1 ) );
3047  translate_away_ubi->step_size( trans_magnitude );
3048  separate->add_mover( translate_away_ubi );
3049 
3050  if ( pose_in.is_fullatom() ) {
3052  "docking" );
3053  } else {
3055  "interchain_cen" );
3056  }
3057 
3058  Real bound_energy = ( *docking_scorefxn )( complex_pose );
3059  separate->apply( complex_pose );
3060  Real unbound_energy = ( *docking_scorefxn )( complex_pose );
3061 
3062  TR << "UBI Done: Calculating Mono Ubi Interaction Energy" << std::endl;
3063 
3064  return (bound_energy - unbound_energy);
3065  } // monoub_calc_interaction_energy
3066 
3067  core::Real
3069  const core::pose::Pose & pose_in ) {
3070 
3071  /*
3072  if( non_CSP && ( ( fullatom_non_CSP_weight_ == 0.00 ) ||
3073  ( centroid_non_CSP_weight_ == 0.00 ) ) )
3074  return( 0.00 );
3075  */
3076 
3077  utility::vector1<Size> current_CSP;
3078  current_CSP = CSP_;
3079  Size total_CSPs = current_CSP.size();
3080 
3081  Size nres = pose_in.total_residue();
3082  utility::vector1<bool> is_interface( nres, false );
3083 
3084  protocols::scoring::Interface _interface( 1 );
3085  // distance decided by inspection of PDB 2FUH
3086  _interface.distance( 8.0 );
3087  _interface.calculate( pose_in );
3088 
3089  for ( Size ii=1; ii <= nres; ++ii )
3090  if( _interface.is_interface(ii) )
3091  is_interface[ii] = true;
3092 
3093  Size satisfied_CSPs = 0;
3094  for ( Size ii = 1; ii <= total_CSPs; ++ii )
3095  if( is_interface[ current_CSP[ii] ] )
3096  satisfied_CSPs++;
3097 
3098  Real CSP_fraction = ( (Real) satisfied_CSPs ) / ( (Real) total_CSPs);
3099 
3100  return( CSP_fraction );
3101 
3102  } // monoub_CSP_fraction
3103 
3104  bool
3106  using namespace core::scoring;
3107 
3108  TR << "UBI Mono Ubi Checking Centroid Filter" << std::endl;
3109 
3110  bool passed_filter = true;
3111 
3113  ( *dock_lowres_cst_scorefxn_ )( pose_in );
3114  Real constraint_score = pose_in.energies().total_energies()[
3116  score_map_[ "AC_constraint" ] = constraint_score;
3117  if( passed_filter && ( constraint_score >= fullatom_constraint_cutoff_)){
3118  passed_filter = false;
3119  TR << "UBI Failed Centroid Filter Constraint Score: "
3120  << constraint_score
3121  << std::endl;
3122  }
3123  else {
3124  if ( constraint_score < fullatom_constraint_cutoff_ )
3125  TR << "UBI Success Centroid Filter Constraint Score: "
3126  << constraint_score
3127  << std::endl;
3128  }
3130  cen_constraint_ );
3131  ( *dock_lowres_cst_scorefxn_ )( pose_in );
3132 
3133  Real CSP_fraction_ratio = monoub_CSP_fraction( pose_in );
3134  score_map_[ "AA_CSP_fraction" ] = CSP_fraction_ratio;
3135 
3136  if( passed_filter && ( CSP_fraction_ratio <
3138  passed_filter = false;
3139  TR << "UBI Failed Centroid Filter CSP Fraction: "
3140  << CSP_fraction_ratio << std::endl;
3141  }
3142  else {
3143  if( CSP_fraction_ratio >= centroid_allowed_CSP_fraction_ )
3144  TR << "UBI Success Centroid Filter CSP Fraction: "
3145  << CSP_fraction_ratio << std::endl;
3146  }
3147 
3148  Real cen_score( 10000.00 );
3149  if( passed_filter ) {
3150  cen_score = ( *output_cen_scorefxn_ )( pose_in );
3151  }
3152  if( passed_filter && ( cen_score > 0.00 ) ) {
3153  passed_filter = false;
3154  TR << "UBI Failed Centroid Score: " << cen_score << std::endl;
3155  }
3156  else {
3157  if( cen_score <= 0.00 )
3158  TR << "UBI Success Centroid Score: " << cen_score << std::endl;
3159  }
3160 
3161  if ( !passed_filter )
3162  TR << "UBI MONO UBI STRUCTURE FAILED LOW-RES FILTER" << std::endl;
3163  else
3164  TR << "UBI Done: Mono Ubi Successfully Passed Centroid Filter" << std::endl;
3165 
3166  return( passed_filter );
3167  } // monoub_centroid_filter
3168 
3169 
3170  bool
3172  using namespace core::scoring;
3173 
3174  TR << "UBI Mono Ubi Checking Fullatom Filter" << std::endl;
3175 
3176  bool passed_filter = true;
3177 
3179  ( *dockfa_cst_scorefxn_ )( pose_in );
3180  Real constraint_score = pose_in.energies().total_energies()[
3182  score_map_[ "AC_constraint" ] = constraint_score;
3183  if ( passed_filter && ( constraint_score >= fullatom_constraint_cutoff_
3184  && !refinement_mode_ ) ) {
3185  passed_filter = false;
3186  TR << "UBI Failed Fullatom Filter Constraint Score: "
3187  << constraint_score
3188  << std::endl;
3189  }
3190  else {
3191  if( constraint_score < fullatom_constraint_cutoff_ )
3192  TR << "UBI Success Fullatom Filter Constraint Score: "
3193  << constraint_score
3194  << std::endl;
3195  }
3197  full_constraint_ );
3198  ( *dockfa_cst_scorefxn_ )( pose_in );
3199 
3200  Real CSP_fraction_ratio = monoub_CSP_fraction( pose_in );
3201  score_map_[ "AA_CSP_fraction" ] = CSP_fraction_ratio;
3202  if( passed_filter && ( CSP_fraction_ratio <
3204  passed_filter = false;
3205  TR << "UBI Failed Fullatom Filter CSP Fraction: "
3206  << CSP_fraction_ratio << std::endl;
3207  }
3208  else {
3209  if( CSP_fraction_ratio >= fullatom_allowed_CSP_fraction_ )
3210  TR << "UBI Success Fullatom Filter CSP Fraction: "
3211  << CSP_fraction_ratio << std::endl;
3212  }
3213 
3214  score_map_[ "AG_I_sc" ] = monoub_calc_interaction_energy( pose_in );
3215 
3216  if ( !passed_filter )
3217  TR << "UBI MONO UBI STRUCTURE FAILED HIGH-RES FILTER" << std::endl;
3218  else
3219  TR << "UBI Done: Mono Ubi Successfully Passed Fullatom Filter"
3220  << std::endl;
3221 
3222  return( passed_filter );
3223  } // monoub_fullatom_filter
3224 
3225  core::Real
3227  const pose::Pose & pose_in,
3228  const pose::Pose & native_pose ) {
3229 
3230  using namespace core::scoring;
3231 
3232  FArray1D_bool superpos_partner ( monoub_end_, false );
3233 
3234  Size compute_rmsd_start(0), compute_rmsd_end(0);
3235 
3236  compute_rmsd_start = e2_end_ + 1;
3237  compute_rmsd_end = monoub_end_;
3238  for ( Size i = compute_rmsd_start; i <= compute_rmsd_end; ++i )
3239  superpos_partner(i) = true;
3240 
3241  Real Lrmsd = rmsd_no_super_subset( native_pose, pose_in,
3242  superpos_partner, is_protein_CA );
3243  return ( Lrmsd );
3244  } // monoub_calc_Lrmsd
3245 #endif
3246  } // end ub_e2c
3247 
3248 } // end protocols
3249