Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AnchoredGraftMover.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/AnchoredGraftMover.hh
11 /// @brief Class to graft a piece into a pose.
12 /// @Author Jared Adolf-Bryfogle (jadolfbr@gmail.com)
13 /// @author Original algorithm - Steven Lewis (smlewi@gmail.com)
14 
15 #ifndef INCLUDED_protocols_grafting_AnchoredGraftMover_HH
16 #define INCLUDED_protocols_grafting_AnchoredGraftMover_HH
17 
18 
19 //Unit Headers
22 #include <protocols/moves/Mover.hh>
23 //Core
24 #include <core/pose/Pose.hh>
27 
28 
29 
30 
31 namespace protocols {
32 namespace grafting {
33  using namespace core::pose;
34 
35 ///@brief Grafting class adapted from Steven Lewis' pose_into_pose algorithm. Basic, and quick, but with many options.
36 ///
37 /// example:
38 /// mover = AnchoredGraftMover(start, end)
39 /// mover.set_piece(piece, cter_overhang, nter_overhang)
40 /// mover.apply(pose)
41 ///
42 /// see also: grafting/util.hh.
43 ///
44 ///@details Uses a single loop and a single arm to close the loop by default.
45 /// ****Nter_loop_start---->Piece----> | Cter_loop_end****
46 /// Default movemap keeps insert Frozen in dihedral angle space, But think of the insert as part of a giant arm.
47 /// Default flexibility on Nter and Cter is only two residues (--> part of diagram).
48 /// Will delete any residues between start and end, and any overhang residues from the insert.
49 ///
50 /// Algorithm originally from pose_into_pose:
51 /// The insert will be left unchanged in internal-coordinate space except for the phi on the first residue, and the psi/omega on the last residue, and atoms whose bonding partners change as a result of the insertion.
52 /// Internally, apply performs the insertion, idealizes the loop residues (omegas to 180, peptide bonds idealized) and the newly made polymer connections at the insert point, and then attempts to close the loop(s).
53 /// It is intended, but not guaranteed, to produce a loop with good rama, omega, and chainbreak/peptide_bond scores. It does NOT attempt to give a loop with good sidechains (it does not repack at all) or worry overmuch about van der Waals
54 ///
56 public:
57 
58  ///@brief Start and end are the residue numbers you want your insert to go between. start->Insert<-end
59  AnchoredGraftMover(Size const start, Size const end);
60 
61  virtual ~AnchoredGraftMover();
62 
63  void
64  set_defaults();
65 
66  ///@brief Sets scaffold flexiblity on either end of scaffold
67  void
68  set_scaffold_flexibility(Size const Nter_scaffold_flexibility, Size const Cter_scaffold_flexibility);
69 
70  ///@brief Sets insert flexibility on either end of insert
71  void
72  set_insert_flexibility(Size const Nter_insert_flexibility, Size const Cter_insert_flexibility);
73 
74  /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
75  ///@brief Advanced way to set options. Use if you know what you are doing.
76  ///@details Will combine the movemaps for apply, and renumber everything. Flexible residues in multiple chains not recommended.
77  /// single_loop_single_arm (Default) From the first bb flexible residue to the last will act as one loop. This can be amazing as you can use loop regions in various parts of your protein to help the insertion.
78  /// single_loop_double_arm: One arm will be from first flexible N terminal residue to end_; Second arm will be from there to last flexible residue
79  /// double_loop_double_arm: One arm Will go from first flexible N terminal residue to after start_+any contiguous residues on in the movemap from there. Opposite for Cter side.
80  /// double_loop_quad_arm: same as double, but cutpoints will be at each new peptide bond.
81  ///
82  /// Note: Will disregard flexibility settings, as the movemaps will be used as primary way to define flexibility.
83  void
84  set_movemaps(MoveMapOP const scaffold_mm, MoveMapOP const insert_mm);
85 
86  ///@brief Instructs the class to ignore any movemaps from set_movemaps.
87  void
88  set_use_default_movemap_from_flexibility(bool def);
89 
90  void
91  set_cycles(Size cycles);
92 
93  ///@brief override of base class
94  void
95  set_default_cen_scorefunction();
96 
97  ///@brif override of base class
98  void
99  set_cen_scorefunction(core::scoring::ScoreFunctionOP scorefxn_);
100 
101  ///@brief Sets the mintype for the MinMover
102  void
103  set_mintype(std::string mintype);
104 
105  ///@brief Sets the mover to skip the small mover sampling step.
106  void
107  set_skip_sampling(bool skip_sampling);
108 
109  ///@brief sets up the smooth centroid scorefunction + any changes to VDW. if false, switches back to default scorefunction.
110  void
111  set_use_smooth_centroid_settings(bool use_smooth);
112 
113  ///@brief Uses a single loop, two arm loop closer.
114  ///@details ****Nter_loop_start---->Piece | <----Nter_loop_end****
115  void
116  set_use_single_loop_double_CCD_arms(bool single_loop_double_arm);
117 
118  ///@brief Keeps the insert frozen in cartesian space. Sets the algorithm to use two loops on either side in order to close the graft. (Please superimpose piece onto scaffold first)
119  ///@details ****Nter_loop_start-----> | Piece | <----Nter_loop_end****
120  void
121  set_use_double_loop_double_CCD_arms(bool double_loop_double_arm);
122 
123  ///@brief Keeps the insert frozen in cartesian space. Sets the algorithm to use two loops on either side in order to close the graft. (Please superimpose piece onto scaffold first)
124  ///@details ****Nter_loop_start----> | <---- Piece -----> | <------ Cter_loop_end**** Use only if you have continuous flexibility in your insert from start and or end.
125  void
126  set_use_double_loop_quad_CCD_arms(bool double_loop_quad_arm);
127 
128  ///@returns the Cterminal loop end (Last flexible residue). Useful to use after insertion.
129  Size
130  get_Cter_loop_end();
131 
132  ///@brief TESTING ONLY Sets the protocol to 'randomize' the flexible residues before trying to graft. This is used to test the protocol by grafting a piece of a protein back onto itself and looking at RMSD.
133  void
134  set_test_control_mode(bool test_control_mode);
135 
136  ///@brief Grafts the piece into the pose, uses CCD to close the connection. Insert does not change dihedral space, but DOES change cartesian space by default.
137  ///Pose is returned without repacking any sidechains. Use repack_connection after apply method.
138  ///Deletes overhang and region between start and end if residues are present.
139  virtual void
140  apply(Pose & pose);
141 
142 public:
143 
144  ///@brief convenience function for AFTER apply method.
145  ///@details flexible Nter and Cter residues plus the first and last residue of the insert.
146  /// If passing movemaps, will respect those movemaps.
147  virtual void
148  repack_connection_and_residues_in_movemap(Pose & pose, core::scoring::ScoreFunctionOP fa_scorefxn);
149 
150  ///@brief convenience function for AFTER apply method.
151  ///@details flexible Nter and Cter residues plus the entire insert.
152  /// If passing movemaps, will respect those movemaps.
153  virtual void
154  repack_connection_and_residues_in_movemap_and_piece(Pose & pose, core::scoring::ScoreFunctionOP fa_scorefxn);
155 
156 private:
157 
159 
161  bool skip_sampling_;//Option to skip the small mover sampling step.
162  bool single_loop_double_arm_; //Option to use two CCD arms to close the loop.
163  bool double_loop_double_arm_;//Option to freeze the insert in cartesian space. Uses two arms, one on either side of insert to do the graft.
165  bool test_control_mode_;//TESTING ONLY Set to randomize the flexible residues before trying to graft.
166 
167 }; //Class AnchoredGraftMover
168 
169 
170 }// namespace grafting
171 }// namespace protocols
172 
173 #endif // INCLUDED_protocols_grafting_AnchoredGraftMover_HH