Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FastRelax.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/relax/FastRelax.hh
11 /// @brief The FastRelax Protocol
12 /// @detailed
13 /// @author Mike Tyka
14 
15 
16 #ifndef INCLUDED_protocols_relax_FastRelax_hh
17 #define INCLUDED_protocols_relax_FastRelax_hh
18 
19 // Unit headers
21 
23 #include <protocols/moves/Mover.hh>
24 
26 
28 
29 #include <core/pose/Pose.fwd.hh>
30 
33 
34 //// C++ headers
35 #include <string>
36 
38 #include <utility/vector1.hh>
39 
40 
41 
42 namespace protocols {
43 namespace relax {
44 
45 
48  command="";
49  param1=0;
50  param2=0;
51  param3=0;
52  param4=0;
53  nparams=0;
54  }
61 };
62 
63 class FastRelax : public RelaxProtocolBase {
64 public:
65 
66  /// @brief Initialize FastRelax with a specific script file, which encodes the script of steps
67  /// the is to be applied
68  FastRelax(
69  core::Size standard_repeats = 0
70  );
71 
72  /// @brief Initialize FastRelax using the default script with a varying number of rounds,
73  /// defined by the standard_repeats repeats paramter. By default, 5.
74  FastRelax(
76  core::Size standard_repeats = 0
77  );
78 
79  /// @brief Initialize FastRelax with a specific script file, which encodes the script of steps
80  /// the is to be applied
81  FastRelax(
83  std::string const & script_file
84  );
85 
86  /// @brief Initialize FastRelax with a specific script file, and allows fastrelax to only use a subset of the number of stages in the scriptfile.
87  FastRelax(
89  core::Size standard_repeats,
90  const std::string & script_file
91  );
92  /// @brief Override the stored script with the default script for batchrelax
93  /// Ignores '-default_repeat' value
95  core::Size standard_repeats = 0
96  );
97 
98  /// @brief Force us to batchrelax with nonideal geometry (using additional memory)
99  void set_force_nonideal( bool val ) { force_nonideal_ = val; }
100 
101  /// @brief virtual constructor to allow derivation
102  virtual ~FastRelax();
103 
104  /// @brief Parses the FastRelaxTags
105  void parse_my_tag(
106  utility::tag::TagPtr const tag,
110  core::pose::Pose const &
111  );
112 
113  virtual void parse_def( utility::lua::LuaObject const & def,
114  utility::lua::LuaObject const & score_fxns,
115  utility::lua::LuaObject const & tasks,
117 
118  /// @brief Initializes class using option system. This is called by the constructors
119  void set_to_default();
120 
121  /// @brief Return the name of this mover.
122  virtual std::string get_name() const;
123 
124  /// @brief return a fresh instance of this class in an owning pointer
125  virtual protocols::moves::MoverOP clone() const;
126 
127  /// @brief Apply the FastRelax. Overloaded apply function from mover base class.
128  virtual void apply( core::pose::Pose & pose );
129 
130  /// @brief sets the movemap to not allow DNA to move during relax.
131 
133 
134 
135  /// @brief Batch Relax, a new even faster way to relax entire batches of structures.
136  void batch_apply(
137  std::vector < core::io::silent::SilentStructOP > & input_structs,
139  core::Real decay_rate = 0.5 );
140 
141 protected:
142 
143  void cmd_accept_to_best(
144  const core::scoring::ScoreFunctionOP local_scorefxn,
145  core::pose::Pose &pose,
146  core::pose::Pose &best_pose,
147  const core::pose::Pose &start_pose,
148  core::Real &best_score,
149  core::Size &accept_count
150  );
151 
152  void do_minimize(
153  core::pose::Pose &pose,
154  core::Real tolerance,
155  core::kinematics::MoveMapOP local_movemap,
156  core::scoring::ScoreFunctionOP local_scorefxn
157  );
158 
159 private:
160 
161  void read_script_file( const std::string &script_file, core::Size standard_repeats = 5 );
162 
163 private: // options
164 
165  /// @brief Number of repeats if using default script
167 
168  /// @brief Apply Ramady(tm) fix to residues with bad rama scores ?
169  bool ramady_;
170 
171  /// @brief Number of bad ramas to fix per call to 'fix_worst_bad_ramas'
173 
174  /// @brief Reject ramady changes perturbing structure more than this amount
176 
177  /// @brief Cutoff for calling a rama 'bad'
179 
180  /// @brief Force ramady to be run (normally skip rate of 10%)
182 
183  /// @brief Allow Chi angles to move ?
184  bool repack_;
185 
186  /// @brief Do only a few test_cycles ?
188 
189  /// @brief [batch mode only] force structures to be nonideal? Default uses -out:silent_struct_type to decide
191 
192  /// @brief Dump pdb after repack, min, or ramp_repack_min?
193  bool dumpall_;
194 
195  /// @brief Quit after this many accepts ?// limits themaximum number of accepts, default is 1000000
197 
198  /// @brief Do a symmetric RMSD calculation rather then a monomeric one.
200 
201 private: // other data
202 
204 
205  std::vector <RelaxScriptCommand> script_;
206  utility::tag::TagPtr movemap_tag_; // this cannot be parsed before apply b/c the fold tree is likely to change during a run
207 };
208 
209 
210 
211 
212 }
213 } // protocols
214 
215 #endif