Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BiasedFragmentMover.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/BiasedFragmentMover.hh
11 /// @author Christopher Miles (cmiles@uw.edu)
12 
13 #ifndef INCLUDED_PROTOCOLS_NONLOCAL_BIASEDFRAGMENTMOVER_HH
14 #define INCLUDED_PROTOCOLS_NONLOCAL_BIASEDFRAGMENTMOVER_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
30 #include <core/fragment/FragSet.hh>
31 #include <core/fragment/Frame.hh>
34 #include <core/pose/Pose.fwd.hh>
35 #include <protocols/moves/Mover.hh>
36 
37 // Package headers
39 
40 namespace protocols {
41 namespace nonlocal {
42 
43 /// @class A kinematically-aware mover for performing fragment insertion.
44 /// User-specified, per-residue sampling probabilities allow fine grained
45 /// control over the simulation.
47  typedef boost::unordered_map<unsigned, core::fragment::Frame> FrameMap;
50 
51  public:
52  /// @brief Creates a new BiasedFragmentMover that selects uniformly from the
53  /// available fragments at the selected insertion position.
54  BiasedFragmentMover(const PolicyOP& policy, const Probabilities& probs);
55 
57 
58  /// @brief Inserts a single fragment into pose.
59  ///
60  /// Insertion position is chosen in a biased manner using the per-residue
61  /// probabilities provided in the constructor. The decision on which fragment
62  /// to insert from the fragment library is delegated to the policy specified
63  /// in the constructor.
64  ///
65  /// Respects the underlying kinematics of the system.
66  void apply(core::pose::Pose& pose);
67 
68  /// @brief Returns the name of this mover
69  std::string get_name() const;
70 
71  private:
72  /// @brief Creates a position-indexable list of Frames
73  void initialize_library();
74 
75  /// @brief Generates cdf from pdf
77 
78  /// @brief Verifies that the probability of selecting invalid positions is 0
80 
81  /// @brief Returns a randomly chosen position according to the input probabilities
82  unsigned random_position() const;
83 
84 
85  // -- Members --
86 
87  /// @brief Avoid creating a useless MoveMap for each call to Frame::apply().
89 
90  /// @brief Fragment library
92 
93  /// @brief Position-indexable Frame lookup
95 
96  /// @brief Guidance for selecting the fragment to be inserted at a given position
98 
99  /// @brief PDF of residue sampling probabilities. Must remain in sync with cdf_.
101 
102  /// @brief CDF of residue sampling probabilities. Must remain in sync with pdf_.
104 };
105 
106 } // namespace nonlocal
107 } // namespace protocols
108 
109 #endif // PROTOCOLS_NONLOCAL_BIASED_FRAGMENT_MOVER_HH_