Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PackRotamersMover.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
11 /// @brief
12 /// @author Monica Berrondo
13 /// @author Modified by Sergey Lyskov
14 
15 #ifndef INCLUDED_protocols_simple_moves_PackRotamersMover_hh
16 #define INCLUDED_protocols_simple_moves_PackRotamersMover_hh
17 
18 // Unit headers
20 #include <protocols/moves/Mover.hh>
21 
22 // Project headers
23 #include <core/types.hh>
24 
25 // AUTO-REMOVED #include <core/pack/interaction_graph/InteractionGraphBase.hh>
26 // AUTO-REMOVED #include <core/pack/rotamer_set/RotamerSets.hh>
28 //#ifdef __clang__
29 // AUTO-REMOVED #include <core/pack/task/PackerTask.hh>
30 //#endif
32 #include <core/pose/Pose.fwd.hh>
35 #include <utility/tag/Tag.fwd.hh>
36 #include <utility/vector0.hh>
37 #include <utility/vector1.hh>
38 
41 
42 
43 
44 
45 namespace protocols {
46 namespace simple_moves {
47 
48 /// @brief A protocols::moves::Mover that packs the side-chains using a rotamer library
49 /// It uses a ScoreFunction for packing and a PackerTask,
50 /// or a TaskFactory that generates a PackerTask, for instructions on
51 /// what rotamer sets are allowed at each residue position during packing
52 ///
53 /// Common Methods:
54 /// PackRotamersMover.apply
56 /// @brief please derive from PackRotamersMover instead of attempting to add protocol-specific stuff here!
57 /// @author ashworth (current form)
58 public:
66 
67 public:
68  /// @brief default constructor
70  /// @brief constructor with typename
71  PackRotamersMover( std::string const & );
72 
73  /// @brief Constructs a PackRotamersMover with PackerTask <task>
74  /// evaluated using <scorefxn>
75  ///
76  /// ScoreFunction scorefxn /function to minimize while changine rotamers
77  /// PackerTask task /object specifying what to design/pack
78  /// Size (int) nloop /number of loops in the Pose (???)
80  ScoreFunctionCOP scorefxn,
81  PackerTaskCOP task = 0,
82  core::Size nloop = 1
83  );
84 
85  // destructor (important for properly forward-declaring smart-pointer members)
86  virtual ~PackRotamersMover();
87 
88  // copy constructor
89  PackRotamersMover( PackRotamersMover const & other );
90 
91  // methods
92 
93  /// @brief Performs side-chain packing based on the input PackerTask
94  /// using the input ScoreFunction
95  ///
96  /// example(s):
97  /// packmover.apply(pose)
98  /// See Also:
99  /// PackerTask
100  /// ScoreFunction
101  virtual void apply( Pose & pose );
102  virtual std::string get_name() const;
103  bool task_is_valid( Pose const & pose ) const; // should this be virtual?
104 
105  virtual void parse_def( utility::lua::LuaObject const & def,
106  utility::lua::LuaObject const & score_fxns,
107  utility::lua::LuaObject const & tasks,
109 
110  /// @brief allow non-const access to the internal minimizer options object
111 
112  ///@brief parse XML (specifically in the context of the parser/scripting scheme)
113  virtual void parse_my_tag(
114  TagPtr const,
116  Filters_map const &,
118  Pose const & );
119 
120  ///@brief parse "scorefxn" XML option (can be employed virtually by derived Packing movers)
121  virtual void parse_score_function(
122  TagPtr const,
124  Filters_map const &,
126  Pose const & );
127 
128  ///@brief parse "task_operations" XML option (can be employed virtually by derived Packing movers)
129  virtual void parse_task_operations(
130  TagPtr const,
132  Filters_map const &,
134  Pose const & );
135 
136  ///@brief required in the context of the parser/scripting scheme
138  ///@brief required in the context of the parser/scripting scheme
139  virtual protocols::moves::MoverOP clone() const;
140 
141  // setters
142 
143  /// @brief Sets the ScoreFunction to <sf>
144  ///
145  /// example(s):
146  /// packmover.score_function(scorefxn)
147  /// See Also:
148  /// PackRotamersMover
149  /// PackRotamersMover.task
150  void score_function( ScoreFunctionCOP sf );
151  /// @brief Sets the TaskFactory to <tf>
152  ///
153  /// example(s):
154  /// packmover.task_factory(task_design)
155  /// See Also:
156  /// PackRotamersMover
157  /// PackRotamersMover.task
158  void task_factory( TaskFactoryCOP tf );
159  /// @brief Sets the PackerTask to <t>
160  ///
161  /// example(s):
162  /// packmover.task(task_pack)
163  /// See Also:
164  /// PackRotamersMover
165  /// PackRotamersMover.task_factory
166  void task( PackerTaskCOP t );
167  void nloop( core::Size nloop_in );
168 
169 
170  // accessors
171 
172  /// @brief Returns the ScoreFunction
173  ///
174  /// example(s):
175  /// packmover.score_function()
176  /// See Also:
177  /// PackRotamersMover
178  /// PackRotamersMover.task
180  /// @brief Returns the PackerTask
181  ///
182  /// example(s):
183  /// packmover.task()
184  /// See Also:
185  /// PackRotamersMover
186  /// PackRotamersMover.task_factory
187  PackerTaskCOP task() const;
188  core::Size nloop() const { return nloop_; }
189  /// @brief Returns the TaskFactory
190  ///
191  /// example(s):
192  /// packmover.task_factory()
193  /// See Also:
194  /// PackRotamersMover
195  /// PackRotamersMover.task
198  InteractionGraphBaseCOP ig() const;
199  friend std::ostream &operator<< (std::ostream &os, PackRotamersMover const &mover);
200 
201 protected:
202  ///@brief get rotamers, energies. Also performs lazy initialization of ScoreFunction, PackerTask.
203  virtual void setup( Pose & pose );
204  // need a more elegant rot_to_pack implementation than this
205  virtual core::PackerEnergy run(
206  Pose & pose,
208  ) const;
209  virtual void note_packertask_settings( Pose const & );
210 
211 private:
212  // pointers to data that are passed in
217 
218  // 'really private:' packer data, actually created and owned by this class
221 
222 };
223 
224 // note: it is better to create new files, instead of adding additional classes here
225 
226 } // moves
227 } // protocols
228 
229 #endif