Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RemodelMover.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/remodel/RemodelMover.hh
11 /// @brief
12 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
13 
14 #ifndef INCLUDED_protocols_forge_remodel_RemodelMover_hh
15 #define INCLUDED_protocols_forge_remodel_RemodelMover_hh
16 
17 // unit headers
23 
24 // type headers
25 #include <core/types.hh>
26 
27 // package headers
31 
32 // project headers
34 #include <core/pose/Pose.fwd.hh>
36 #include <protocols/moves/Mover.hh>
37 
38 #include <basic/datacache/DataMap.fwd.hh> //parser
39 
40 // utility headers
41 #include <utility/vector1.hh>
42 
43 // C++ headers
44 #include <string>
45 
46 
47 namespace protocols {
48 namespace forge {
49 namespace remodel {
50 
51 
53 
54 
55 private: // typedefs
56 
57 
59 
60 
61 public: // typedefs
62 
63 
65 
66  typedef core::Real Real;
67  typedef core::Size Size;
72 
82 
83  /// @brief A pair storing a instruction's original interval and a string
84  /// denoting the sequence during design.
85  /// @remarks This is only for instructions such as SegmentRebuild or
86  /// SegmentInsert. Non-applicable instructions will not have any data
87  /// stored here.
88  typedef std::pair< Interval, String > OriginalInterval2DesignString;
89  typedef utility::vector1< OriginalInterval2DesignString > DesignInfo;
90 
91  //parser fabio
94  typedef basic::datacache::DataMap DataMap;
96 
97 public: // construct/destruct
98 
99 
100  /// @brief default constructor
101  RemodelMover();
102 
103 
104  /// @brief copy constructor
105  RemodelMover( RemodelMover const & rval );
106 
107 
108  /// @brief default destructor
109  virtual
110  ~RemodelMover();
111 
112 
113 private: // disallow assignment
114 
115 
116  /// @brief copy assignment
117  /// @remarks Mover base class prevents this from working properly...
118  RemodelMover & operator =( RemodelMover const & rval );
119 
120 
121 public: // virtual constructors
122 
123  /// @brief clone this object, for parser
124  virtual
125  MoverOP clone() const;
126 
127 
128  /// @brief create this type of object, for parser
129  virtual
130  MoverOP fresh_instance() const;
131 
132 
133  /// @brief clone this object
134  virtual
135  MoverOP clone();
136 
137 
138  /// @brief create this type of object
139  virtual
141 
142 
143 public: // accessors
144 
145  /*
146  /// @brief use full-mer fragments when building the loop? (default false)
147  inline
148  bool use_fullmer() const {
149  return use_fullmer_;
150  }
151 
152 
153  /// @brief use sequence biased fragments when building the loop? (default false)
154  inline
155  bool use_sequence_bias() const {
156  return use_sequence_bias_;
157  }
158 
159 
160  /// @brief the maximum allowed linear chainbreak (default 0.07)
161  inline
162  Real max_linear_chainbreak() const {
163  return max_linear_chainbreak_;
164  }
165 
166 
167  /// @brief the loop mover string to use during centroid build
168  /// (default "RemodelLoopMover")
169  /// @remarks set to either a string the create_loop_mover() LoopMoverFactory
170  /// recognizes or the "RemodelLoopMover"
171  inline
172  String const & centroid_loop_mover_str() const {
173  return centroid_loop_mover_str_;
174  }
175 
176 
177  /// @brief redesign the neighborhood around the loop? if false, then just
178  /// repacks during the design phase (default true)
179  inline
180  bool redesign_loop_neighborhood() const {
181  return redesign_loop_neighborhood_;
182  }
183 
184 
185  /// @brief name of the resfile to use during design-refine; empty string
186  /// implies no resfile
187  inline
188  String const & resfile() const {
189  return resfile_;
190  }
191 
192 
193  /// @brief the number of design-refine cycles to perform, default 3
194  inline
195  Size dr_cycles() const {
196  return dr_cycles_;
197  }
198  */
199 
200  /// @brief the centroid level score function, default "remodel_cen"
201  ScoreFunction const & centroid_scorefunction() const;
202 
203 
204  /// @brief the full-atom level score function
205  ScoreFunction const & fullatom_scorefunction() const;
206 
207 
208 public: // mutators
209 
210 
211  /// @brief add instruction to the manager of this RemodelMover (no copy)
212  /// @param[in] bi BuildInstruction
213  /// @param[in] aa_during_design_refine The allowed amino acid sequence
214  /// during design. Only applicable to BuildInstructions like
215  /// SegmentRebuild and SegmentInsert. Make sure the length of this
216  /// string matches up properly, and remember to use any special characters,
217  /// e.g. the insertion character for SegmentInsert
218  /*
219  void add_instruction(
220  BuildInstructionOP bi,
221  String const & aa_during_design_refine = String()
222  );
223 
224 
225  /// @brief create directed dependency between two instructions
226  void create_directed_dependency(
227  BuildInstructionOP u,
228  BuildInstructionOP v
229  );
230  */
231  /*
232  /// @brief use full-mer fragments when building the loop?
233  inline
234  void use_fullmer( bool const flag ) {
235  use_fullmer_ = flag;
236  }
237 
238 
239  /// @brief use sequence biased fragments when building the loop? (default false)
240  inline
241  void use_sequence_bias( bool const flag ) {
242  use_sequence_bias_ = flag;
243  }
244  */
245 
246  /// @brief the maximum allowed linear chainbreak
247  inline
248  void max_linear_chainbreak( Real const threshold ) {
249  max_linear_chainbreak_ = threshold;
250  }
251 
252 
253  /// @brief the loop mover string to use during centroid build
254  /// @remarks set to either a string the create_loop_mover() LoopMoverFactory
255  /// recognizes or the "RemodelLoopMover"
256  inline
257  void centroid_loop_mover_str( String const & loop_mover_str ) {
258  centroid_loop_mover_str_ = loop_mover_str;
259  }
260 
261 
262  /// @brief redesign the neighborhood around the loop? if false, then just
263  /// repacks during the design phase
264  inline
265  void redesign_loop_neighborhood( bool const flag ) {
267  }
268 
269  /*
270  /// @brief name of the resfile to use during design-refine; empty string
271  /// implies no resfile
272  inline
273  void resfile( String const & filename ) {
274  resfile_ = filename;
275  }
276  */
277  /// @brief set the number of design-refine cycles to perform
278  /// @remarks set this to 0 to skip design-refine
279  inline
280  void dr_cycles( Size const cycles ) {
281  dr_cycles_ = cycles;
282  }
283 
284 
285  /// @brief set the centroid level score function
286  void centroid_scorefunction( ScoreFunction const & sfx );
287 
288 
289  /// @brief set the centroid level score function
290  void centroid_scorefunction( ScoreFunctionOP const & sfx );
291 
292 
293  /// @brief set the full-atom level score function
294  void fullatom_scorefunction( ScoreFunction const & sfx );
295 
296 
297  /// @brief set the full-atom level score function
298  void fullatom_scorefunction( ScoreFunctionOP const & sfx );
299 
300 
301 public: // calculators
302 
303 
304  /// @brief the name for the loops' neighborhood calculator
305  inline
306  static
308  return "RemodelMover_loops_neighborhood_calc";
309  }
310 
311 
312  /// @brief the name for the loops' buried unsatisfied polars
313  /// calculator
314  inline
315  static
317  return "RemodelMover_loops_bup";
318  }
319 
320 
321  /// @brief the name for the loops' neighborhood buried unsatisfied polars
322  /// calculator
323  inline
324  static
326  return "RemodelMover_loops_neighborhood_bup";
327  }
328 
329 
330 public: // virtual main methods
331 
332 
333  /// @brief apply defined moves to given Pose
334  virtual
335  void apply( Pose & pose );
336 
337  virtual std::string get_name() const;
338 
339  bool confirm_sequence(core::pose::Pose & pose );
340 
341 
342 private: // protocol methods
343  bool SamePose(Pose const & pose1, Pose const & pose2);
344 
345  void register_user_options();
346 
347  bool centroid_build(
348  Pose & pose,
350  );
351 
352 
353  /// @brief run the centroid level build stage
354  /// @return true if loop closed, false otherwise
355  bool centroid_build(
356  Pose & pose
357  );
358 
360  Pose & pose,
361  RemodelDesignMover & designMover
362  );
363 
365  Pose & pose,
366  RemodelDesignMover & designMover
367  );
368 
369 
370  /// @brief run the design-refine stage
371  /// @return currently always true
372  bool design_refine(
373  Pose & pose,
374  RemodelDesignMover & designMover
375  );
376 
377 
378  /// @brief return a TaskFactory useable as a starting point for either
379  /// design or refinement
381 
382 
383 private: // design methods
384 
385 
386  /// @brief process a continuous design string, adding appropriate operations
387  /// to the TaskFactory
389  Interval const & original_interval,
390  String const & design_str,
391  Original2Modified const & original2modified_interval_endpoints,
392  TaskFactoryOP design_tf
393  );
394 
395 
396  /// @brief process a design string containing an insert, adding appropriate
397  /// operations to the TaskFactory
399  Interval const & original_interval,
400  String const & design_str,
401  Original2Modified const & original2modified_interval_endpoints,
402  TaskFactoryOP design_tf
403  );
404 
405 
406  /// @brief return a boolean vector specifying allowed a.a. when designing
407  /// on the surface
408  static
409  utility::vector1< bool > const & allowed_surface_aa();
410 
411 
412 private: // data
413 
414 
415  /// @brief the BuildManager
416  // try to get this from Remodel OB
418 
420 
421  /// @brief holds all the blueprint info, contains build manager
423 
424  /// @brief working set holds all the modified index that is required for the
425  /// remodeling task
427 
428 
429  /// @brief Stores instructions' original interval and a string denoting
430  /// the sequence during design.
431  /// @remarks This is only for instructions such as SegmentRebuild or
432  /// SegmentInsert. Non-applicable instructions will not have any data
433  /// stored here.
435 
436 
437  /// @brief use sequence biased fragments when building the loop? (default false)
438  ///bool use_sequence_bias_;
439 
440 
441  /// @brief the maximum allowed linear chainbreak (default 0.07)
443 
444 
445  /// @brief the loop mover string to use during centroid build
446  /// (default "RemodelLoopMover")
447  /// @remarks set to either a string the create_loop_mover() LoopMoverFactory
448  /// recognizes or the "RemodelLoopMover"
450 
451 
452  /// @brief redesign the neighborhood around the loop? if false, then just
453  /// repacks during the design phase (default true)
455 
456 
457  /// @brief name of the resfile to use during design-refine; empty string
458  /// implies no resfile
459  ///String resfile_;
460 
461 
462  /// @brief the number of design-refine cycles to perform, default 3
464 
465 
466  /// @brief the centroid scorefunction to use, default "remodel_cen"
468 
469 
470  /// @brief the full-atom scorefunction to use
472 
473 
474  //blueprint
476 
477 
478  //For parsing rosetta scripts input
490  //for saving results from multiple runs
492 
498 
499 
504  bool nojumps_;
506  bool use_bp_seq_; // use blueprint sequence for fragment picking
507  bool randomize_equiv_frag_; // randomize identical scoring fragments, otherwise will get the same top 'n' fragments each time
511  bool backrub_;
512  bool help_;
516  bool no_frags_;
522  bool dsspSS_;
532 
533  /// @brief use full-mer fragments when building the loop? (default false)
535 
536  // added by Nobu
537  bool silent_;
540 
544  };
545 
546 private: // per-stage movers
547 
548 
549  /// @brief VLB for centroid_build
550  /// @remarks Store it here instead of re-instantiation each centroid_build()
551  /// call so fragment caching works.
552  /// @warning Remember to set this to null if the BuildManager changes.
554 
555 
556 public: // parser
557 
558  virtual void parse_my_tag( TagCOP tag, basic::datacache::DataMap & data, Filters_map const &, Movers_map const &, Pose const & );
559 
560 private:
561 
562  void set_param_from_options();
563 
564 };
565 
566 
567 } // namespace components
568 } // namespace forge
569 } // namespace protocols
570 
571 
572 #endif /* INCLUDED_protocols_forge_components_RemodelMover_HH */
utility::pointer::shared_ptr< ScoreFunction > ScoreFunctionOP
protocols::forge::remodel::RemodelWorkingSet RemodelWorkingSet
Definition: RemodelMover.hh:81
bool design_refine(Pose &pose, RemodelDesignMover &designMover)
run the design-refine stage
void redesign_loop_neighborhood(bool const flag)
redesign the neighborhood around the loop? if false, then just repacks during the design phase ...
static String neighborhood_buns_polar_calc_name()
the name for the loops' neighborhood buried unsatisfied polars calculator
protocols::forge::components::VarLengthBuildOP VarLengthBuildOP
Definition: RemodelMover.hh:78
This object defines a ScoreFunction, it contains methods for calculating the various scoring componen...
Pose forward declarations header.
DesignInfo design_info_
Stores instructions' original interval and a string denoting the sequence during design.
forge::remodel::RemodelAccumulator accumulator_
A molecular system including residues, kinematics, and energies.
Definition: Pose.hh:153
void dr_cycles(Size const cycles)
set the number of design-refine cycles to perform
bool design_refine_seq_relax(Pose &pose, RemodelDesignMover &designMover)
Sets up constraints and a modified scorefunction and run design/relax cycles. Checks the value of -re...
static String neighborhood_calc_name()
the name for the loops' neighborhood calculator
virtual MoverOP fresh_instance() const
create this type of object, for parser
utility::vector1< OriginalInterval2DesignString > DesignInfo
Definition: RemodelMover.hh:89
a container for managing BuildInstructions
protocols::forge::build::BuildInstructionOP BuildInstructionOP
Definition: RemodelMover.hh:73
protocols::filters::Filters_map Filters_map
Definition: RemodelMover.hh:93
core::scoring::ScoreFunctionOP ScoreFunctionOP
Definition: RemodelMover.hh:71
std::string String
Definition: HelixPairing.cc:43
a container for managing BuildInstructions
Definition: BuildManager.hh:52
VarLengthBuildOP vlb_
VLB for centroid_build.
RemodelWorkingSet working_model_
working set holds all the modified index that is required for the remodeling task ...
ScoreFunction const & fullatom_scorefunction() const
the full-atom level score function
ScoreFunctionOP centroid_sfx_
the centroid scorefunction to use, default "remodel_cen"
utility::pointer::shared_ptr< BuildInstruction > BuildInstructionOP
owning pointer for BuildInstruction
Size dr_cycles_
name of the resfile to use during design-refine; empty string implies no resfile String resfile_; ...
void process_insert_design_string(Interval const &original_interval, String const &design_str, Original2Modified const &original2modified_interval_endpoints, TaskFactoryOP design_tf)
process a design string containing an insert, adding appropriate operations to the TaskFactory ...
bool SamePose(Pose const &pose1, Pose const &pose2)
Apply method for Mover. Checks the values of the following options -remodel::checkpoint -remodel::dom...
std::map< std::string const, FilterOP > Filters_map
Definition: Filter.fwd.hh:44
void centroid_loop_mover_str(String const &loop_mover_str)
the loop mover string to use during centroid build
RemodelData remodel_data_
holds all the blueprint info, contains build manager
RemodelMover & operator=(RemodelMover const &rval)
copy assignment
platform::Size Size
Definition: types.hh:30
static String loops_buns_polar_calc_name()
the name for the loops' buried unsatisfied polars calculator
protocols::moves::Movers_map Movers_map
Definition: RemodelMover.hh:95
core::scoring::ScoreFunction ScoreFunction
Definition: RemodelMover.hh:70
basic::datacache::DataMap DataMap
Definition: RemodelMover.hh:94
ScoreFunction const & centroid_scorefunction() const
the centroid level score function, default "remodel_cen"
utility::pointer::shared_ptr< VarLengthBuild > VarLengthBuildOP
owning pointer for VarLengthBuild
std::map< Size, Size > Original2Modified
Definition: BuildManager.hh:79
void max_linear_chainbreak(Real const threshold)
add instruction to the manager of this RemodelMover (no copy)
rosetta project type declarations
Component that performs a protocol for user-specified variable length remodeling of protein backbone ...
protocols::forge::build::BuildManager::Original2Modified Original2Modified
Definition: RemodelMover.hh:75
virtual void parse_my_tag(TagCOP tag, basic::datacache::DataMap &data, Filters_map const &, Movers_map const &, Pose const &)
parse xml
forward declaration for protocols::forge::components::VarLengthBuild
protocols::moves::MoverOP MoverOP
Definition: RemodelMover.hh:77
String centroid_loop_mover_str_
the loop mover string to use during centroid build (default "RemodelLoopMover")
virtual MoverOP clone() const
clone this object, for parser
: A mover is an object that can apply a conformational change to a pose.
utility::tag::TagCOP TagCOP
Definition: BasicFilters.cc:54
protocols::forge::components::VarLengthBuild VarLengthBuild
Definition: RemodelMover.hh:79
core::scoring::ScoreFunction forward declarations
BuildManager manager_
the BuildManager
utility::pointer::shared_ptr< Pose > PoseOP
Definition: Pose.fwd.hh:25
bool redesign_loop_neighborhood_
redesign the neighborhood around the loop? if false, then just repacks during the design phase (defau...
bool design_refine_cart_relax(Pose &pose, RemodelDesignMover &designMover)
bool confirm_sequence(core::pose::Pose &pose)
As best as I can tell, does some loop closure and calculates RMSD to native. Returns true...
platform::Real Real
Definition: types.hh:35
virtual std::string get_name() const
get_name function for JobDistributor
utility::pointer::shared_ptr< Mover > MoverOP
Definition: Mover.fwd.hh:29
protocols::forge::build::Interval Interval
Definition: RemodelMover.hh:76
void process_continuous_design_string(Interval const &original_interval, String const &design_str, Original2Modified const &original2modified_interval_endpoints, TaskFactoryOP design_tf)
process a continuous design string, adding appropriate operations to the TaskFactory ...
utility::pointer::shared_ptr< TaskFactory > TaskFactoryOP
void register_user_options()
Checks for presence of any score term weight override options and calls set_weight on the centroid sc...
TaskFactoryOP generic_taskfactory()
return a TaskFactory useable as a starting point for either design or refinement
ScoreFunctionOP fullatom_sfx_
the full-atom scorefunction to use
protocols::forge::build::BuildManager BuildManager
Definition: RemodelMover.hh:74
bool use_fullmer_
use full-mer fragments when building the loop? (default false)
core::pack::task::TaskFactoryOP TaskFactoryOP
Definition: RemodelMover.hh:68
simple struct defining a closed interval of residues [left, right] where left <= right ...
Definition: Interval.hh:33
protocols::forge::remodel::RemodelData RemodelData
Definition: RemodelMover.hh:80
bool centroid_build(Pose &pose, protocols::forge::build::BuildManager &manager)
Does the same as function below, but takes in a BuildManager object. Also checks the value of the opt...
std::map< std::string const, MoverOP > Movers_map
Definition: Mover.fwd.hh:35
forward declaration for BuildInstruction
std::pair< Interval, String > OriginalInterval2DesignString
A pair storing a instruction's original interval and a string denoting the sequence during design...
Definition: RemodelMover.hh:88
virtual void apply(Pose &pose)
apply defined moves to given Pose
Real max_linear_chainbreak_
use sequence biased fragments when building the loop? (default false) bool use_sequence_bias_; ...
static utility::vector1< bool > const & allowed_surface_aa()
return a boolean vector specifying allowed a.a. when designing on the surface
virtual ~RemodelMover()
default destructor