Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BackboneMover.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
11 /// @brief
12 /// @author
13 
14 
15 #ifndef INCLUDED_protocols_simple_moves_BackboneMover_hh
16 #define INCLUDED_protocols_simple_moves_BackboneMover_hh
17 
18 // Unit headers
20 
21 // Package headers
23 
24 #include <core/types.hh>
25 
26 #include <core/pose/Pose.fwd.hh>
27 
30 
33 
34 // ObjexxFCL Headers
35 
36 // C++ Headers
37 #include <map>
38 #include <string>
39 
40 // Utility Headers
41 #include <utility/pointer/ReferenceCount.hh>
42 
43 #include <utility/vector1.hh>
44 
45 
46 namespace protocols {
47 namespace simple_moves {
48 
49 ///////////////////////////////////////////////////////////////////////////////
50 /// BackboneMover class has elements of the MC temperature to do repetitions
51 /// of bb moves (small, shear, wobble, etc.).
52 /// @todo change this to some kind of 'protocol' so the MC is managed separately from
53 /// conformational moves
55 
56 public:
57  typedef core::Real Real;
58 
59 public:
60 
61  // empty constructor fills the mover with default values
62  // default values from smallmoves.cc of Rosetta++ (small_move_param)
63  BackboneMover();
64 
66  core::kinematics::MoveMapOP movemap_in,
67  core::Real temperature_in,
68  core::Size nmoves_in
69  );
70 
71  //destructor
73 
74  /// virtual functions that get overridden or called from the inheriting classes
75  virtual void apply( core::pose::Pose & );
76  virtual std::string get_name() const;
77 
78  virtual void setup_list( core::pose::Pose & ) = 0;
79 
80  virtual void set_angles( core::Real ) = 0;
81 
82  virtual bool make_move( core::pose::Pose & ) = 0;
83 
84  void clear();
85 
86  bool check_rama();
87 
88  /// Properties set/get functions
89  void temperature( core::Real const temperature_in );
90  core::Real temperature() const;
91  void nmoves( core::Size const nmoves_in );
92  core::Size nmoves() const;
94  // Because this function is in a .hh and not a .cc, we must #include <MoveMap.hh> and
95  // are not able to #include <MoveMap.fwd.hh> alone. As a general rule, do not put
96  // function definitions in .hh files. Break that rule only if you're able to demonstrate a
97  // genuine inlining performance boost.
98  void movemap(core::kinematics::MoveMapOP new_movemap);
99 
100 
101  /// @brief Sets the maximum angle of perturbation, independent of
102  /// secondary structure.
103  ///
104  /// Example:
105  /// bbmover.angle_max(25)
106  /// See also:
107  /// ShearMover
108  /// SmallMover
109  void angle_max( core::Real const angle );
110 
111  /// @brief Sets the max angle of perturbation for residues with <type>
112  /// secondary structure. (<type> must be 'H', 'E', or 'L'.)
113  ///
114  /// Example:
115  /// bbmover.angle_max('H', 25)
116  ///
117  /// See also:
118  /// ShearMover
119  /// SmallMover
120  void angle_max( char const type, core::Real const angle );
121 
122  // Note: Pass in by value for one-direction assignment.
123  /// @brief Sets the max angle of perturbation, for secondary structures
124  /// 'H', 'E', and 'L'.
125  void angle_max( std::map< char, core::Real > angle_max_in );
126 
127  /// @brief Gets the max angle of perturbation for residues with <type>
128  /// secondary structure. (<type> must be 'H', 'E', or 'L'.)
129  ///
130  /// Example:
131  /// bbmover.angle_max('H')
132  ///
133  /// See also:
134  /// ShearMover
135  /// SmallMover
136  core::Real get_angle_max(char const type) const;
137 
138 
141 
142  virtual
143  void
144  parse_my_tag(
145  utility::tag::TagPtr const tag,
147  protocols::filters::Filters_map const & filters,
148  protocols::moves::Movers_map const & movers,
149  core::pose::Pose const & pose
150  );
151 
152  /// @brief get whether detailed balance is preserved (i.e. no Ramachandran biasing)
153  bool
155 
156  /// @brief set whether detailed balance is preserved (i.e. no Ramachandran biasing)
157  void
160  );
161 
162  /// @brief get the DOF_IDs perturbed by the mover during moves, along with their ranges
163  virtual
166  core::pose::Pose & pose
167  ) = 0;
168 
169 protected:
170 
172 
173  /// controls bias w/which uphill moves are accepted
175 
176  /// number of positions at which to make moves
178 
179  /// max allowed angle-change as a function of ss type
180  std::map< char, core::Real > angle_max_;
181 
182  // variables for the apply
187 
190 
192 };
193 
194 ///////////////////////////////////////////////////////////////////////////////
195 
196 
197 /// @brief A mover that makes independent random perturbations of the phi and
198 /// psi torsion angles of residue i. It selects residue i at random among
199 /// movable residues (set by its MoveMap), and the final torsion angle
200 /// is subject to a metropolis criterion using the rama score to ensure that
201 /// only favorable backbone torsion angles are being selected. The number of
202 /// perturbations, and the magnitude of perturbations, and the temperature
203 /// in the rama check, can all be modified.
204 ///
205 /// Common Methods:
206 /// SmallMover.apply
207 /// SmallMover.angle_max
208 class SmallMover : public BackboneMover {
209 
210 public:
211 
212  // default constructor
213  SmallMover();
214 // SmallMover() : BackboneMover() { protocols::moves::Mover::type( "SmallMover" ); }
215 
216  /// @brief Constructs a SmallMover
217  /// smallmover = SmallMover( movemap , kT , n_moves )
218  ///
219  /// MoveMap movemap /object storing BB torsion movability
220  /// Real (float) kT /used in rama Metropolis Criterion
221  /// Size (int) n_moves /the number of perturbations for one move
222  SmallMover(
223  core::kinematics::MoveMapOP movemap_in,
224  core::Real temperature_in,
225  core::Size nmoves_in
226  );
227 
228  //destructor
229  ~SmallMover();
230  virtual std::string get_name() const;
231 
233 
234  virtual void setup_list( core::pose::Pose & pose );
235  virtual void set_angles( core::Real angle_in );
236  virtual bool make_move( core::pose::Pose & pose );
237 
238  virtual void test_move( core::pose::Pose & );
239 
240  /// @brief get the TorsionIDs perturbed by the mover during moves, along with their ranges
241  virtual
244  core::pose::Pose & pose
245  );
246 
247  /// @brief get the DOF_IDs perturbed by the mover during moves, along with their ranges
248  virtual
251  core::pose::Pose & pose
252  );
253 };
254 
255 
256 ///////////////////////////////////////////////////////////////////////////////
257 
258 
259 /// @brief A mover that perturbs the phi of residue i and the psi of residue
260 /// i-1 such that they create a 'shearing' effect, minimizing the downstream
261 /// consequences of this torsional perturbation. The final torsion angle
262 /// is subject to a metropolis criterion using the rama score to ensure that
263 /// only favorable backbone torsion angles are being selected. The number of
264 /// perturbations, and the magnitude of perturbations, and the temperature
265 /// in the rama check, can all be modified.
266 ///
267 /// Common Methods:
268 /// ShearMover.apply
269 class ShearMover : public BackboneMover {
270 
271 public:
272 
273  // default constructor
274  ShearMover();
275  //ShearMover() : BackboneMover() { protocols::moves::Mover::type( "ShearMover" ); }
276 
277  /// @brief Constructs a ShearMover
278  /// shearmover = ShearMover( movemap , kT , n_moves )
279  ///
280  /// MoveMap movemap /object storing BB torsion movability
281  /// Real (float) kT /used in rama Metropolis Criterion
282  /// Size (int) n_moves /the number of perturbations for one move
283  ShearMover(
284  core::kinematics::MoveMapOP movemap_in,
285  core::Real temperature_in,
286  core::Size nmoves_in
287  );
288 
289  //destructor
290  ~ShearMover();
291  virtual std::string get_name() const;
292 
294 
295  virtual void setup_list( core::pose::Pose & pose );
296  virtual void set_angles( core::Real angle_in );
297  virtual bool make_move( core::pose::Pose & pose );
298 
299  virtual void test_move( core::pose::Pose & );
300 
301  /// @brief get the TorsionIDs perturbed by the mover during moves, along with their ranges
302  virtual
305  core::pose::Pose & pose
306  );
307 
308  /// @brief get the DOF_IDs perturbed by the mover during moves, along with their ranges
309  virtual
312  core::pose::Pose & pose
313  );
314 };
315 
316 std::ostream &operator<< (std::ostream &os, BackboneMover const &mover);
317 
318 } // simple_moves
319 } // protocols
320 
321 
322 #endif //INCLUDED_protocols_simple_moves_BackboneMover_HH
323