Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GreenPacker.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/simple_moves/GreenPacker.hh
11 /// @brief packing mover that makes extensive reuse of rotamer pair energies class declaration
12 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
13 
14 #ifndef INCLUDED_protocols_simple_moves_GreenPacker_hh
15 #define INCLUDED_protocols_simple_moves_GreenPacker_hh
16 
17 /// Unit headers
19 
20 /// Package headers
21 #include <protocols/moves/Mover.hh>
22 
23 /// Project headers
24 #include <core/chemical/AA.hh>
27 #include <core/graph/Graph.fwd.hh>
32 #include <core/pose/Pose.fwd.hh>
37 #include <core/types.hh>
38 #include <utility/vector1.hh>
39 
40 /// Utility headers
41 #include <utility/pointer/ReferenceCount.hh>
42 
43 namespace protocols {
44 namespace simple_moves {
45 
47 {
48 public:
49  ///@brief Automatically generated virtual destructor for class deriving directly from ReferenceCount
50  virtual ~MinimalRotamer();
54  typedef core::Size Size;
56  typedef core::Real Real;
57 
58 public:
59  MinimalRotamer( Residue const & );
60 
61  bool
62  same( MinimalRotamer const & ) const;
63 
64  bool
65  same_residue_type( MinimalRotamer const & ) const;
66 
67  AA
68  aa() const;
69 
70 private:
71 
72  bool
74  core::conformation::Residue const & res
75  ) const;
76 
77  bool
79  core::conformation::Residue const & res,
80  Size const atom_id
81  ) const;
82 
83  void
85 
86  void
88 
89  void
91  core::conformation::Residue const & res,
92  Size const atom_id
93  );
94 
95  bool
96  chi_matches_coords( core::conformation::Residue const & res, Size chi_index ) const;
97 
98  bool
99  same_chi( MinimalRotamer const & other ) const;
100 
101  bool
102  same_nonideal_geometry( MinimalRotamer const & other ) const;
103 
104 
105 private:
109 
110  // Record of internal geometry using the tree-geometry defined in the
111  // ResidueType.
112  // steal xyzVector to record internal geometry:
113  // x = 0 = d, y = 1 = theta, z = 2 = phi
115 
116  static Size const d = 0;
117  static Size const theta = 1;
118  static Size const phi = 2;
119 
120  /// No default constructor or assignment operator
121  /// copy c-tor is fine
122  MinimalRotamer();
123  MinimalRotamer const & operator = ( MinimalRotamer const & );
124 };
125 
126 /// @brief Interface class used to break a pose down into a set of component "groups"
127 /// where intra-group rotamer-pair energies are preserved between calls to the
128 /// GreenPacker. E.g. in rigid-body docking between two proteins, chains 1 and 2 define
129 /// groups 1 and 2. In rigid-body docking between two domains of the same chain, those
130 /// residues upstream of jump 1 define group 1, and those downstream of jump 1 define group 2.
131 /// In loop modelling, the static background is group 1, and the loop itself is group 0, since
132 /// loop residues will have their bb dofs change regularly between repackings.
134 {
135 public:
137  typedef core::Size Size;
138 
139 public:
140  virtual ~GroupDiscriminator();
141 
142  virtual
144 
145  virtual
146  Size
147  group_id( Pose const & pose, Size seqpos ) const = 0;
148 
149 };
150 
152 {
153 public:
155  typedef core::Size Size;
156 
157 public:
159 
160  virtual
162 
163  virtual
164  Size
165  group_id( Pose const & pose, Size seqpos ) const;
166 
167  void
168  set_group_ids( utility::vector1<Size > const & group_ids_input );
169 
170 private:
171 
173 
174 };
175 
177 {
178 
179 public:
180  virtual ~ChainGroupDiscriminator();
181 
182  virtual
184 
185  virtual
186  Size
187  group_id( Pose const & pose, Size seqpos ) const;
188 };
189 
191 {
192 public:
193  /// Types
209  typedef core::Size Size;
210  typedef core::Real Real;
212 
213 public:
214  GreenPacker();
215  virtual ~GreenPacker();
216 
217  virtual
218  void
219  apply( Pose & );
220  virtual std::string get_name() const;
221 
222  // Undefined, commentin out to make PyRosetta compile
223  // void reset();
224 
225  void
226  set_scorefunction( ScoreFunction const & );
227 
228  void
230 
231  void
233 
234  void
236 
237 private:
238  /// Private methods
239  void
241  ScoreFunction & sfxn,
242  ScoreTypes const & scoretypes,
243  EnergyMap const & weights
244  ) const;
245 
246 
247  void setup_reference_data( Pose & );
248  void repack( Pose & pose );
249 
250  void split_pose_into_groups( Pose & pose );
251  void create_reference_packer_task( Pose & pose );
253  void create_reference_rotamers( Pose & pose );
255 
256  void create_fresh_task( Pose & pose );
258  void create_fresh_rotamers( Pose & pose );
261  void compute_energies( Pose & pose );
262  void run_sa( Pose & pose );
263  void cleanup();
264 
267 
268  void
270  Pose & pose,
272  Size lower_res,
273  Size upper_res
274  );
275 
276  void
278  Pose & pose,
279  LongRangeTwoBodyEnergy const & lre,
281  Size lower_res,
282  Size upper_res
283  );
284 
285  void drop_inter_group_edges( Pose & pose, GraphOP packer_neighbor_graph ) const;
286  void drop_intra_group_edges( Pose & pose, GraphOP packer_neighbor_graph ) const;
287 
288  void store_reference_pose_geometry( Pose & pose );
290 
291 
292 private:
296 
297  //@brief true at construction, or after a call to reset, before a call to apply.
299 
302  std::vector< utility::vector1< Size > > group_members_; // index by zero to represent group 0
303 
306 
307  ////////////////////////////////////////////
308  /// Data captured from the reference apply()
309 
310  /// @brief task used in construction of the reference data
313 
314  /// @brief rotamer sets created by the reference task
318 
319  /// @brief the stored intra-group RPEs from the context independent components of the
320  /// score function
322 
323  /// @brief the internal geometry of the rotamers created in the first round
325 
326  /// @brief the internal geometry of the backbone used in the first round
328 
329  /// @brief for debugging; a set of coordinates of each residue for backbone atom #1 (N in proteins, Phos for NA's)
330  /// so that if the backbone DOFs do change, and the structure of the input pose cannot be superimposed
331  /// back onto the original coordinates, then a debug runtime_assert statementmet will get caught.
333 
334  //////////////////////////////////////////////////////////////////////////////////////////////
335  /// Data for the "current" packing -- valid between the beginning and end of a call to "apply"
336 
340 
341  /// @brief the internal geometry of the rotamers created in the first round
343 
347 
348  /// correspondence between current rotamer set and original rotamer set.
353 
354 
355 };
356 
357 } // namespace moves
358 } // namespace protocols
359 
360 #endif // INCLUDED_protocols_simple_moves_GreenPacker_HH