Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BDR.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/components/BDR.hh
11 /// @brief
12 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
13 
14 #ifndef INCLUDED_protocols_forge_components_BDR_hh
15 #define INCLUDED_protocols_forge_components_BDR_hh
16 
17 // unit headers
19 
20 // type headers
21 #include <core/types.hh>
22 
23 // package headers
26 // AUTO-REMOVED #include <protocols/forge/build/Interval.hh>
28 
29 // project headers
31 #include <core/pose/Pose.fwd.hh>
33 #include <protocols/moves/Mover.hh>
34 
35 // utility headers
36 // AUTO-REMOVED #include <utility/vector1.hh>
37 
38 // C++ headers
39 #include <string>
40 
41 #include <utility/vector1.hh>
42 
43 
44 
45 namespace protocols {
46 namespace forge {
47 namespace components {
48 
49 
50 class BDR : public protocols::moves::Mover {
51 
52 
53 private: // typedefs
54 
55 
57 
58 
59 public: // typedefs
60 
61 
63 
64  typedef core::Real Real;
65  typedef core::Size Size;
70 
76 
77  /// @brief A pair storing a instruction's original interval and a string
78  /// denoting the sequence during design.
79  /// @remarks This is only for instructions such as SegmentRebuild or
80  /// SegmentInsert. Non-applicable instructions will not have any data
81  /// stored here.
82  typedef std::pair< Interval, String > OriginalInterval2DesignString;
84 
85 
86 public: // construct/destruct
87 
88 
89  /// @brief default constructor
90  BDR();
91 
92 
93  /// @brief copy constructor
94  BDR( BDR const & rval );
95 
96 
97  /// @brief default destructor
98  virtual
99  ~BDR();
100 
101 
102 private: // disallow assignment
103 
104 
105  /// @brief copy assignment
106  /// @remarks Mover base class prevents this from working properly...
107  BDR & operator =( BDR const & rval );
108 
109 
110 public: // virtual constructors
111 
112 
113  /// @brief clone this object
114  virtual
115  MoverOP clone() const;
116 
117 
118  /// @brief create this type of object
119  virtual
120  MoverOP fresh_instance() const;
121 
122 
123 public: // accessors
124 
125 
126  /// @brief use full-mer fragments when building the loop? (default false)
127  inline
128  bool use_fullmer() const {
129  return use_fullmer_;
130  }
131 
132 
133  /// @brief use sequence biased fragments when building the loop? (default false)
134  inline
135  bool use_sequence_bias() const {
136  return use_sequence_bias_;
137  }
138 
139 
140  /// @brief the maximum allowed linear chainbreak (default 0.07)
141  inline
143  return max_linear_chainbreak_;
144  }
145 
146 
147  /// @brief the loop mover string to use during centroid build
148  /// (default "RemodelLoopMover")
149  /// @remarks set to either a string the create_loop_mover() LoopMoverFactory
150  /// recognizes or the "RemodelLoopMover"
151  inline
152  String const & centroid_loop_mover_str() const {
154  }
155 
156 
157  /// @brief redesign the neighborhood around the loop? if false, then just
158  /// repacks during the design phase (default true)
159  inline
162  }
163 
164 
165  /// @brief name of the resfile to use during design-refine; empty string
166  /// implies no resfile
167  inline
168  String const & resfile() const {
169  return resfile_;
170  }
171 
172 
173  /// @brief the number of design-refine cycles to perform, default 3
174  inline
175  Size dr_cycles() const {
176  return dr_cycles_;
177  }
178 
179 
180  /// @brief the centroid level score function, default "remodel_cen"
181  ScoreFunction const & centroid_scorefunction() const;
182 
183 
184  /// @brief the full-atom level score function, default score12
185  ScoreFunction const & fullatom_scorefunction() const;
186 
187 
188 public: // mutators
189 
190 
191  /// @brief add instruction to the manager of this BDR (no copy)
192  /// @param[in] bi BuildInstruction
193  /// @param[in] aa_during_design_refine The allowed amino acid sequence
194  /// during design. Only applicable to BuildInstructions like
195  /// SegmentRebuild and SegmentInsert. Make sure the length of this
196  /// string matches up properly, and remember to use any special characters,
197  /// e.g. the insertion character for SegmentInsert
198  void add_instruction(
200  String const & aa_during_design_refine = String()
201  );
202 
203 
204  /// @brief create directed dependency between two instructions
208  );
209 
210 
211  /// @brief use full-mer fragments when building the loop?
212  inline
213  void use_fullmer( bool const flag ) {
214  use_fullmer_ = flag;
215  }
216 
217 
218  /// @brief use sequence biased fragments when building the loop? (default false)
219  inline
220  void use_sequence_bias( bool const flag ) {
221  use_sequence_bias_ = flag;
222  }
223 
224 
225  /// @brief the maximum allowed linear chainbreak
226  inline
227  void max_linear_chainbreak( Real const threshold ) {
228  max_linear_chainbreak_ = threshold;
229  }
230 
231 
232  /// @brief the loop mover string to use during centroid build
233  /// @remarks set to either a string the create_loop_mover() LoopMoverFactory
234  /// recognizes or the "RemodelLoopMover"
235  inline
236  void centroid_loop_mover_str( String const & loop_mover_str ) {
237  centroid_loop_mover_str_ = loop_mover_str;
238  }
239 
240 
241  /// @brief redesign the neighborhood around the loop? if false, then just
242  /// repacks during the design phase
243  inline
244  void redesign_loop_neighborhood( bool const flag ) {
246  }
247 
248 
249  /// @brief name of the resfile to use during design-refine; empty string
250  /// implies no resfile
251  inline
252  void resfile( String const & filename ) {
253  resfile_ = filename;
254  }
255 
256  /// @brief set the number of design-refine cycles to perform
257  /// @remarks set this to 0 to skip design-refine
258  inline
259  void dr_cycles( Size const cycles ) {
260  dr_cycles_ = cycles;
261  }
262 
263 
264  /// @brief set the centroid level score function
265  void centroid_scorefunction( ScoreFunction const & sfx );
266 
267 
268  /// @brief set the centroid level score function
270 
271 
272  /// @brief set the full-atom level score function
273  void fullatom_scorefunction( ScoreFunction const & sfx );
274 
275 
276  /// @brief set the full-atom level score function
278 
279 
280 public: // calculators
281 
282 
283  /// @brief the name for the loops' neighborhood calculator
284  inline
285  static
287  return "BDR_loops_neighborhood_calc";
288  }
289 
290 
291  /// @brief the name for the loops' buried unsatisfied polars
292  /// calculator
293  inline
294  static
296  return "BDR_loops_bup";
297  }
298 
299 
300  /// @brief the name for the loops' neighborhood buried unsatisfied polars
301  /// calculator
302  inline
303  static
305  return "BDR_loops_neighborhood_bup";
306  }
307 
308 
309 public: // virtual main methods
310 
311 
312  /// @brief apply defined moves to given Pose
313  virtual
314  void apply( Pose & pose );
315 
316  virtual std::string get_name() const;
317 
318 private: // protocol methods
319 
320 
321  /// @brief run the centroid level build stage
322  /// @return true if loop closed, false otherwise
323  bool centroid_build(
324  Pose & pose
325  );
326 
327 
328  /// @brief run the design-refine stage
329  /// @return currently always true
330  bool design_refine(
331  Pose & pose
332  );
333 
334 
335  /// @brief return a TaskFactory useable as a starting point for either
336  /// design or refinement
338 
339 
340 private: // design methods
341 
342 
343  /// @brief process a continuous design string, adding appropriate operations
344  /// to the TaskFactory
346  Interval const & original_interval,
347  String const & design_str,
348  Original2Modified const & original2modified_interval_endpoints,
349  TaskFactoryOP design_tf
350  );
351 
352 
353  /// @brief process a design string containing an insert, adding appropriate
354  /// operations to the TaskFactory
356  Interval const & original_interval,
357  String const & design_str,
358  Original2Modified const & original2modified_interval_endpoints,
359  TaskFactoryOP design_tf
360  );
361 
362 
363  /// @brief return a boolean vector specifying allowed a.a. when designing
364  /// on the surface
365  static
367 
368 
369 private: // data
370 
371 
372  /// @brief the BuildManager
374 
375 
376  /// @brief Stores instructions' original interval and a string denoting
377  /// the sequence during design.
378  /// @remarks This is only for instructions such as SegmentRebuild or
379  /// SegmentInsert. Non-applicable instructions will not have any data
380  /// stored here.
382 
383 
384  /// @brief use full-mer fragments when building the loop? (default false)
386 
387 
388  /// @brief use sequence biased fragments when building the loop? (default false)
390 
391 
392  /// @brief the maximum allowed linear chainbreak (default 0.07)
394 
395 
396  /// @brief the loop mover string to use during centroid build
397  /// (default "RemodelLoopMover")
398  /// @remarks set to either a string the create_loop_mover() LoopMoverFactory
399  /// recognizes or the "RemodelLoopMover"
401 
402 
403  /// @brief redesign the neighborhood around the loop? if false, then just
404  /// repacks during the design phase (default true)
406 
407 
408  /// @brief name of the resfile to use during design-refine; empty string
409  /// implies no resfile
411 
412 
413  /// @brief the number of design-refine cycles to perform, default 3
415 
416 
417  /// @brief the centroid scorefunction to use, default "remodel_cen"
419 
420 
421  /// @brief the full-atom scorefunction to use, default score12
423 
424 
425 private: // per-stage movers
426 
427 
428  /// @brief VLB for centroid_build
429  /// @remarks Store it here instead of re-instantiation each centroid_build()
430  /// call so fragment caching works.
431  /// @warning Remember to set this to null if the BuildManager changes.
433 
434 
435 };
436 
437 
438 } // namespace components
439 } // namespace forge
440 } // namespace protocols
441 
442 
443 #endif /* INCLUDED_protocols_forge_components_BDR_HH */