Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ConstraintFragmentSampler.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 src/protocols/abinitio/ConstraintFragmentSampler.hh
11 /// @brief header file for ConstraintFragmentSampler protocol
12 /// @detailed
13 /// Contains currently: Classic Abinitio
14 ///
15 ///
16 /// @author Oliver Lange
17 /// @author James Thompson
18 /// @author Mike Tyka
19 
20 #ifndef INCLUDED_protocols_abinitio_ConstraintFragmentSampler_hh
21 #define INCLUDED_protocols_abinitio_ConstraintFragmentSampler_hh
22 
23 // Unit Headers
25 
26 // Project Headers
28 #include <core/pose/Pose.fwd.hh>
29 #include <core/types.hh>
30 
31 // Utility headers
32 #include <utility/pointer/ReferenceCount.hh>
33 
34 // C++ headers
35 #include <string>
36 #include <vector>
37 
39 #include <utility/vector1.hh>
40 
41 namespace protocols {
42 namespace abinitio {
43 
44 /// Move these forward declarations to ConstraintFragmentSampler.fwd.hh
47 
48 //@ brief The Classic Abinitio protocol from rosetta++
49 /*!
50 @ detail
51 general usage:
52 ConstraintFragmentSampler abinitio;
53 abinitio.init( pose );
54 ...
55 while(nstruct) {
56  abinitio.apply( pose );
57 }
58 
59 call ConstraintFragmentSampler::register_options() before core::init to add relevant options to the applications help
60 
61 , with the following
62 stages, all of which uses a different ScoreFunction based on the cen_std.wts in minirosetta_database:
63 
64 - Stage 1: large (usually 9mer) randomly selected fragment insertions, only VDW term turned on.
65 Uses score0.wts_patch and runs for either a maximum of 2000 cycles or until all moveable phi/psi values
66 have been changed.
67 
68 - Stage 2: large randomly selected fragment insertions, more score terms turned on. Uses score1.wts_patch
69 and runs for 2000 cycles.
70 
71 - Stage 3: uses large randomly selected fragment insertions, although the size of the fragment insertions
72 is tunable via the set_apply_large_frags( bool ) method. Alternates between score2.wts_patch and score5.wts_patch,
73 running tunable numbers of 2000-cycle iterations between the two scoring functions.
74 
75 - Stage 4: uses small (usually 3mer) fragment insertions with the fragment selection based on the Gunn cost for
76 finding local fragment moves. Runs for 4000-cycles and uses score3.wts_patch.
77 
78 The class implements the basic abinito approach as known from rosetta++. We tried to set this up, such that
79 behaviour of the protocol can be changed in many different ways ( see, e.g., FoldConstraints ). To be able to change the
80 behaviour of the protocol easily the class-apply function and methods called therein (e.g., prepare_XXX() / do_XXX_cycles() ) should
81 not directly change moves or trials. A reference to the currently used score-function should be obtained by
82 mc().score_function() ...
83 
84 Behaviour can be changed in the following ways:
85 
86 use non-classic FragmentMover --> eg. not uniformly sampled fragments, but using some weighting
87  --> large and small moves doesn't have to be 3mers and 9mers... use other movers...
88  ---> or other fragets for the "convenience constructor"
89 use custom trial classes --> overload update_moves()
90 
91 change sampling behaviour:
92  overload prepare_XXX() methods: these are called before the cycling for a certain stage begins
93  overload do_stageX_cycles() : the actual loops over trial-moves ...
94 
95 change scoring functions:
96  overload set_default_scores()
97  weight-changes effective for all stages: set_score_weight()
98 */
99 
102 typedef moves::Mover BaseClass; //happens to be same as Parent
103 
104 public:
105  ///@brief This constructor does not work -- Fix it before using it.
106  // constructor: supply mover classes for Fragment Moves
108 
109  //@brief ConstraintFragmentSampler has virtual functions... use this to obtain a new instance
110  virtual
111  moves::MoverOP clone() const;
112 
113  //@brief run protocol on pose
114  virtual void apply( core::pose::Pose & pose );
115  virtual std::string get_name() const;
116 
117  //@brief register cmd-line options in option system ( call before core::init )
118  static void register_options();
119 
120 protected:
121  ///@brief
123  constraint_weight_ = setting;
125  };
126 
127  //@brief read out cmd-line options
128  void set_defaults();
129 
130  //@brief run cycles for different scoring_stages, return number of steps used
131  virtual void do_stage1_cycles( core::pose::Pose &pose );
132 
133  // anything you want to have done before the stages ?
134  //@brief prepare_stageX is called before do_stageX_cycles... overload to change status/scoring/conformation....
135  virtual void prepare_stage1( core::pose::Pose &pose );
136  virtual void prepare_stage2( core::pose::Pose &pose );
137 
138  //@brief called in each iteration of inner loop in stage3 before stage3_cycles_ of trials commence
139  virtual void prepare_loop_in_stage3(
141  Size, /* loop_iteration*/
142  Size /* total_iterations */
143  );
144 
145  //@brief called in each iteration of the loop in stage4 before the stage4_cycles_ of trials commence
146  virtual void prepare_loop_in_stage4(
148  Size, /* loop_iteration*/
149  Size /* total_iterations */
150  );
151 
152  void set_show_viol_level( core::Size setting ) {
153  show_viol_level_ = setting;
154  }
155 
156  virtual void set_max_seq_sep( core::pose::Pose& pose, Size setting );
157 
159  return max_seq_sep_fudge_;
160  }
161 
162  void max_seq_sep_fudge( core::Real setting ) {
163  max_seq_sep_fudge_ = setting;
164  }
165 
167  return *constraints_;
168  }
169 
170  Size total_res( core::pose::Pose const& pose ) const;
171 
172  void set_seq_sep_stage1 ( core::Real setting ) {
173  seq_sep_stage1_ = setting;
174  }
175 
176  void set_seq_sep_stage3 ( core::Real setting ) {
177  seq_sep_stage3_ = setting;
178  }
179 
180  virtual void replace_scorefxn( core::pose::Pose& pose, StageID stage, core::Real intra_stage_progress );
181 
182 private:
183  core::Real
185 
188 
190 
195 
196  //@brief skip cycles in stage1 if nothing is violted ( threshold = ? )
198 
199  //@brief just for screen output: how verbose should it be
201 
202  //@brief usually we do a recover_low before we increase the number of active constraints
204 
205  //@brief chainbreak weight is ramped up during stage3 and stage4
207 
208  //@brief chainbreak weight is ramped up during stage3 and stage4
210 
211  //@brief overlap chainbreak will be ramped in in stage4
213 };
214 
215 } // abinitio
216 } // protocols
217 
218 #endif