Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ConstrainToIdealMover.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/simple_moves/ConstrainToIdealMover.hh
11 /// @brief Adds to your pose constraints suitable for idealization of bond lengths and angles
12 /// @author Steven Lewis (smlewi@gmail.com); Rhiju Das
13 
14 #ifndef INCLUDED_protocols_simple_moves_ConstrainToIdealMover_hh
15 #define INCLUDED_protocols_simple_moves_ConstrainToIdealMover_hh
16 
17 // Unit Headers
19 
20 // Project Headers
21 #include <core/pose/Pose.fwd.hh>
22 #include <protocols/moves/Mover.hh>
23 
24 #include <core/id/AtomID.fwd.hh>
26 
28 
29 #include <protocols/toolbox/AllowInsert.fwd.hh> //need to move AllowInsert to toolbox XRW2
30 
32 
33 #include <utility/vector1.hh>
34 
35 
36 // Utility Headers
37 // #include <core/types.hh>
38 
39 namespace protocols {
40 namespace simple_moves {
41 
42 
43 //////////////////WARNING WARNING WARNING////////////////////////////////////////////////////
44 //This code has been refactored from RNA_minimizer, but has not yet been updated to work with
45 //protein poses - I wouldn't suggest trying to use it yet!
46 //TODO for proteins
47 //make_pose_from_sequence from annotated sequence (?)
48 //test with cen and fa poses
49 //check RNA assumptions in i_want_this_atom_to_move
50 //remap which score term these appear in (so it's not rna_bond_geometry)
51 
52 ///@details Idealization is generally performed by adding constraints to the Pose that keep bond lengths and angles within the appropriate ranges; then freeing those DOFs and performing minimization or sampling. This protocols::moves::Mover creates bond and angle constraints compatible with idealization; it does not modify the input Pose other than by adding constraints. If your pose is already ideal, this is likely to unidealize it. Also, it will add a LOT of degrees of freedom to your minimization, which may lead to significant slowdowns!
54 
55 public:
56 
60  virtual ~ConstrainToIdealMover();
61 
62  virtual void apply( core::pose::Pose & pose );
63  virtual std::string get_name() const;
64 
65  virtual moves::MoverOP fresh_instance() const;
66  virtual moves::MoverOP clone() const;
67 
68  ///@brief supply a MoveMap to be further modified by this mover; otherwise it will modify a blank one
70 
71  ///@brief get the MoveMap last created during apply()
73 
74  ///@brief setter for AllowInsert; makes a shallow copy
76 
77  ///@brief getter for AllowInsert
79 
80  ///@brief parse XML (specifically in the context of the parser/scripting scheme)
81  // virtual void parse_my_tag(
82  // TagPtr const,
83  // protocols::moves::DataMap &,
84  // Filters_map const &,
85  // protocols::moves::Movers_map const &,
86  // Pose const & );
87 
88 private:
89 
90  ///@most of the work happens here. This modifies the movemap (member variable) and adds constraints to the Pose that will gently idealize angles and bond lengths
91  void
93  //core::kinematics::MoveMap & mm, //now a member variable
94  core::pose::Pose & pose,
95  core::pose::Pose const & pose_reference );
96 
97  ///@brief this function generates a "reference pose" for the input pose that has the same chemistry (as best as possible), but has ideal angles and bond lengths. These are then used to generate the constraints later. Virtual in case you want to make the reference in a different fashion.
98  virtual
99  void
101  core::pose::Pose const & pose,
102  core::pose::Pose & pose_reference );
103 
104  ///@brief maps to other version of function; should this type of atom be moved during idealization?
105  virtual
106  bool
107  i_want_this_atom_to_move( core::pose::Pose const & pose, core::id::AtomID const & atom_id);
108 
109  ///@brief returns whether or not this atom should move during idealiation categorically; mostly boils down to "don't move the sidechains". Virtual in case you want to deny using a different metric.
110  virtual
111  bool
112  i_want_this_atom_to_move( core::conformation::Residue const & residue2, core::Size const & k );
113 
114  bool
116  core::pose::Pose const & pose,
117  core::id::AtomID const & atom_id1,
118  core::id::AtomID const & atom_id2);
119 
120  bool
122  core::id::AtomID const & atom_id1,
123  core::id::AtomID const & atom_id2,
124  utility::vector1< std::pair< core::id::AtomID, core::id::AtomID > > & bonded_atom_list );
125 
126  bool
128  core::id::AtomID const & atom_id1,
129  core::id::AtomID const & atom_id2,
130  core::id::AtomID const & atom_id3,
131  utility::vector1< std::pair< core::id::AtomID, std::pair< core::id::AtomID, core::id::AtomID > > > & bond_angle_list );
132 
133  void
135  core::id::AtomID const & atom_id1,
136  core::id::AtomID const & atom_id2,
137  core::id::AtomID const & atom_id3,
138  utility::vector1< std::pair < core::id::AtomID, std::pair< core::id::AtomID, core::id::AtomID > > > & bond_angle_list,
139  core::pose::Pose const & pose,
140  core::pose::Pose const & pose_reference,
142 
143  void
145  core::id::AtomID const & atom_id1,
146  core::id::AtomID const & atom_id2,
147  utility::vector1< std::pair< core::id::AtomID, core::id::AtomID > > & bonded_atom_list,
148  core::pose::Pose const & pose,
149  core::pose::Pose const & pose_reference,
151 
152 private:
153  ///@brief sort of like a MoveMap? Allowed to maintain use w/Rhiju's RNA code.
155 
156  ///@brief MoveMap used to allow bond and angle torsions
158 
159  ///@brief does the mm_ variable contain a movemap filled by apply(), or a movemap supplied to be modified?
160  ///Necessary to know if a self-generated movemap needs to be tossed out at the beginning of apply()
162 
163  //Not stored locally (not reusable, no reason (?) not to save the memory by leaving it on the stack)
164  //core::pose::PoseOP pose_reference_;
165 
166 };//end ConstrainToIdealMover
167 
168 }//namespace moves
169 }//namespace protocols
170 
171 #endif // INCLUDED_protocols_simple_moves_ConstrainToIdealMover_HH