Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RemodelLoopMover.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file protocols/forge/remodel/RemodelLoopMover.hh
11 /// @brief Loop modeling protocol based on routines from Remodel and EpiGraft
12 /// packages in Rosetta++.
13 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
14 /// @author Possu Huang (possu@u.washington.edu)
15 
16 #ifndef INCLUDED_protocols_forge_remodel_RemodelLoopMover_hh
17 #define INCLUDED_protocols_forge_remodel_RemodelLoopMover_hh
18 
19 // unit headers
21 
22 // project headers
25 #include <core/pose/Pose.fwd.hh>
26 #include <core/pose/Pose.hh>
29 #include <protocols/loops/Loop.hh>
30 #include <protocols/loops/Loops.hh>
31 #include <protocols/moves/Mover.hh>
32 // AUTO-REMOVED #include <core/fragment/FragSet.hh>
33 
34 // utility headers
35 #include <utility/vector1.hh>
36 
37 #include <string>
38 
40 
41 
42 namespace protocols {
43 namespace forge {
44 namespace remodel {
45 
46 
47 /// @brief Loop modeling protocol based on routines from Remodel and EpiGraft
48 /// packages in Rosetta++.
50 
51 
52 private: // typedefs
53 
54 
56 
57 
58 public: // typedefs
59 
60 
61  typedef core::Real Real;
62  typedef core::Size Size;
64 
72 
79 
82 
87 
88 
89 public: // construct/destruct
90 
91 
92  /// @brief default constructor
94 
95 
96  /// @brief loops constructor
98 
99 
100  /// @brief copy constructor
101  RemodelLoopMover( RemodelLoopMover const & rval );
102 
103 
104  /// @brief default destructor
105  virtual
107 
108 
109 public: // options
110 
111 
112  void set_param_from_options();
113 
114  static void register_options();
115 
116 private: // disallow assignment
117 
118 
119  /// @brief copy assignment
120  /// @remarks Mover base class prevents this from working properly...
121  RemodelLoopMover & operator =( RemodelLoopMover const & rval );
122 
123 
124 public: // virtual constructors
125 
126 
127  /// @brief clone this object
128  virtual
129  MoverOP clone() const;
130 
131 
132  /// @brief create this type of object
133  virtual
134  MoverOP fresh_instance() const;
135 
136 
137 public: // accessors
138 
139 
140  /// @brief the ScoreFunction to use during modeling;
141  ScoreFunction const & scorefunction() const;
142 
143 
144  /// @brief get the false movemap
145  /// @remarks All movemaps are generated with respect to this movemap.
146  /// Any explicit False settings within this movemap will be retained in all
147  /// descendant movemaps.
148  inline
149  MoveMap const & false_movemap() const {
150  return false_movemap_;
151  }
152 
153 
154  /// @brief if linear chainbreak is <= this value, loop is considered closed
155  /// (default 0.07)
156  inline
158  return max_linear_chainbreak_;
159  }
160 
161 
162  /// @brief randomize loops prior to running main protocol? (default true)
163  inline
164  bool randomize_loops() const {
165  return randomize_loops_;
166  }
167 
168 
169  /// @brief the allowed number of overall closure attempts before apply() exits
170  /// (default 3)
171  inline
174  }
175 
176  /// @brief the number of loophash closure cycles to perform (default 8)
177  inline
179  return loophash_cycles_;
180  }
181 
182  /// @brief the number of simultaneous closure cycles to perform (default 2)
183  inline
185  return simultaneous_cycles_;
186  }
187 
188 
189  /// @brief the number of independent closure cycles to perform (default 8)
190  inline
192  return independent_cycles_;
193  }
194 
195 
196  /// @brief the maximum number of possible lockdown closure cycles to perform
197  /// (default 30)
198  inline
200  return boost_closure_cycles_;
201  }
202 
203 
204  /// @brief the total number of "standard" (equal to simul + independent)
205  /// to perform
206  inline
209  }
210 
211  /// @brief temperature for mc ( default 2.0 )
212  inline
213  Real temperature() const {
214  return temperature_;
215  }
216 
217 
218 
219 public: // mutators
220 
221  // @brief for building repeat structures stored in private variable
222  void repeat_generation_with_additional_residue(Pose & pose, Pose &repeat_pose);
223 
224  void repeat_generation(Pose & pose, Pose &repeat_pose);
225 
226  void
227  repeat_sync(
228  core::pose::Pose & repeat_pose,
229  core::Size repeat_number
230  );
231 
232 
233  // @brief for updating repeat angles from a monomeric copy
234  void repeat_propagation( Pose & pose, Pose & repeat_pose, Size repeat_number);
235 
236 
237 
238  /// @brief the ScoreFunction to use during modeling
239  void scorefunction( ScoreFunction const & sfx );
240 
241 
242  /// @brief set the false movemap to use
243  /// @remarks All movemaps are generated with respect to this movemap.
244  /// Any explicit False settings within this movemap will be retained in all
245  /// descendant movemaps.
246  inline
247  void false_movemap( MoveMap const & movemap ) {
248  false_movemap_ = movemap;
249  }
250 
251 
252  /// @brief if linear chainbreak is <= this value, loop is considered closed
253  inline
254  void max_linear_chainbreak( Real const val ) {
256  }
257 
258 
259  /// @brief randomize loops prior to running main protocol?
260  inline
261  void randomize_loops( bool const flag ) {
262  randomize_loops_ = flag;
263  }
264 
265 
266  /// @brief the allowed number of overall closure attempts before apply() exits
267  inline
268  void allowed_closure_attempts( Size const attempts ) {
269  allowed_closure_attempts_ = attempts;
270  }
271 
272  /// @brief the number of loophash closure cycles to perform
273  inline
274  void loophash_cycles( Size const cycles ) {
275  loophash_cycles_ = cycles;
276  }
277 
278  /// @brief the number of simultaneous closure cycles to perform
279  inline
280  void simultaneous_cycles( Size const cycles ) {
281  simultaneous_cycles_ = cycles;
282  }
283 
284 
285  /// @brief the number of independent closure cycles to perform
286  inline
287  void independent_cycles( Size const cycles ) {
288  independent_cycles_ = cycles;
289  }
290 
291  void
293 
294  inline
297 
298 
299  /// @brief the maximum number of possible lockdown closure cycles to perform
300  inline
301  void boost_closure_cycles( Size const cycles ) {
302  boost_closure_cycles_ = cycles;
303  }
304 
305  /// @brief temperature for mc
306  inline
307  void temperature( Real const temp ) {
308  temperature_ = temp;
309  }
310 
311  inline
312  void
313  set_repeat_tail_length( Size const length ) {
314  repeat_tail_length_ = length;
315  }
316 
317  inline
318  void
319  set_keep_input_foldtree( bool const setting ){
320  keep_input_foldtree_ = setting; }
321 
322 public: // loop management
323 
324 
325  /// @brief the loops to model
326  inline
327  loops::LoopsOP const loops() const {
328  return loops_;
329  }
330 
331 
332  /// @brief set the loops to model
333  inline
334  void loops( loops::LoopsOP const loops ) {
335  loops_ = loops;
336  }
337 
338 
339  /// @brief add a loop to model
340  inline
341  void add_loop( Loop const loop ) {
342  loops_->add_loop( loop );
343  }
344 
345 
346 public: // fragment management
347 
348 
349  /// @brief add a fragment set
350  void add_fragments( FragSetCOP fragset );
351 
352 
353  /// @brief clear all fragment sets
354  void clear_fragments();
355 
356 
357 public: // virtual main methods
358 
359 
360  /// @brief apply defined moves to given Pose
361  /// @remarks Sets protocols::moves::MS_SUCCESS upon successful closure of
362  /// all loops, otherwise sets protocols::moves::FAIL_RETRY.
363  virtual
364  void apply( Pose & pose );
365 
366  virtual std::string get_name() const;
367 
368 //make this function public for experimental purpose
369 
370  /// @brief randomize loops
371  void randomize_stage( Pose & pose );
372 
373 protected: // loop modeling stages
374 
375  /// @brief find the smallest fragment size and insert a single such
376  /// smallmer into each loop; for breaking up trapped trajectories
377  /// @param[in,out] pose The pose to modify.
378  /// @param[in] only_broken_loop If true, only insert into broken loops,
379  /// otherwise insert into all. (default true)
381  Pose & pose,
382  bool const only_broken_loops = true
383  );
384 
385  void loophash_stage(
386  Pose & pose,
387  MonteCarlo & mc,
388  Real const cbreak_increment
389  );
390 
391 
392  /// @brief simultaneous stage: multiple loop movement prior to MC accept/reject
393  void simultaneous_stage(
394  Pose & pose,
395  MonteCarlo & mc,
396  Real const cbreak_increment
397  );
398 
399 
400  /// @brief independent stage: single loop movement prior to MC accept/reject
401  void independent_stage(
402  Pose & pose,
403  MonteCarlo & mc,
404  Real const cbreak_increment
405  );
406 
407 
408  /// @brief lockdown stage: close loops within some threshold
409  /// w/ smallest-mer (typically 1-mer) + ccd_move only
410  void boost_closure_stage(
411  Pose & pose,
412  MonteCarlo & mc,
413  Real const cbreak_increment
414  );
415 
416 
417 protected: // loops
418 
419 
420  /// @brief determine which loops need modeling wrt to given Pose
421  /// @remarks Skips closed loops and shuffles the order of the remaining
422  /// loops.
424 
425 
426  /// @brief check all loops for closure criteria
427  /// @param[in] pose The pose being checked.
428  /// @param[in] show_in_tracer Output state of each loop to tracer?
429  /// @return true if all criteria pass, false otherwise
431  Pose & pose,
432  bool const show_in_tracer = false
433  );
434 
435 
436 protected: // fragments
437 
438 
439  /// @brief return fragment movers for the list of internally kept fragment sets,
440  /// 1 fragment mover for each fragment set
441  /// @param[in] movemap Use this movemap when initializing fragment movers.
442  /// @param[in] largest_frag_size Only use fragment sets whose largest fragment
443  /// size is this number. If zero, uses all fragment sets.
445  MoveMap const & movemap,
446  Size const largest_frag_size = 0
447  );
448 
449 
450  /// @brief append fragment movers for the list of internally kept fragment sets,
451  /// 1 fragment mover for each fragment set
452  /// @param[in] movemap Use this movemap when initializing fragment movers.
453  /// @param[out] frag_movers Append fragment movers to this list.
454  /// @param[in] largest_frag_size Only use fragment sets whose largest fragment
455  /// size is this number. If zero, uses all fragment sets.
457  MoveMap const & movemap,
458  FragmentMoverOPs & frag_movers,
459  Size const largest_frag_size = 0
460  );
461 
462 
463  /// @brief create per-loop fragment movers: 1 fragment mover for each loop (uses
464  /// movemaps to lock down non-loop residues)
465  /// @param[in] loops The loops to use.
466  /// @param[in] largest_frag_size Only use fragment sets whose largest fragment
467  /// size is this number. If zero, uses all fragment sets.
469  loops::LoopsOP const loops,
470  Size const largest_frag_size = 0
471  );
472 
473 
474 protected: // movemap
475 
476 
477  /// @brief enforce settings in the false movemap
478  void enforce_false_movemap( MoveMap & movemap );
479 
480 
481  /// @brief mark bb/chi torsions of multiple loops moveable in a movemap
482  /// @param[in] loops The loops to use.
483  /// @param[out] movemap The movemap to modify.
484  /// @param[in] allow_omega Allow bb omega to move? (should be yes when
485  /// doing either fragment insertion or scoring function has omega
486  /// tether, otherwise should probably be no)
487  void mark_loops_moveable(
488  loops::LoopsOP const loops,
489  MoveMap & movemap,
490  bool const allow_omega
491  );
492 
493 
494  /// @brief mark bb/chi torsion of a single loop moveable in movemap
495  /// @param[in] loops The loop to use.
496  /// @param[out] movemap The movemap to modify.
497  /// @param[in] allow_omega Allow bb omega to move? (should be yes when
498  /// doing either fragment insertion or scoring function has omega
499  /// tether, otherwise should probably be no)
500  void mark_loop_moveable(
501  Loop const & loop,
502  MoveMap & movemap,
503  bool const allow_omega
504  );
505 
506 
507  /// @brief count number of residues with moveable backbone torsions in the
508  /// given range [left, right]
510  MoveMap const & movemap,
511  Size const left,
512  Size const right
513  );
514 
515 private: // parser
516 
517 
518  void parse_my_tag(
519  TagPtr const tag,
520  DataMap & data,
521  Filters_map const &,
522  Movers_map const &,
523  Pose const & pose
524  );
525 
526 
527 private: // data
528 
529 
530  /// @brief the score function to use
532 
533 
534  /// @brief the false movemap to use
535  /// @remarks All movemaps are generated with respect to this movemap.
536  /// Any False explicit settings within this movemap will be retained in all
537  /// descendant movemaps.
539 
540 
541  /// @brief list of loops to model
543 
544 
545  /// @brief if linear chainbreak is <= this value, loop is considered closed
546  /// (default 0.07)
548 
549 
550  /// @brief randomize loops prior to running main protocol? (default true)
552 
554 
555 
556  /// @brief the allowed number of overall closure attempts before apply() exits
557  /// (default 3)
559 
560  /// @brief the number of loophash closure cycles to perform (default 8)
562 
563  /// @brief the number of simultaneous closure cycles to perform (default 2)
565 
566 
567  /// @brief the number of independent closure cycles to perform (default 8)
569 
570  /// @brief collection of movers that mess with the pose
571  /// every n fragment/ccd steps during inneriterations of simultaneous,
572  /// and independent stage, where n is determined by the variable below
573  /// gives the user a chance to add their own flavor to the fragment sampling
574  /// done by this protocol
576 
577  /// @brief determines how often the above movers get called
578  /// during fragment insertion/ccd steps (default 3 )
580 
581  /// @brief the maximum number of possible boost closure cycles to perform
582  /// (default 30)
584 
585  /// @brief temperature for mc
587 
588 
589  /// @brief fragment sets to use
591 
592  /// @brief local copy of repeat pose
594 
595  ///@brief whether to keep the FoldTree untouched, i.e. trust the
596  ///user to supply a decent FoldTree
598 
599 
600 };
601 
602 
603 } // remodel
604 } // forge
605 } // protocols
606 
607 
608 #endif /* INCLUDED_protocols_forge_remodel_RemodelLoopMover_HH */