Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GraftMoverBase.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/grafting/GraftMoverBase.hh
11 /// @brief Base class for graftmovers
12 /// @author Jared Adolf-Bryfogle
13 
14 #ifndef INCLUDED_protocols_grafting_GraftMoverBase_HH
15 #define INCLUDED_protocols_grafting_GraftMoverBase_HH
16 
17 // Unit header
19 #include <protocols/moves/Mover.hh>
20 
21 
22 // Project headers
24 #include <protocols/loops/Loop.hh>
25 #include <core/pose/Pose.hh>
26 
27 
28 
29 namespace protocols {
30 namespace grafting {
31  using namespace core;
32  using namespace core::pose;
36 
37 ///@brief Base class for GraftMovers. Created for simplicity and control for C++ programmer, as well as PyRosetta user.
38 ///
39 /// Feel free to add.
40 ///
42 
43 public:
44  ///@brief Start and end are the residue numbers you want your insert to go between. start->Insert<-end
45  GraftMoverBase(Size const start, Size const end, std::string mover_name);
46 
47  virtual ~GraftMoverBase();
48 
49  //@brief copy ctor
50  //GraftMoverBase( GraftMoverBase const & rhs);
51 
52  ///@brief Sets the piece that will be inserted, and any overhang residues.
53  ///@details Overhang will be deleted upon insertion. They are used for the base class function superimpose_overhangs. Useful if using Double loop methods which keep the insertion frozen in cartesian space.
54  virtual void
55  set_piece(Pose & piece, Size Nter_overhang, Size Cter_overhang);
56 
57  ///@brief Set the region if changed since construction.
58  virtual void
59  set_insert_region(Size const start, Size const end);
60 
61  virtual void
62  set_cen_scorefunction(core::scoring::ScoreFunctionOP score);
63 
64  virtual void
65  set_fa_scorefunction(core::scoring::ScoreFunctionOP score);
66 
67  ///@brief Grabs the scorefunction from command line options.
68  virtual void
69  set_default_fa_scorefunction();
70 
71  ///@brief Grabs the cen scorefunction set in command line loops option group.
72  virtual void
73  set_default_cen_scorefunction();
74 
75  ///@brief uses rms_util to superimpose piece onto pose. Not run during apply for added control to user.
76  void
77  superimpose_overhangs_heavy(Pose const & pose, bool ca_only, bool silence_rms);
78 
79  /// @brief Return the name of the Mover.
80  virtual std::string
81  get_name() const;
82 
83 
84 
85 
86 
87 
88 protected:
89 
90  /// @brief Steven Lewis' insertion method from insert_pose_into_pose. Wrapper to his function, using variables defined in this baseclass.
91  /// @details Need to set piece to use. Deletes any overhang in piece. Deletes any region from start to end in pose. Updates end_.
92  /// Recommended use is within apply method.
93  ///
94  Pose
95  insert_piece(Pose const & pose);
96 
97  /// @brief Uses a small mover at high KT to perturb residues in the movemap for testing.
98  virtual core::Real
99  perturb_backbone_for_test(Pose & pose, MoveMapOP mm);
100 
101  ///@brief combines the two main movemaps to use after the insertion.
102  ///@details Pose piece must be set.
103  MoveMapOP
104  combine_movemaps(MoveMap const & scaffold_mm, MoveMap const & insert_mm);
105 
106  /// @brief deletes overhang residues of the pose piece set.
107  /// Recommended use is within apply method
108  void
109  delete_overhang_residues();
110 
111  ///@brief Set overhang residues
112  void
113  set_overhang(Size Nter_overhang, Size Cter_overhang);
114 
115  //Reference of the pose piece. Should be changed to local copy, but I'm not sure how to do that.
117 
118  ///@brief Residue insertion will start from
120  ///@brief Residue insertion will end before here. Updates after insertion.
122  ///@brief some functions need to only work on the original numbers. (combine movemaps)
124 
128  ///@brief Number of overhang residues on N terminus. Updates on delete_overhang_residues
130  ///@brief Number of overhang residues on C terminus. Updates on delete_overhang_residues
132 
133 protected:
134  //////////////////////////////////////////////////////////////////////////////////////////////////////
135  ///MOVEMAP and REGION SETUP
136  ///Note: Only these functions interact with class variables defined here. To be used optionally in apply.
137  //////////////////////////////////////////////////////////////////////////////////////////////////////
138 
139  ///@brief sets up either the default movemap or a new combined movemap at apply time. Updates regions as needed.
140  virtual void
141  setup_movemap_and_regions(Pose & pose);
142 
143  ///@brief Sets up the default movemap
144  virtual void
145  set_default_movemap();
146 
147  ///@brief Sets up the regions at apply using insert variables and flexibility.
148  virtual void
149  set_regions_from_flexibility();
150 
151  ///@brief Sets up region variables from the class movemap for the combined pose.
152  virtual void
153  set_regions_from_movemap(Pose & pose);
154 
158 
159  bool use_default_movemap_; //Instructs setup_movemap_and_regions what to do.
162  Size Nter_loop_start_;//First flexible residue
164 
168  Size Cter_loop_end_; //Last flexible residue
169 
170 protected:
171  /////////////////////////////////////////////////////////////////////////////////////////////////
172  ///FOLDTREE SETUP. options depending on how you want your graft algorithm to work!
173  ///---Indicates Flexible regions, | indicates cutpoint. Arrows are direction of ARMs used to close the loop in conjunction with algorithm. (CCD, KIC)
174  ///
175  /////////////////////////////////////////////////////////////////////////////////////////////////
176 
177 
178  /////////////////////////////////////////////////////////////////
179  /// @brief ****Nter_loop_start---->Piece----> | Cter_loop_end****
180  /// Insert will move in cartesian space
181  /// @params lower_cutpoint for CCD and loops is Cter_loop_end-1
182  ///
183  virtual void
184  setup_single_loop_single_arm_remodeling_foldtree(Pose & pose, Size const Nter_loop_start, Size const Cter_loop_end, bool loop_modeling=false);
185 
186  //////////////////////////////////////////////////////////////////
187  /// @brief ****Nter_loop_start---->Piece | <----Nter_loop_end****
188  /// Insert will move in cartesian space
189  /// @params lower_cutpoint for CCD and loops is end_-1
190  ///
191  virtual void
192  setup_single_loop_double_arm_remodeling_foldtree(Pose & pose, Size const Nter_loop_start, Size const Cter_loop_end, bool loop_modeling=false);
193 
194  /////////////////////////////////////////////////////////////////////
195  /// ****Nter_loop_start-----> | Piece | <----Nter_loop_end****
196  /// or
197  /// ****Nter_loop_start----> | <---- Piece -----> | <------ Cter_loop_end****
198  /// Insert is fixed
199  /// Two loops. Cutpoint vs loop def determines if one arm or two arms on each side.
200  ///Use FoldTreeFromLoopsWrapper
201 
202 
203 
204 
205 }; // class GraftMoverBase
206 
207 } // namespace grafting
208 } // namespace protocols
209 
210 #endif // INCLUDED_protocols_grafting_GraftMoverBase_HH