Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BranchAngleOptimizer.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/branch_angle/BranchAgnleOptimizer.hh
11 /// @brief definition of BranchAgnleOptimizer class and methods
12 /// @author Colin A. Smith (colin.smith@ucsf.edu)
13 
14 
15 #ifndef INCLUDED_protocols_branch_angle_BranchAngleOptimizer_hh
16 #define INCLUDED_protocols_branch_angle_BranchAngleOptimizer_hh
17 
19 
20 // Protocols Headers
25 
26 #ifdef WIN32
27 #include <protocols/branch_angle/BranchCoef1.hh> // WIN32 INCLUDE
28 #include <protocols/branch_angle/BranchCoef2.hh> // WIN32 INCLUDE
29 #include <protocols/branch_angle/BranchParam1.hh> // WIN32 INCLUDE
30 #include <protocols/branch_angle/BranchParam2.hh> // WIN32 INCLUDE
31 #endif
32 
33 // Core Headers
34 // AUTO-REMOVED #include <core/conformation/Residue.fwd.hh>
35 #include <core/id/AtomID.fwd.hh>
39 #include <core/pose/Pose.fwd.hh>
40 #include <core/types.hh>
41 
42 // Utility Headers
43 // AUTO-REMOVED #include <utility/vector1.hh>
44 
45 // Standard Library Headers
46 #include <map>
47 #include <set>
48 
49 #include <utility/vector1.hh>
50 
51 
52 namespace protocols {
53 namespace branch_angle {
54 
56 
57 public:
58 
61  );
62 
64 
66  BranchAngleOptimizer const & src
67  );
68 
70  tolerance() const
71  {
72  return tolerance_;
73  }
74 
75  void
78  )
79  {
81  }
82 
83  virtual
85 
88 
91 
92  /// @brief set input MMBondAngleResidueTypeParamSet, sharing with the input
93  void
96  );
97 
98  /// @brief set input MMBondAngleResidueTypeParamSet, making a copy
99  void
102  );
103 
104  bool initialized() const { return initialized_; }
105 
106  /// @brief optimize angles branching off the defined mainchain
107  core::Size
109  core::pose::Pose & pose,
110  core::id::AtomID main_atomid1,
111  core::id::AtomID center_atomid,
112  core::id::AtomID main_atomid2,
113  bool optimize_for_minimum = false
114  );
115 
116  /// @brief get overall bond angle parameters for the defined mainchian
117  core::Size
119  core::pose::Pose const & pose,
120  core::id::AtomID main_atomid1,
121  core::id::AtomID center_atomid,
122  core::id::AtomID main_atomid2,
123  core::Real & Ktheta,
124  core::Real & theta0,
125  core::Real & energy0
126  );
127 
128  /// @brief get single branching atom bond angle parameters
130  param1(
131  core::pose::Pose const & pose,
132  core::id::AtomID const & main_atomid1,
133  core::id::AtomID const & center_atomid,
134  core::id::AtomID const & main_atomid2,
135  core::id::AtomID const & branch_atomid1
136  ) const;
137 
138  /// @brief get double branching atom bond angle parameters
140  param2(
141  core::pose::Pose const & pose,
142  core::id::AtomID const & main_atomid1,
143  core::id::AtomID const & center_atomid,
144  core::id::AtomID const & main_atomid2,
145  core::id::AtomID const & branch_atomid1,
146  core::id::AtomID const & branch_atomid2
147  ) const;
148 
149  /// @brief get number of single branching atom coefficients
150  core::Size
151  num_coef1() const;
152 
153  /// @brief get number of double branching atom coefficients
154  core::Size
155  num_coef2() const;
156 
157  /// @brief get number of undefined single branching atom coefficients
158  core::Size
159  num_undefined_coef1() const;
160 
161  /// @brief get number of undefined double branching atom coefficients
162  core::Size
163  num_undefined_coef2() const;
164 
165  /// @brief read known parameters from the database
166  void
167  read_database();
168 
169  /// @brief write undefined parameters to the database
170  void
171  write_database() const;
172 
173  /// @brief read single branching atom coefficients from an input stream
174  void
175  read_coef1(
176  std::istream & in
177  );
178 
179  /// @brief read single branching atom coefficients from a file
180  bool
181  read_coef1(
182  std::string const & filename
183  );
184 
185  /// @brief read single branching atom coefficients from default database file
186  void
188 
189  /// @brief read single branching atom coefficients from user database file
190  bool
191  read_coef1_user();
192 
193  /// @brief read single branching atom coefficients
194  void
195  read_coef2(
196  std::istream & in
197  );
198 
199  /// @brief read double branching atom coefficients from a file
200  bool
201  read_coef2(
202  std::string const & filename
203  );
204 
205  /// @brief read double branching atom coefficients from default database file
206  void
208 
209  /// @brief read double branching atom coefficients from user database file
210  bool
211  read_coef2_user();
212 
213  /// @brief read parameters for undefined single branching atom coefficients
214  void
216  std::istream & in
217  );
218 
219  /// @brief read parameters for undefined single branching atom coefficients from a file
220  bool
222  std::string const & filename
223  );
224 
225  /// @brief read single branching atom undefined coefficients from the database file
226  bool
228 
229  /// @brief write out parameters for undefined single branching atom coefficients
230  void
232  std::ostream & out
233  ) const;
234 
235  /// @brief write parameters for undefined single branching atom coefficients to a file
236  bool
238  std::string const & filename
239  ) const;
240 
241  /// @brief write single branching atom undefined coefficients to the database file
242  bool
243  write_undefined_coef1() const;
244 
245  /// @brief read parameters for undefined double branching atom coefficients
246  void
248  std::istream & in
249  );
250 
251  /// @brief read parameters for undefined double branching atom coefficients from a file
252  bool
254  std::string const & filename
255  );
256 
257  /// @brief read double branching atom undefined coefficients from the database file
258  bool
260 
261  /// @brief write out parameters for undefined double branching atom coefficients
262  void
264  std::ostream & out
265  ) const;
266 
267  /// @brief write parameters for undefined double branching atom coefficients to a file
268  bool
270  std::string const & filename
271  ) const;
272 
273  /// @brief write double branching atom undefined coefficients to the database file
274  bool
275  write_undefined_coef2() const;
276 
277 private:
278 
279  // don't allow assignment
280  BranchAngleOptimizer const &
281  operator=(BranchAngleOptimizer const & src);
282 
285 
288  std::map<BranchParam1, core::Size> coef_map1_;
289  std::map<BranchParam2, core::Size> coef_map2_;
290  std::set<BranchParam1> undefined_coef1_;
291  std::set<BranchParam2> undefined_coef2_;
292 
295 };
296 
297 // Undefined, commenting out to make PyRosetta compile
298 /// @brief get all atoms bonded to another
299 //utility::vector1<core::id::AtomID> bonded_neighbor_all_res(core::pose::Pose const & pose, core::id::AtomID atomid );
300 
301 /// @brief get 1 branching atom
302 void
304  core::pose::Pose const & pose,
305  core::id::AtomID main_atomid1,
306  core::id::AtomID center_atomid,
307  core::id::AtomID main_atomid2,
308  core::id::AtomID & branch_atomid1
309 );
310 
311 /// @brief get 2 branching atoms ordered according their torsion offsets
312 void
314  core::pose::Pose const & pose,
315  core::id::AtomID main_atomid1,
316  core::id::AtomID center_atomid,
317  core::id::AtomID main_atomid2,
318  core::id::AtomID & branch_atomid1,
319  core::id::AtomID & branch_atomid2
320 );
321 
322 /// @brief get 2 siblings of an atom ordered according their torsion offsets
323 void
325  core::kinematics::tree::AtomCOP const main_atom2,
326  core::kinematics::tree::AtomCOP & branch_atom1,
327  core::kinematics::tree::AtomCOP & branch_atom2
328 );
329 
330 } // branch_angle
331 } // protocols
332 
333 #endif