Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BBGaussianMover.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 // :noTabs=false:tabSize=4:indentSize=4:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available under license.
7 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
8 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
9 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
10 
11 /// @file protocols/simple_moves/BBGaussianMover.fwd.hh
12 /// @brief Gaussian Perturbation to backbone
13 /// @author Yuan Liu (wendao@u.washington.edu)
14 
15 #ifndef INCLUDED_protocols_simple_moves_BBGaussianMover_hh
16 #define INCLUDED_protocols_simple_moves_BBGaussianMover_hh
17 
19 //core
20 #include <core/types.hh>
21 #include <core/pose/Pose.fwd.hh>
22 // AUTO-REMOVED #include <core/conformation/Residue.hh>
23 //protocols
24 #include <protocols/moves/Mover.hh>
25 //movemap
27 //
28 #include <utility/vector1.hh>
29 
30 //std
31 #include <string>
32 
34 #include <numeric/xyzVector.hh>
35 
36 
37 using namespace std;
38 
39 namespace protocols {
40 namespace simple_moves {
41 
42 /// @brief the basic class for implementing Gaussian Perturbation of bb
43 /// @note "Monte Carlo update for chain molecules: Biased Gaussian steps in torsional space"
44 /// "The Journal of Chemical Physics, Vol. 114, No. 18. (2001), pp. 8154-8158."
45 /// Two steps for perturbing the backbone and keeping the geometry constrain
46 /// Step 1: Gaussian Biased steps in torsional space:
47 /// the end atoms of the moving segment should be choosen by user
48 /// and to keep the geometry constrain(6), the DOF of the moving segment > 6
49 /// Step 2: "pivot" update the bb conformation, or followed by a chainclosure method (BBConRot)
51 {
52 public:
54  typedef core::Real Real;
55  typedef core::Size Size;
64 
65 public:
67  ~BBGaussianMover();
68 
69  //go through all the residue, count how many movable residue passed
70  //count > n_pert_res (depends on the n_dof_angle)
71  //stop by frozen res and cut point
72  //TODO: apply smallmover to the end segment if their length is not
73  //satisfy the n_pert_res_, dof: L-(n-1) => L+(n+1)
74 
76  void movemap(core::kinematics::MoveMapCOP new_movemap);
77 
78  using moves::Mover::last_proposal_density_ratio;
79 
80  /// @brief get the ratio of proposal densities for the last move
81  Real last_proposal_density_ratio() const;
82 
83 protected:
84  void setup_list(Pose const &);
85  //r1, r2, r: r rotate around axis r1->r2
86  Vector get_dRdPhi(Vector const &r1, Vector const &r2, Vector const &r)
87  {
88  //dr/dphi = r x axis
89  Vector axis((r2-r1).normalize());
90  Vector r_local(r-r1);
91  return r_local.cross(axis);
92  }
93 
94  //r1, r2, r3, r: r rotate around axis (r3-r2)x(r2xr1)
95  Vector get_dRdTheta(Vector const &r1, Vector const &r2, Vector const &r3, Vector const &r)
96  {
97  Vector axis((r3-r2).cross(r2-r1).normalize());
98  Vector r_local(r-r2);
99  return r_local.cross(axis);
100  }
101 
102  //interface
103  virtual void get_VdRdPhi(Pose const &)=0;
104  virtual void get_G()=0;
105  virtual void get_A()=0;
106  //calculate the L matrix and update pose
107  virtual Real get_L_move(Pose &)=0;
108  //calculate the L', update last_proposal_density
109  virtual Real get_L_prime()=0;
110 
111  //foreward
112  Real cholesky_fw(Matrix &, Size, utility::vector1<Real> &, utility::vector1<Real> &, Size from=1, Size to=0, Real scale=1.0);
113  //backward
114  Real cholesky_bw(Matrix &, Size, utility::vector1<Real> &, utility::vector1<Real> &, Size from=1, Size to=0, Real scale=1.0);
115 
116  void pivot_range_randomly(Pose &, Size, Size);
117 
118 protected:
123  //utility::vector1< Size > available_res_list_;
125  /// @note {dr/dphi_i * dr/dphi_j} -- n_dof_angle^2
127  /// @note perturbation from G
129  /// @note {dr_i/dphi_j} -- n_dof_angle*n_end_atom
131 
132  //to avoid -0.0
133  //static const Real ZERO;
134 
135  // proposal density ratio
137 
138  //movemap
140 };
141 
142 /// @brief a particular gaussian mover from the original paper
143 /// @note using 8 torsion angles as DOF, 3 atoms (Ca,C,O) as end
145 {
146 public:
147 
148 
149 public:
150  BBG8T3AMover();
151  ~BBG8T3AMover();
152 
153 
154  //static void register_options();
155 
156  void apply(Pose &);
157  virtual std::string get_name() const;
158  void factorA( core::Real const fA );
159  void factorB( core::Real const fB );
160  //Real get_last_delta_square();
161 
162 protected:
163  void get_VdRdPhi(Pose const &);
164  void get_G();
165  void get_A();
166 
167  Real get_L_move(Pose &);
168  Real get_L_prime();
169 
170 private:
176 };
177 
178 }//namespace simple_moves
179 }//namespace protocols
180 
181 #endif
182