Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GrowRight.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/forge/build/GrowRight.hh
11 /// @brief instruction to create a c-side extension
12 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
13 
14 #ifndef INCLUDED_protocols_forge_build_GrowRight_hh
15 #define INCLUDED_protocols_forge_build_GrowRight_hh
16 
17 // unit headers
19 
20 // package headers
22 
23 // project headers
24 // AUTO-REMOVED #include <core/conformation/Conformation.fwd.hh>
26 #include <core/pose/Pose.fwd.hh>
27 
28 // C++ headers
29 #include <string>
30 
31 #include <utility/vector1.hh>
32 
33 
34 
35 namespace protocols {
36 namespace forge {
37 namespace build {
38 
39 
40 /// @brief instruction to create a c-side extension
41 /// @remarks Use this for c-side insertions but typically not c-terminal
42 /// extensions unless necessary. It does not automatically cover the
43 /// additional residue on the left endpoint that needs to move during
44 /// c-terminal extensions due to invalid psi torsion. For that case,
45 /// use the SegmentRebuild class replacing the c-terminal residue with
46 /// desired length+1.
47 class GrowRight : public BuildInstruction {
48 
49 
50 private: // typedefs
51 
52 
54 
55 
56 public: // typedefs
57 
58 
59  typedef Super::Size Size;
60 
64  typedef Super::Pose Pose;
65 
68 
69 
70 public: // construct/destruct
71 
72 
73  /// @brief default constructor
74  GrowRight();
75 
76 
77  /// @brief constructor
78  /// @param[in] pos grow a c-side extension after this position
79  /// @param[in] ss the secondary structure desired, also defines length of extension
80  /// @param[in] aa the annotated amino acid sequence desired, default is poly-alanine
81  /// @param[in] rts the residue type set to use, default FA_STANDARD
82  /// @remarks length of the *one-letter* aa must equal the length of ss
83  GrowRight(
84  Size const pos,
85  String const & ss,
86  String const & aa = String(),
88  );
89 
90 
91  /// @brief copy constructor
92  GrowRight( GrowRight const & rval );
93 
94 
95  /// @brief default destructor
96  virtual
97  ~GrowRight();
98 
99 
100 public: // assignment
101 
102 
103  /// @brief copy assignment
104  GrowRight & operator =( GrowRight const & rval );
105 
106 
107 public: // virtual constructors
108 
109 
110  /// @brief clone this object
111  virtual
112  BuildInstructionOP clone() const;
113 
114 
115 public: // accessors
116 
117 
118  /// @brief grow right from this anchor position
119  /// @remarks This can change if listening to Conformation LengthEvents.
120  /// Use original_interval() to get the original anchor position.
121  inline
122  Size pos() const {
123  return pos_;
124  }
125 
126 
127  /// @brief get secondary structure string
128  inline
129  String const & ss() const {
130  return ss_;
131  }
132 
133 
134  /// @brief get annotated amino acid string
135  inline
136  String const & aa() const {
137  return aa_;
138  }
139 
140 
141 public: // virtual accessors
142 
143 
144  /// @brief is the original interval storing valid information, or is empty
145  /// or being used for something else?
146  /// @return false, stores invalid interval
147  inline
148  virtual
149  bool original_interval_valid() const {
150  return false;
151  }
152 
153 
154  /// @brief a copy of the working range of residues specifying the modified region
155  /// @remarks This can change if listening to Conformation LengthEvents
156  inline
157  virtual
158  Interval interval() const {
159  return Interval( pos_ + 1, pos_ + ss_.length() );
160  }
161 
162 
163  /// @brief return a copy of the set of positions within the new region
164  /// that were pre-existing in the original Pose prior to modify()
165  /// @return An empty set -- no positions are pre-existing.
166  virtual
168 
169 
170  /// @brief return a copy of the set of positions that are "new" and did
171  /// not exist in the original Pose.
172  /// @return A set of positions spanning the entire region -- all positions
173  /// are new.
174  virtual
175  Positions new_positions() const;
176 
177 
178  /// @brief return a copy of the set of positions within the newly modified
179  /// region that has a defined conformation. E.g. existing or copied residues.
180  /// @return An empty set -- no positions are defined.
181  /// @details This set can change wrt length changes in Pose/Conformation being
182  /// watched.
183  virtual
185 
186 
187  /// @brief return a copy of the set of positions within the newly modified
188  /// region that has an undefined conformation. E.g. newly created residues.
189  /// @return A set of positions spanning the entire region -- all positions
190  /// are undefined.
191  /// @details This set can change wrt length changes in Pose/Conformation being
192  /// watched.
193  virtual
195 
196 
197  /// @brief return a copy of the MoveMap that defines the moveable/fixed
198  /// positions/dofs for this instruction
199  /// @return a MoveMap with [interval.left, interval.right] bb & chi set to true
200  /// at the MoveMapTorsionID level
201  /// @details This set can change wrt length changes in Pose/Conformation being
202  /// watched.
203  virtual
204  MoveMap movemap() const ;
205 
206 
207 public: // virtual Conformation observer interface
208 
209 
210  /// @brief update indexing on residue append
211  virtual
212  void on_residue_append( LengthEvent const & event );
213 
214 
215  /// @brief update indexing on residue prepend
216  virtual
217  void on_residue_prepend( LengthEvent const & event );
218 
219 
220  /// @brief update indexing on residue delete
221  virtual
222  void on_residue_delete( LengthEvent const & event );
223 
224 
225 public: // original positions
226 
227 
228  /// @brief return the set of positions within the original interval that
229  /// will be kept in this BuildInstruction
230  /// @return An empty set -- no positions are kept.
231  virtual
233 
234 
235  /// @brief return set of positions within the original interval that will
236  /// be deleted in this BuildInstruction
237  /// @return An empty set -- no positions are deleted.
238  virtual
240 
241 
242 public: // instruction comparison
243 
244 
245  /// @brief return set of any fixed positions necessary with respect to the original
246  /// interval and original Pose numbering
247  /// @remarks Used for ensuring build regions for instructions do not overlap and
248  /// so that jumps may be placed correctly.
249  /// @return empty set if no fixed positions
250  virtual
252 
253 
254  /// @brief return set of any mutable positions necessary with respect to the original
255  /// interval and original Pose numbering
256  /// @remarks Used for ensuring build regions for instructions do not overlap and
257  /// so that jumps may be placed correctly.
258  /// @return empty set if no mutable positions
259  virtual
261 
262 
263 public: // virtual object descriptor
264 
265 
266  /// @brief does this object create undefined backbone in the modified region?
267  /// @return true
268  inline
269  virtual
271  return true;
272  }
273 
274 
275 protected: // virtual Pose modification methods
276 
277 
278  /// @brief are dependencies satisfied so that modify_impl() can complete
279  /// successfully?
280  /// @return always True, this BuildInstruction has no dependencies
281  inline
282  virtual
283  bool dependencies_satisfied() const {
284  return true;
285  }
286 
287 
288  /// @brief do the actual work of modifying the Pose
289  virtual
290  void modify_impl( Pose & pose );
291 
292 
293 protected: // virtual mutators
294 
295 
296  /// @brief do the actual reset of intervals, positions, etc to initial state
297  virtual
298  void reset_accounting_impl();
299 
300 
301 private: // data
302 
303 
304  /// @brief make a c-side extension after this position
305  /// @remarks this position can shift if listening to a Pose/Conformation and the number
306  /// of residues changes
308 
309 
310  /// @brief secondary structure string, also defines length of extension
312 
313 
314  /// @brief annotated amino acid string, length of the one-letter version
315  /// must be equal to length of ss
317 
318 
319 };
320 
321 
322 } // namespace build
323 } // namespace forge
324 } // namespace protocols
325 
326 
327 #endif /* INCLUDED_protocols_forge_build_GrowRight_HH */