Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SingleFragmentMover.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/nonlocal/SingleFragmentMover.hh
11 /// @author Christopher Miles (cmiles@uw.edu)
12 
13 #ifndef INCLUDED_PROTOCOLS_NONLOCAL_SINGLEFRAGMENTMOVER_HH
14 #define INCLUDED_PROTOCOLS_NONLOCAL_SINGLEFRAGMENTMOVER_HH
15 
16 // Unit header
18 
19 // C/C++ headers
20 #include <string>
21 
22 // External headers
23 #include <boost/unordered/unordered_map.hpp>
24 
25 // Utility headers
26 #include <utility/vector1.hh>
27 
28 // Project headers
29 #include <core/types.hh>
32 #include <core/fragment/Frame.hh>
35 #include <core/pose/Pose.fwd.hh>
37 #include <protocols/moves/Mover.hh>
38 
39 // Package headers
42 
43 namespace protocols {
44 namespace nonlocal {
45 
47  typedef core::Real Real;
48  typedef core::Size Size;
57 
58  typedef boost::unordered_map<Size, Frame> FrameMap;
60 
61  public:
62  /// @brief No-argument constructor required by RosettaScripts. The caller is
63  /// responsible for initializing the instance
65 
66  /// @brief Creates a new SingleFragmentMover that selects uniformly from the
67  /// available fragments at the selected insertion position.
68  SingleFragmentMover(const FragSetOP& fragments,
69  const MoveMapOP& movable);
70 
71  /// @brief Creates a new SingleFragmentMover that selects fragments at the
72  /// selected insertion position using the given policy.
73  SingleFragmentMover(const FragSetOP& fragments,
74  const MoveMapOP& movable,
75  const PolicyOP& policy);
76 
78 
79  /// @brief Performs a single fragment insertion on <pose>, drawn from the set
80  /// of fragments specified in the constructor. Respects the underlying
81  /// kinematics of the system, as determined by the Pose's FoldTree and the
82  /// user-specified MoveMap. Fragment insertions will only occur in allowable
83  /// regions of the pose. No moves will span jumps in the FoldTree.
84  ///
85  /// Assumptions:
86  /// - <pose> has been instantiated (i.e. constructed from sequence or an
87  /// alternate source) elsewhere
88  /// - <pose>'s FoldTree is valid
89  /// - <pose> is centroid-level (warning if full-atom)
90  /// - The combination of FoldTree and MoveMap provide an unambiguous
91  /// definition of what's movable and what's not
92  void apply(Pose& pose);
93 
94  /// @brief Returns the name of this mover
95  std::string get_name() const;
96 
97  /// @brief Creates a new instance using the copy constructor
98  virtual MoverOP clone() const;
99 
100  /// @brief Creates a new instance using the default constructor
101  virtual MoverOP fresh_instance() const;
102 
103  /// @brief Mover-specific parsing required by RosettaScripts
104  void parse_my_tag(const utility::tag::TagPtr tag,
106  const protocols::filters::Filters_map& filters,
107  const protocols::moves::Movers_map& movers,
108  const Pose& pose);
109 
110  /// @brief Mover-specific parsing required by ElScripts
111  void parse_def( utility::lua::LuaObject const & def,
112  utility::lua::LuaObject const & score_fxns,
113  utility::lua::LuaObject const & tasks,
115 
116  /// @brief Returns true if this instance is in a usable state, false otherwise
117  bool valid() const;
118 
119 
120  private:
121  void initialize(const FragSetOP& fragments,
122  const MoveMapOP& movable,
123  const PolicyOP& policy);
124 
125  /// @brief Creates a position-indexable list of Frames
126  void initialize_library();
127 
128  /// @brief Creates a set of chunks by examining the stored MoveMap and FragSet
129  /// in conjunction with <tree>
130  void initialize_chunks(const FoldTree& tree);
131 
132  /// @brief Returns a randomly chosen chunk with uniform probability
133  const Chunk* random_chunk() const;
134 
135  /// @brief If <pose> is fullatom, converts it to centroid and returns true.
136  /// Otherwise, takes no action and returns false.
137  bool to_centroid(Pose* pose) const;
138 
139 
140  /// @brief The set of fragments to apply to the pose
142 
143  /// @brief Defines restrictions on which degrees of freedom in the system can
144  /// be modified.
146 
147  /// @brief Selects the fragment to be inserted at <insertion_pos> given
148  /// knowledge of the fragment library and the current state of the pose.
150 
151  /// @brief FoldTree used to initialize <chunks_> in a previous call to apply()
153 
154  /// @brief Provides index-based access to the data contained in the FragSet
156 
157  /// @brief Regions of sequence on which to perform fragment insertion
159 
160  /// @brief Probability of selecting chunk c_i. Proportional to chunk length.
162 };
163 
164 } // namespace nonlocal
165 } // namespace protocols
166 
167 #endif // PROTOCOLS_NONLOCAL_SINGLEFRAGMENTMOVER_HH_