Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Bridge.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/Bridge.hh
11 /// @brief connect two contiguous but disjoint sections of a Pose into one
12 /// continuous section
13 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
14 
15 #ifndef INCLUDED_protocols_forge_build_Bridge_hh
16 #define INCLUDED_protocols_forge_build_Bridge_hh
17 
18 // unit headers
20 
21 // package headers
23 
24 #include <utility/vector1.hh>
25 
26 
27 
28 namespace protocols {
29 namespace forge {
30 namespace build {
31 
32 
33 /// @brief connect two contiguous but disjoint sections of a Pose into one
34 /// continuous section
35 /// @details Anchor residues [i,j] to bridge must be adjacent to each other in the
36 /// Pose (i+1 = j) and adjacent to a cutpoint. Both i and j will be idealized
37 /// and marked as new moveable positions since the psi @ i and the phi @ j are
38 /// undefined. Depending on the fold tree, this will cause a random swing
39 /// either downstream or upstream of the bridge!
40 class Bridge : public BuildInstruction {
41 
42 
43 private: // typedefs
44 
45 
47 
48 
49 public: // typedefs
50 
51 
52  typedef Super::Size Size;
53  typedef Super::Real Real;
54 
58  typedef Super::Pose Pose;
59 
62 
63 
64 public: // construct/destruct
65 
66 
67  /// @brief default constructor
68  Bridge();
69 
70 
71  /// @brief sec.struct only constructor (poly-alanine for new region)
72  /// @param[in] interval build bridge using these two residues as anchor positions
73  /// @param[in] ss the secondary structure desired, also defines length of new bridge,
74  /// region between the anchor positions, can be empty
75  /// @param[in] rts the residue type set to use, default FA_STANDARD
76  /// @remarks length of the *one-letter* aa must equal the length of ss
77  Bridge(
78  Interval const & i,
79  String const & ss,
81  );
82 
83 
84  /// @brief full constructor
85  /// @param[in] interval build bridge using these two residues as anchor positions
86  /// @param[in] ss the secondary structure desired, also defines length of new bridge,
87  /// region between the anchor positions, can be empty
88  /// @param[in] aa the annotated amino acid sequence desired, default is poly-alanine
89  /// @param[in] rts the residue type set to use, default FA_STANDARD
90  /// @remarks length of the *one-letter* aa must equal the length of ss
91  Bridge(
92  Interval const & i,
93  String const & ss,
94  String const & aa,
96  );
97 
98 
99  /// @brief copy constructor
100  Bridge( Bridge const & rval );
101 
102 
103  /// @brief default destructor
104  virtual
105  ~Bridge();
106 
107 
108 public: // assignment
109 
110 
111  /// @brief copy assignment
112  Bridge & operator =( Bridge const & rval );
113 
114 
115 public: // virtual constructors
116 
117 
118  /// @brief clone this object
119  virtual
120  BuildInstructionOP clone() const;
121 
122 
123 public: // virtual accessors
124 
125 
126  /// @brief is the original interval storing valid information, or is empty
127  /// or being used for something else?
128  /// @return true, stores valid interval
129  inline
130  virtual
131  bool original_interval_valid() const {
132  return true;
133  }
134 
135 
136  /// @brief a copy of the working range of residues specifying the bridged region
137  /// including the anchors
138  /// @details This residue range can change wrt length changes in Pose /Conformation
139  /// being watched.
140  inline
141  virtual
142  Interval interval() const {
143  return interval_;
144  }
145 
146 
147  /// @brief return a copy of the set of positions within the new region
148  /// that were pre-existing in the original Pose prior to modify()
149  /// @return A set containing two positions -- interval.left and interval.right.
150  virtual
152 
153 
154  /// @brief return a copy of the set of positions that are "new" and did
155  /// not exist in the original Pose.
156  /// @return A set containing positions spanning [interval.left+1, interval.right-1].
157  virtual
158  Positions new_positions() const;
159 
160 
161  /// @brief return a copy of the set of positions within the newly modified
162  /// region that has a defined conformation. E.g. existing or copied residues.
163  /// @return A set containing two positions -- interval.left and interval.right.
164  /// @details This set can change wrt length changes in Pose/Conformation being
165  /// watched.
166  virtual
168 
169 
170  /// @brief return a copy of the set of positions within the newly modified
171  /// region that has an undefined conformation. E.g. newly created residues.
172  /// @return A set containing positions spanning [interval.left+1, interval.right-1].
173  /// @details This set can change wrt length changes in Pose/Conformation being
174  /// watched.
175  virtual
177 
178 
179  /// @brief return a copy of the MoveMap that defines the moveable/fixed
180  /// positions/dofs for this instruction
181  /// @return a MoveMap with [interval.left, interval.right] bb & chi set to true
182  /// at the MoveMapTorsionID level
183  /// @details This set can change wrt length changes in Pose/Conformation being
184  /// watched.
185  virtual
186  MoveMap movemap() const;
187 
188 
189 public: // virtual Conformation observer interface
190 
191 
192  /// @brief update indexing on residue append
193  virtual
194  void on_residue_append( LengthEvent const & event );
195 
196 
197  /// @brief update indexing on residue prepend
198  virtual
199  void on_residue_prepend( LengthEvent const & event );
200 
201 
202  /// @brief update indexing on residue delete
203  virtual
204  void on_residue_delete( LengthEvent const & event );
205 
206 
207 public: // original positions
208 
209 
210  /// @brief return the set of positions within the original interval that
211  /// will be kept in this BuildInstruction
212  /// @return A set containing the endpoints of the original interval.
213  virtual
215 
216 
217  /// @brief return set of positions within the original interval that will
218  /// be deleted in this BuildInstruction
219  /// @return A set containing the positions in [original.left+1, original.right-1].
220  virtual
222 
223 
224 public: // instruction comparison
225 
226 
227  /// @brief return set of any fixed positions necessary with respect to the original
228  /// interval and original Pose numbering
229  /// @remarks Used for ensuring build regions for instructions do not overlap and
230  /// so that jumps may be placed correctly.
231  /// @return empty set if no fixed positions necessary
232  virtual
234 
235 
236  /// @brief return set of any mutable positions necessary with respect to the original
237  /// interval and original Pose numbering
238  /// @remarks Used for ensuring build regions for instructions do not overlap and
239  /// so that jumps may be placed correctly.
240  virtual
242 
243 
244 public: // virtual object descriptor
245 
246 
247  /// @brief does this object create undefined backbone in the modified region?
248  inline
249  virtual
251  return true;
252  }
253 
254 
255 protected: // virtual Pose modification methods
256 
257 
258  /// @brief are dependencies satisfied so that modify_impl() can complete
259  /// successfully?
260  /// @return always True, this BuildInstruction has no dependencies
261  inline
262  virtual
263  bool dependencies_satisfied() const {
264  return true;
265  }
266 
267 
268  /// @brief do the actual work of modifying the Pose
269  virtual
270  void modify_impl( Pose & pose );
271 
272 
273 protected: // virtual mutators
274 
275 
276  /// @brief do the actual reset of intervals, positions, etc to initial state
277  virtual
278  void reset_accounting_impl();
279 
280 
281 private: // data
282 
283 
284  /// @brief the anchor positions of the bridge
285  /// @remarks this can shift if listening to a Pose/Conformation and the number
286  /// of residues changes
288 
289 
290  /// @brief secondary structure string, also defines length of the bridge
292 
293 
294  /// @brief annotated amino acid string, length of the one-letter version
295  /// must be equal to length of ss
297 
298 
299 };
300 
301 
302 } // namespace build
303 } // namespace forge
304 } // namespace protocols
305 
306 
307 #endif /* INCLUDED_protocols_forge_build_Bridge_HH */