Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BackrubMover.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/backrub/BackrubMover.hh
11 /// @brief definition of BackrubMover class and functions
12 /// @author Colin A. Smith (colin.smith@ucsf.edu)
13 
14 
15 #ifndef INCLUDED_protocols_backrub_BackrubMover_hh
16 #define INCLUDED_protocols_backrub_BackrubMover_hh
17 
19 
20 
21 // Core Headers
23 #include <core/pose/Pose.fwd.hh>
25 
26 // Protocols Headers
32 
33 // Utility Headers
34 // AUTO-REMOVED #include <utility/vector0.hh>
35 // AUTO-REMOVED #include <utility/vector1.hh>
36 // AUTO-REMOVED #include <numeric/conversions.hh>
37 #include <utility/keys/Key3Vector.hh>
38 
39 // Numeric Headers
40 #include <numeric/IntervalSet.fwd.hh>
41 
42 // C++ Headers
43 #include <map>
44 
45 #include <utility/vector0_bool.hh>
46 #include <utility/vector1.hh>
47 #include <numeric/NumericTraits.hh>
48 
49 
50 namespace protocols {
51 namespace backrub {
52 
53 
54 /// @brief class for applying backrub moves to arbitrary protein segments
56 
57 public:
58 
59  BackrubMover();
60 
62  BackrubMover const & mover
63  );
64 
65  virtual protocols::moves::MoverOP clone() const;
67 
68  void
70 
71  virtual
72  void
74  utility::tag::TagPtr const tag,
76  protocols::filters::Filters_map const & filters,
77  protocols::moves::Movers_map const & movers,
78  core::pose::Pose const & pose
79  );
80 
81  virtual
82  void
84  core::pose::Pose & pose,
86  core::Size cycle //non-zero if trajectory is restarted
87  );
88 
89  // @brief apply the backrub move to a Pose object
90  void
91  apply(
92  Pose & pose
93  );
94  virtual std::string get_name() const;
95 
96  /// @brief get the segment ID for a given starting and ending atom
97  /// @detailed
98  /// if the segment ID does not exist, 0 is returned
99  Size
101  core::id::AtomID start_atomid,
102  core::id::AtomID end_atomid
103  )
104  {
105  for (Size i = 1; i <= segments_.size(); ++i) {
106  if (segments_[i].start_atomid() == start_atomid && segments_[i].end_atomid() == end_atomid) return i;
107  }
108 
109  return 0;
110  }
111 
112  /// @brief determine whether a given segment exists
113  bool
115  core::id::AtomID start_atomid,
116  core::id::AtomID end_atomid
117  )
118  {
119  return segment_id(start_atomid, end_atomid);
120  }
121 
122  /// @brief get a particular segment
123  BackrubSegment const &
126  )
127  {
128  return segments_[segment_id];
129  }
130 
131  /// @brief remove all segements
132  void
134  {
135  segments_.clear();
136  }
137 
138  /// @brief get the number of segments
139  core::Size
141  {
142  return segments_.size();
143  }
144 
145  /// @brief add a segment to the mover
146  Size
147  add_segment(
148  core::id::AtomID start_atomid,
149  core::id::AtomID end_atomid,
150  core::Real max_angle_disp = 0
151  );
152 
153  /// @brief add segments between a list of mainchain atomids
154  core::Size
159  );
160 
161  /// @brief add segments between mainchain atoms in contiguous stretches of residues
162  core::Size
168  );
169 
170  /// @brief add segments between mainchain atoms using stored parameters
171  core::Size
173 
174  /// @brief add segments between mainchain atoms using command line options
175  core::Size
177 
178  /// @brief optimize branching atoms for all segment pivot atoms
179  void
181  Pose & pose
182  );
183 
184  /// @brief get residues to pivot if no segments manually defined
186  pivot_residues() const;
187 
188  /// @brief set residues to pivot if no segments manually defined
189  void
192  );
193 
194  /// @brief get atom names to pivot if no segments manually defined
196  pivot_atoms() const;
197 
198  /// @brief set atom names to pivot if no segments manually defined
199  void
202  );
203 
204  /// @brief get minimum segment length if no segments manually defined
205  core::Size
206  min_atoms() const;
207 
208  /// @brief set minimum segment length if no segments manually defined
209  void
212  );
213 
214  /// @brief get maximum segment length if no segments manually defined
215  core::Size
216  max_atoms() const;
217 
218  /// @brief set maximum segment length if no segments manually defined
219  void
222  );
223 
224  /// @brief get maximum angular displacement for 4 atom segments
225  core::Real
226  max_angle_disp_4() const;
227 
228  /// @brief set maximum angular displacement for 4 atom segments
229  void
232  );
233 
234  /// @brief get maximum angular displacement for 7 atom segments
235  core::Real
236  max_angle_disp_7() const;
237 
238  /// @brief set maximum angular displacement for 7 atom segments
239  void
242  );
243 
244  /// @brief get maximum angular displacement slope for other atom segments
245  core::Real
246  max_angle_disp_slope() const;
247 
248  /// @brief set maximum angular displacement slope for other atom segments
249  void
252  );
253 
254  /// @brief get whether detailed balance is preserved (i.e. no branch angle optimization during moves)
255  virtual
256  bool
258 
259  /// @brief set whether detailed balance is preserved (i.e. no branch angle optimization during moves)
260  virtual
261  void
264  );
265 
266  /// @brief get whether to exit during initialize_simulation if the mm_bend term isn't turned on
267  bool
268  require_mm_bend() const;
269 
270  /// @brief set whether to exit during initialize_simulation if the mm_bend term isn't turned on
271  void
273  bool require_mm_bend
274  );
275 
276  /// @brief get the TorsionIDs perturbed by the mover during moves, along with their ranges
277  virtual
280  core::pose::Pose & pose
281  );
282 
283  /// @brief get the DOF_IDs perturbed by the mover during moves, along with their ranges
284  virtual
287  core::pose::Pose & pose
288  );
289 
290  /// @brief do a manual rotation about the given segment
291  void
293  Pose & pose,
295  core::Real angle,
296  utility::vector0<core::Real> & start_constants,
297  utility::vector0<core::Real> & end_constants
298  );
299 
300  /// @brief get a random angle for a segment subject to bond angle and rotation constraints
301  core::Real
302  random_angle(
303  Pose & pose,
305  utility::vector0<core::Real> & start_constants,
306  utility::vector0<core::Real> & end_constants
307  );
308 
309  /// @brief get the branch angle optimizer stored in the mover
312  {
313  return branchopt_;
314  }
315 
316  /// @brief set the id for the next move (i.e. nonrandom)
317  core::Size
318  next_segment_id() const;
319 
320  /// @brief set the id for the next move (i.e. nonrandom)
321  void
324  );
325 
326  /// @brief get id the last backrub segment moved
327  core::Size
328  last_segment_id() const;
329 
330  /// @brief get the name of the atom at the start of the last segment
332  last_start_atom_name() const;
333 
334  /// @brief get the name of the atom at the end of the last segment
336  last_end_atom_name() const;
337 
338  /// @brief get the last rotation angle
339  core::Real
340  last_angle() const;
341 
342  /// @brief update string describing the move type
343  void
344  update_type();
345 
346 private:
347 
350  std::map<protocols::backrub::BackrubSegment::BondAngleKey, core::Size> bond_angle_map_;
365 };
366 
367 /// @brief calculate constants necessary for calculating internal angles/derivatives
368 void
376  utility::vector0<double> & constants,
377  core::Real const alpha_min = 0,
378  core::Real const alpha_max = numeric::NumericTraits<core::Real>::pi(),
379  numeric::IntervalSet<core::Real> *tau_intervals = NULL
380 );
381 
382 /// @brief calculate internal coordinate values for any tau value
383 void
385  utility::vector0<core::Real> const & constants,
386  core::Real const tau,
387  core::Real & bondange,
388  core::Real & torsion1,
389  core::Real & torsion2
390 );
391 
392 } // moves
393 } // protocols
394 
395 #endif