Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
util.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 /// @author Phil Bradley
12 
13 
14 #ifndef INCLUDED_core_conformation_util_hh
15 #define INCLUDED_core_conformation_util_hh
16 
17 
18 // Unit headers
19 
20 // Project headers
21 #include <core/types.hh>
24 
28 
31 #include <core/id/AtomID.fwd.hh>
38 
39 // Utility headers
40 
41 // C++ headers
42 #include <iosfwd>
43 
44 namespace core {
45 namespace conformation {
46 
47 void
49  Residue & moving_rsd,
50  chemical::ResidueConnection const & moving_connection,
51  Residue const & fixed_rsd,
52  chemical::ResidueConnection const & fixed_connection,
53  Conformation const & conformation,
54  bool lookup_bond_length = false
55 );
56 
57 /// @brief Sets the two bond angles and the bond length across the junction, rebuilds dependent atoms (eg O,H)
58 void
60  Size const seqpos,
61  Conformation & conformation
62 );
63 
64 void
66  Size const seqpos,
67  Conformation & conformation
68 );
69 
70 
71 /// @brief Idealize backbone and sidechain at seqpos
72 void
74  Size const seqpos,
75  Conformation & conformation
76 );
77 
78 
79 /// @brief Return true if position contains an ideal geometry up to some epsilon
80 ///
81 /// @params seqpos - sequence position
82 /// @params conformation - conformation object
83 /// @params theta_epsilon - permitted deviation from ideal bond angles, in Radians
84 /// @params D_epsilon - permitted deviation from ideal bond length
85 ///
86 /// @remarks conformation is needed for context of polymer nbrs
87 bool
88 is_ideal_position( // Barak 6/30/09
89  Size const seqpos,
90  Conformation const& conformation,
91  Real theta_epsilon = 0.005, // ~0.29 degrees
92  Real D_epsilon = 0.02
93 );
94 
95 
96 /// @brief Fills coords of target_rsd with coords from source_rsd of same atom_name, rebuilds others.
97 void
99  Residue const & source_rsd,
100  Residue & target_rsd,
101  Conformation const & conf
102 );
103 
104 
105 ///
106 void
107 show_atom_tree( kinematics::tree::Atom const & atom, Conformation const & conf, std::ostream & os );
108 
109 void
111  conformation::Conformation & conformation,
112  Size const seqpos,
113  chemical::ResidueType const & new_rsd_type
114 );
115 
116 
117 void
119  conformation::Conformation & conformation,
120  chemical::VariantType const & variant_type,
121  Size const seqpos
122 );
123 
124 
125 void
127  conformation::Conformation & conformation,
128  chemical::VariantType const & variant_type,
129  Size const seqpos
130 );
131 
132 
133 void
135  conformation::Conformation & conformation,
136  Size const seqpos
137 );
138 
139 
140 void
142  conformation::Conformation & conformation,
143  Size const seqpos
144 );
145 
146 
147 void
149  conformation::Conformation & conformation,
150  Size const seqpos
151 );
152 
153 
154 void
156  conformation::Conformation & conformation,
157  Size const seqpos
158 );
159 
160 void
161 build_tree(
162  kinematics::FoldTree const & fold_tree,
163  conformation::ResidueCAPs const & residues,
164  kinematics::AtomPointer2D & atom_pointer
165  );
166 
167 /// @brief build a sub atom-tree for a jump edge and attach it to main atom-tree
168 void
170  kinematics::Edge const & edge,
171  conformation::ResidueCAPs const & residues,
172  kinematics::AtomPointer2D & atom_pointer
173  );
174 
175 /// @brief build a sub atom-tree for a polymer edge and attach it to main atom-tree
176 void
178  kinematics::Edge const & edge,
179  conformation::ResidueCAPs const & residues,
180  kinematics::AtomPointer2D & atom_pointer
181  );
182 
183 /// @brief build a sub atom-tree for a chemical edge and attach it to main atom-tree
184 void
186  kinematics::Edge const & edge,
187  conformation::ResidueCAPs const & residues,
188  kinematics::AtomPointer2D & atom_pointer
189  );
190 
191 
192 /// @brief build the tree of atoms for this residue, anchored at root_atomno
193 void
195  int const root_atomno,
196  conformation::Residue const & rsd,
197  kinematics::AtomPointer1D & atom_ptr,
198  bool const root_atom_is_jump_atom
199  //bool const keep_1st_child_position = false
200  );
201 
202 /// @brief build_residue_tree function that uses the foldtree info
203 /// @brief also used in build_tree to build the residue tree for the root residue
204 void
206  conformation::ResidueCAPs const & residues,
207  conformation::Residue const & rsd,
208  kinematics::FoldTree const & fold_tree,
209  kinematics::AtomPointer1D & atom_ptr
210  );
211 
212 /// @brief Helper function for conformation routines
213 void
215  conformation::Residue const & new_rsd,
216  kinematics::FoldTree const & fold_tree,
217  conformation::ResidueCAPs const & residues,
218  kinematics::AtomTree & atom_tree
219  );
220 
221 /// @brief Inserts/ appends new residue subtree into an existing atomtree
222 /// @note The foldtree must already have been changed to reflect the new residue
223 /// @note The sequence position of the new residue is deduced from new_rsd.seqpos()
224 /// @note This function handles renumbering of the atomtree if necessary
225 void
227  conformation::Residue const & new_rsd,
228  kinematics::FoldTree const & fold_tree,
229  conformation::ResidueCAPs const & residues,
230  kinematics::AtomTree & atom_tree
231  );
232 
233 int
235  conformation::Residue const & rsd,
236  int const dir // +1, -1, or "dir_jump"
237  );
238 
239 /// @brief Get the atom-index of the atom to which the residue at position seqpos should be anchored.
240 int
242  conformation::Residue const & anchor_rsd,
243  Size const seqpos,
244  kinematics::FoldTree const & fold_tree
245  );
246 
247 
248 /// @brief get anchor atom to which the atom-tree of next residue in the edge is attached.
249 int
251  conformation::Residue const & rsd,
252  int const dir // forward(1), backward(-1), or "dir_jump"
253  );
254 
255 /// @brief Use this routine to deduce atom indices of connect atoms in the tree
256 void
258  conformation::Residue const & anchor_rsd,
259  conformation::Residue const & root_rsd,
260  kinematics::Edge const & edge,
261  Size & anchor_atomno,
262  Size & root_atomno
263  );
264 
265 /// @brief Moves the first same-residue child of the jump atom corresponding to edge into first place in the child list
266 void
268  kinematics::Edge const & edge,
269  conformation::ResidueCAPs const & residues,
270  kinematics::AtomPointer2D const & atom_pointer
271  );
272 
273 
274 /// @brief Moves the first same-residue child of the jump atom corresponding to edge into first place in the child list
275 void
277  kinematics::Edge const & edge,
278  conformation::ResidueCAPs const & residues,
279  kinematics::AtomTree & atom_tree
280  );
281 
282 void
284  conformation::Residue const & rsd_anchor,
285  conformation::Residue const & rsd_root,
286  Size & anchor_atom_no,
287  Size & root_atom_no
288  );
289 
290 /// @brief set up a map to match mainchain atoms from residue1 to residue2
291 void
293  id::AtomID_Map< id::AtomID > & atom_map,
294  conformation::Residue const & rsd1,
295  conformation::Residue const & rsd2
296 );
297 
298 /// @brief Replace a CYS with a CYD or vice-versa for changing disulfide bonds.
299 /// @param[in] index Position of the residue to replace.
300 /// @param[in] cys_type_name3 The 3-letter name of the cys type to use: either CYS
301 /// or CYD.
302 /// @param[inout] conf The conformation to modify
303 /// @return true if the replacement was successful, false otherwise.
304 bool change_cys_state( Size const index, std::string cys_type_name3, core::conformation::Conformation & conf );
305 
306 /// @brief Find whether there is a disulfide defined between two residues
307 bool is_disulfide_bond( core::conformation::Conformation const& conformation, core::Size residueA_pos, core::Size residueB_pos);
308 
309 /// @brief Generate a list of all disulfide bonds in the conformation
310 void disulfide_bonds( core::conformation::Conformation const& conformation, utility::vector1< std::pair<core::Size,core::Size> > & disulfides );
311 
312 /// @brief Introduce cysteines at the specified location and define a disulfide bond between them.
313 /// @details Does not do the repacking & minimization required to place the disulfide correctly.
314 void form_disulfide(core::conformation::Conformation & conformation, core::Size lower_res, core::Size upper_res);
315 
316 id::NamedAtomID
318  id::AtomID const & atom_id,
319  conformation::Residue const & rsd
320 );
321 
322 /* - undefinded, commenting out to make PyRosetta compile...
323 id::AtomID
324 named_atom_id_to_atom_id(
325  id::AtomID const & atom_id,
326  conformation::Residue const & rsd
327 );
328 */
329 
330 id::AtomID
332  id::NamedAtomID const & atom_id,
333  conformation::Residue const & rsd
334 );
335 
336 id::NamedStubID
338  id::StubID const & stub_id,
339  conformation::Residue const & rsd
340 );
341 
342 /* - undefinded, commenting out to make PyRosetta compile...
343 id::StubID
344 named_stub_id_to_named_stub_id(
345  id::NamedStubID const & named_stub_id,
346  conformation::Residue const & rsd
347 );
348 */
349 
350 // @brief determine torsion bins for given phi/psi/omega combination
351 // @author Amelie Stein (amelie.stein@ucsf.edu)
353 
354 
355 
356 } // conformation
357 } // core
358 
359 
360 
361 #endif