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/RotamerSet/RotamerSet.hh
11 /// @brief Residue Set 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
22 
25 
26 // Project Headers
27 #include <core/types.hh>
28 
31 #include <core/graph/Graph.fwd.hh>
32 #include <core/pose/Pose.fwd.hh>
35 // AUTO-REMOVED #include <core/scoring/hbonds/HBondSet.fwd.hh>
36 // AUTO-REMOVED #include <core/scoring/trie/RotamerTrieBase.fwd.hh>
37 
38 #ifdef WIN32 //VC++ needs full class declaration
40 #include <core/conformation/Residue.hh> // WIN32 INCLUDE
41 #endif
42 
43 //#include <basic/datacache/BasicDataCache.hh>
44 
45 // ObjexxFCL Headers
46 // AUTO-REMOVED #include <ObjexxFCL/FArray2.fwd.hh>
47 
48 // Utility headers
49 #include <utility/pointer/ReferenceCount.hh>
50 #include <utility/vector1.fwd.hh>
51 
52 #include <utility/vector1.hh>
53 
54 
55 namespace core {
56 namespace pack {
57 namespace rotamer_set {
58 
59 
61 {
62 
63 private: // typedefs
65 
66 public:
67  RotamerSet();
68  virtual ~RotamerSet();
69 
70  void set_resid( Size resid );
71 
72  virtual
73  void build_rotamers(
74  pose::Pose const & the_pose,
75  scoring::ScoreFunction const & scorefxn,
76  task::PackerTask const & task,
77  graph::GraphCOP packer_neighbor_graph,
78  bool use_neighbor_context = true
79  ) = 0;
80 
81  virtual
83  RotamerSets const & rotamer_sets,
84  pose::Pose const & pose,
85  scoring::ScoreFunction const & scorefxn,
86  task::PackerTask const & task,
87  graph::GraphCOP packer_neighbor_graph
88  ) = 0;
89 
90  virtual
91  void
94  ) = 0;
95 
96  /// @brief Return the number of different residue types; two residue types are considered
97  /// different if they have a different address.
98  virtual
99  Size
100  get_n_residue_types() const = 0;
101 
102  /// @brief Return the number of different residue groups. Two residue types are considered
103  /// to be part of the same block of residues if 1. they have the same address or 2. they have
104  /// the same "name3" and the same neighbor radius.
105  virtual
106  Size
107  get_n_residue_groups() const = 0;
108 
109  /// @brief Return the first rotamer of a particular residue type
110  virtual
111  Size
112  get_residue_type_begin( Size which_restype ) const = 0;
113 
114  /// @brief Return the first rotamer that belongs to a particular rotamer group
115  virtual
116  Size
117  get_residue_group_begin( Size which_resgroup ) const = 0;
118 
119  virtual
120  Size
121  get_n_rotamers_for_residue_type( Size which_restype ) const = 0;
122 
123  virtual
124  Size
125  get_n_rotamers_for_residue_group( Size which_resgroup ) const = 0;
126 
127  /// @brief Rotamers i to i+j of all the same residue type are grouped together.
128  /// This function returns the index of the residue type in a contiguous block
129  /// of rotamers. E.g. rotamers 100 to 120 might all be lysine rotamers, and might
130  /// be the 8th residue type, with the first 7 residue types spanning rotamers 1 to 99.
131  /// If new lysine rotamers are appended to the end of the rotamer set, they are
132  /// considered to be in a separate residue type block. Lysine rotamers 200 to 210 might
133  /// be block 15 while lysine rotamers 100 to 120 are still block 7.
134  virtual
135  Size
136  get_residue_type_index_for_rotamer( Size which_rotamer ) const = 0;
137 
138  /// @brief Return the index of the rotamer group for a particular rotamer.
139  virtual
140  Size
141  get_residue_group_index_for_rotamer( Size which_rotamer ) const = 0;
142 
143  virtual
144  void
146  pose::Pose const & pose,
147  scoring::ScoreFunction const & scorefxn,
148  task::PackerTask const & task,
149  graph::GraphCOP packer_neighbor_graph,
150  utility::vector1< core::PackerEnergy > & energies ) const = 0;
151 
152  /// for OptE
153  virtual
154  void
156  pose::Pose const & pose,
157  scoring::ScoreFunction const & scorefxn,
158  task::PackerTask const & task,
159  graph::GraphCOP packer_neighbor_graph,
160  utility::vector1< scoring::EnergyMap > & energies ) const = 0;
161 
162  virtual
163  Size
164  num_rotamers() const = 0;
165 
166  virtual
167  Size
168  id_for_current_rotamer() const = 0;
169 
170  virtual
171  Size resid() const { return resid_;}
172 
173  virtual
175  rotamer( Size rot_id ) const = 0;
176 
177  // iterate over rotamers directly
178  virtual Rotamers::const_iterator begin() const = 0;
179  virtual Rotamers::const_iterator end() const = 0;
180 
181  /// @brief mutatable access to a single rotamer in the set.
182  virtual
184  nonconst_rotamer( Size rot_id ) = 0;
185 
186  virtual
187  void
188  store_trie( Size method_enum_id, conformation::AbstractRotamerTrieOP trie ) = 0;
189 
190  virtual
192  get_trie( Size method_enum_id ) const = 0;
193 
194  /// @brief removes a single rotamer and causes a rotamer index update
195  virtual
196  void
197  drop_rotamer( Size rot_id ) = 0;
198 
199  /// @brief rotamers_to_delete must be of size nrotmaers -- each position
200  /// in the array that's "true" is removed from the set of rotamers
201  virtual
202  void
203  drop_rotamers( utility::vector1< bool > const & rotamers_to_delete ) = 0;
204 
205  /// @brief deletes the rotamers in the list with the given indices.
206  /// The indices of these rotamers is presumed to be those before any delete operation.
207  /// e.g. if there are four rotamers, and rotamer_indices_to_delete includes 1 & 3,
208  /// then the rotamers that will remain are the rotamers originally indexed as 2 and 4,
209  /// even though their new indices will be 1 & 2.
210  virtual
211  void
212  drop_rotamers_by_index( utility::vector1< Size > const & rotamer_indices_to_delete ) = 0;
213 
214 private:
215  // deny use of the copy constructor (no pass-by-value)
216  RotamerSet( RotamerSet const & );
217 
218  Size resid_; //which residue is this?
219 
220  /// @brief BasicDataCache indexed by enum in core/pack/rotamer_set/RotamerSetCacheableDataType.hh
221  /// @warning DataCache must always be initialized with the number of cacheable
222  /// data types -- see the last enum entry.
223  //BasicDataCache data_cache_;
224 
225 };
226 
227 
228 } // namespace rotamer_set
229 } // namespace pack
230 } // namespace core
231 
232 
233 #endif // INCLUDED_core_pack_RotamerSet_RotamerSet_HH