Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RotamerSet_.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 core/pack/rotamer_set/RotamerSet_.hh
11 /// @brief rotamer set implementation class
12 /// @author Andrew Leaver-Fay (leaverfa@email.unc.edu)
13 
14 
15 #ifndef INCLUDED_core_pack_rotamer_set_RotamerSet__hh
16 #define INCLUDED_core_pack_rotamer_set_RotamerSet__hh
17 
18 //Unit headers
20 
21 //Package headers
25 
26 
27 //Project headers
31 #ifdef WIN32
33 #endif
34 
36 
37 // Utility headers
38 #include <utility/pointer/owning_ptr.hh>
39 // AUTO-REMOVED #include <utility/vector1.hh>
40 
42 #include <utility/vector1.hh>
43 
44 
45 namespace core {
46 namespace pack {
47 namespace rotamer_set {
48 
49 /// @brief Container for a set of rotamers for use in packing.
50 /// Rotamers are sorted into groups of the same residue type.
51 /// Offsets into these rotamer groups are maintained by this class, as is
52 /// information concerning the "original rotamer" -- the rotamer
53 /// present on the input pose before packing began.
54 class RotamerSet_ : public RotamerSet
55 {
56 public:
61 
62 public:
63  RotamerSet_();
64  virtual ~RotamerSet_();
65 
66  virtual
67  void build_rotamers(
68  pose::Pose const & the_pose,
69  scoring::ScoreFunction const & scorefxn,
70  task::PackerTask const & task,
71  graph::GraphCOP packer_neighbor_graph,
72  bool use_neighbor_context = true
73  );
74 
75 
76  /// @brief Build rotamers that depend on positions of rotamers built in a previous pass
77  virtual
79  RotamerSets const & rotamer_sets,
80  pose::Pose const & pose,
81  scoring::ScoreFunction const & scorefxn,
82  task::PackerTask const & task,
83  graph::GraphCOP packer_neighbor_graph
84  );
85 
86 
87  virtual
88  void
91  );
92 
93  virtual
94  Size
95  get_n_residue_types() const;
96 
97  virtual
98  Size
99  get_n_residue_groups() const;
100 
101  virtual
102  Size
103  get_residue_type_begin( Size which_restype ) const;
104 
105  virtual
106  Size
107  get_residue_group_begin( Size which_resgroup ) const;
108 
109  virtual
110  Size
111  get_n_rotamers_for_residue_type( Size which_resgroup ) const;
112 
113  virtual
114  Size
115  get_n_rotamers_for_residue_group( Size which_resgroup ) const;
116 
117  virtual
118  Size
119  get_residue_type_index_for_rotamer( Size which_rotamer ) const ;
120 
121  virtual
122  Size
123  get_residue_group_index_for_rotamer( Size which_rotamer ) const ;
124 
125 
126  /// @brief Computes the packers "one body energies" for the set of rotamers.
127  virtual
128  void
130  pose::Pose const & pose,
131  scoring::ScoreFunction const & scorefxn,
132  task::PackerTask const & task,
133  graph::GraphCOP packer_neighbor_graph,
134  utility::vector1< core::PackerEnergy > & energies ) const;
135 
136 
137  /// for OPTE
138  virtual
139  void
141  pose::Pose const & pose,
142  scoring::ScoreFunction const & scorefxn,
143  task::PackerTask const & task,
144  graph::GraphCOP packer_neighbor_graph,
145  utility::vector1< scoring::EnergyMap > & energies ) const;
146 
147  /*
148  virtual
149  void
150  compute_two_body_energies(
151  RotamerSet const & other,
152  pose::Pose const & pose,
153  scoring::ScoreFunction const & scorefxn,
154  ObjexxFCL::FArray2< Energy > & pair_energy_table ) const;
155  */
156 
157  virtual
158  Size
159  num_rotamers() const;
160 
161  virtual
162  Size
163  id_for_current_rotamer() const;
164 
165  virtual
167  rotamer( Size rot_id ) const;
168 
169  virtual Rotamers::const_iterator begin() const { return rotamers_.begin(); }
170  virtual Rotamers::const_iterator end() const { return rotamers_.end(); }
171 
172  virtual
174  nonconst_rotamer( Size rot_id );
175 
176  virtual
177  void
178  store_trie( Size method_enum_id, conformation::AbstractRotamerTrieOP trie );
179 
180  virtual
182  get_trie( Size method_enum_id ) const;
183 
184  /// @brief removes a single rotamer and causes a rotamer index update
185  virtual
186  void
187  drop_rotamer( Size rot_id );
188 
189  /// @brief rotamers_to_delete must be of size nrotmaers -- each position
190  /// in the array that's "true" is removed from the set of rotamers
191  virtual
192  void
193  drop_rotamers( utility::vector1< bool > const & rotamers_to_delete );
194 
195  /// @brief deletes the rotamers in the list with the given indices.
196  /// The indices of these rotamers is presumed to be those before any delete operation.
197  /// e.g. if there are four rotamers, and rotamer_indices_to_delete includes 1 & 3,
198  /// then the rotamers that will remain are the rotamers originally indexed as 2 and 4,
199  /// even though their new indices will be 1 & 2.
200  virtual
201  void
202  drop_rotamers_by_index( utility::vector1< Size > const & rotamer_indices_to_delete );
203 
204 private:
205  RotamerSet_( RotamerSet_ const & );
206 
207 
208 protected:
209  /// @brief Creates a set of rotamers for a particular residue type
210  /// (the concrete residue type) while relying on the rotamer-
211  /// building instructions within the PackerTask.
212  /// Use the residue in the input pose at position resid_ as the existing residue.
213  virtual
215  pose::Pose const & pose,
216  scoring::ScoreFunction const & scorefxn,
217  task::PackerTask const & task,
218  chemical::ResidueTypeCOP concrete_residue,
219  graph::GraphCOP packer_neighbor_graph,
220  bool use_neighbor_context = true
221  );
222 
223  /// @brief Creates a set of rotamers for a particular residue type
224  /// (the concrete residue type) while relying on the rotamer-
225  /// building instructions within the PackerTask.
227  pose::Pose const & pose,
228  scoring::ScoreFunction const & scorefxn,
229  task::PackerTask const & task,
230  chemical::ResidueTypeCOP concrete_residue,
231  conformation::Residue const & existing_residue,
232  graph::GraphCOP packer_neighbor_graph,
233  bool use_neighbor_context = true
234  );
235 
236 
237  /// @brief Build rotamers of a specific type that depend on positions of rotamers built in a previous pass
238  /// Use an input "existing residue" which may or may not reflect the coordinates of the residue at
239  /// pose.residue( resid_ );
240  void
242  RotamerSets const & rotamer_sets,
243  pose::Pose const & pose,
244  scoring::ScoreFunction const &, // scorefxn,
245  task::PackerTask const & task,
246  conformation::Residue const & existing_residue,
247  chemical::ResidueTypeCOP concrete_residue,
248  graph::GraphCOP packer_neighbor_graph
249  );
250 
251 
252  /// @brief Creates a sets of rotamers for an "optimize H" repacking
253  void
255  pose::Pose const & pose,
256  task::PackerTask const & task,
257  chemical::ResidueTypeCOP concrete_residue,
258  conformation::Residue const & existing_residue
259  );
260 
261 public:
262  /// @brief Pushes standard-deviation multiples that should be sampled
263  /// for this residue -- if this residue has more neighbors within 10A
264  /// than the task-specified cutoff for buriedness, then extra rotamer
265  /// samples are added to the extra_chi_steps vector, otherwise, the
266  /// vector is not modified.
267  void set_extra_samples(
268  task::PackerTask const & task,
269  int num_10A_neighbors,
270  int chi,
271  chemical::ResidueTypeCOP concrete_residue,
272  utility::vector1< Real > & extra_chi_steps
273  ) const;
274 
275 public:
276  /// @brief Computes the "bump energy" of a rotamer: the bump energy is the
277  /// sum of rotamer's interactions with 1) the backbone-and-side chains of
278  /// neighboring residues that are held fixed during this repacking optimization
279  /// and 2) the backbones of neighboring residues that are changable during this
280  /// repacking optimization.
281  virtual
283  bump_check(
285  scoring::ScoreFunction const & sf,
286  pose::Pose const & pose,
287  task::PackerTask const & task,
288  graph::GraphCOP packer_neighbor_graph
289  ) const;
290 
291 private:
292 
293  /// @brief declare that a new block of residue types has begun, and that new residues
294  /// are about to be pushed back.
295  void
297 
298  /// @brief should two residue types be considered the same residue type?
299  bool
301 
302  /// @brief should two residue types be considered to belong to the same residue-type group?
303  bool
305 
306  /// @brief This function should not be called directly -- it ought to be called only from prepare_for_new_residue_type
307  void
309 
310  /// @brief This function should not be called directly -- it ought to be called only from prepare_for_new_residue_type
311  void
313 
314  /// @brief appends a rotamer to the list of rotamers, and increments the count
315  /// for the number of rotamers for the current value of n_residue_types.
316  void
318 
319  void
320  update_rotamer_offsets() const;
321 
322 // DATA
323 private:
324 
327 
334 
337 
339 
341 
344 };
345 
346 } // namespace rotamer_set
347 } // namespace pack
348 } // namespace core
349 
350 
351 #endif // INCLUDED_core_pack_RotamerSet_RotamerSet__HH
352