Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AtomTreeCollection.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 core/pack/scmin/AtomTreeCollection.hh
11 /// @brief Classes for holding sets of AtomTrees used during variuos packing+minimizing schemes
12 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
13 
14 #ifndef INCLUDED_core_pack_scmin_AtomTreeCollection_hh
15 #define INCLUDED_core_pack_scmin_AtomTreeCollection_hh
16 
17 // Unit headers
19 
20 // Package Headers
22 
25 
26 // Project Headers
27 #include <core/types.hh>
32 #include <core/pose/Pose.fwd.hh>
33 #include <core/id/DOF_ID.hh>
34 
35 
36 #ifdef WIN32
39 #endif
40 
41 //#include <core/pose/Pose.fwd.hh>
42 //#include <core/scoring/ScoreFunction.fwd.hh>
43 
44 // Utility headers
45 #include <utility/vector1.hh>
46 #include <utility/pointer/ReferenceCount.hh>
47 #include <numeric/xyzVector.hh>
48 
49 namespace core {
50 namespace pack {
51 namespace scmin {
52 
53 /// @brief Class to save the state for a ResidueAtomTreeCollection
55 {
56 public:
59 
62 
63  void set_restype_index( Size setting );
64  void copy_coords( conformation::Residue const & );
65 
66  Size restype_index() const { return restype_index_; }
67 
68  Vector const &
69  coord( Size ind ) const
70  {
71  assert( ind <= natoms_ );
72  return coords_[ ind ];
73  }
74 
75 private:
79 };
80 
81 /// @brief The conformation::Residues and kinematics::AtomTrees for a single
82 /// collection of rotamers (e.g. a RotamerSet). Each chemical::ResidueType gets its own residue/atomtree pair.
83 /// A particular AtomTree/Residue pair can be set as "active" and manipulated
84 /// by setter and getters for either the coordinates of the Residues or the
85 /// chi dihedrals of the AtomTree.
87 {
88 public:
90  task::ResidueLevelTask const & rltask,
91  conformation::Conformation const & conformation,
92  conformation::Residue const & orig_res
93  );
94 
95  /// @brief Constructor for a RotamerSet that has already been built.
97  rotamer_set::RotamerSet const & rset,
98  Size resid
99  );
100 
101  virtual ~ResidueAtomTreeCollection();
102 
104  void set_active_restype_index( Size restype_index );
105 
106  /// @brief The responsibility for making sure that the active residue and the active atomtree
107  /// are in synch is offloaded to an external class so that the calls to "active_residue()" and
108  /// "active_atom_tree()" are as fast as possible (and bitwise const for future multithreaded use).
109  /// After a round of set_chi() calls, the user for this class must update the residue coordinates.
110  void update_residue();
111 
112  /// @brief See comments for update_residue(). After a call to "set_rescoords", the user must
113  /// call update_atomtree() to make sure the atomtree and the residue are in synch.
114  void update_atom_tree();
115 
116  chemical::ResidueType const & active_restype() const;
117 
118  /// @brief Inline accessor for the active residue.
119  /// asserts residue_uptodate_ -- make sure that update_residue is called first
120  inline
122  {
123  assert( residue_uptodate_ );
124  return *active_residue_;
125  }
126 
128 
129  /// @brief Inline accessor for the active atom tree.
130  /// asserts atom_tree_uptodate_ -- make sure that update_atom_tree is called first
132  {
133  assert( atom_tree_uptodate_ );
134  return *active_atom_tree_;
135  }
136 
137  ///fpd get dof value by DOF_ID
138  /// NOTE input resid must be 1
139  core::Real dof( core::id::DOF_ID const &dofid );
140 
141  /// @brief Assigns the chi dihedral for the active restype. Must be followed by a call to
142  /// update_residue() before the next call to active_residue()
143  void set_chi( Size chi_index, Real value );
144 
145  ///fpd bondlength analog to set_chi
146  /// like set_chi, assumes changes propagate to atomtree
147  /// keyed off of chi#, so we only allow distances corresponding to chi angles to refine
148  /// distance corresponds to the distance between atoms 3 and 4 defining the chi
149  /// chino==0 ==> CA-CB distance, which allows us to refine ALA CB position for example
150  void set_d( Size chi_index, Real value );
151 
152  ///fpd bondangle analog to set_chi
153  /// same idea as set_d
154  void set_theta( Size chi_index, Real value );
155 
156  /// @brief Assigns the coordinates for a residue. Must be followed by a call to
157  /// update_atom_tree() before the next cal to active_atom_tree().
158  void set_rescoords( conformation::Residue const & res );
159  void set_rescoords( utility::vector1< Vector > const & coords );
160  void set_rescoords( utility::vector1< id::AtomID > const & atms, utility::vector1< Vector > const & coords );
161 
162  void save_momento( ResidueAtomTreeCollectionMomento & momento ) const;
164 
165 private:
166 
167  //uncopyable -- unimplemented
170 
171 
172 private:
173 
177 
180 
183 
184 };
185 
186 /// @brief A collection of ResidueAtomTreeCollection objects for an entire design task.
188 {
189 public:
190  /// @brief construct a forest
192  pose::Pose const & pose,
194  );
195 
196  /// @brief construct a forest -- only use when no RotamerSets is constructed
198  pose::Pose const & pose,
199  task::PackerTask const &
200  );
201 
202  /// @brief construct a single ResidueAtomTreeCollection from an existing RotamerSet
204  pose::Pose const & pose,
205  rotamer_set::RotamerSet const & rset,
206  Size resid
207  );
208 
209  /// @brief construct a single ResidueAtomTreeCollection -- only use when no RotamerSet is constructed
211  pose::Pose const & pose,
212  task::ResidueLevelTask const & rltask,
213  Size resid
214  );
215 
216  virtual ~AtomTreeCollection();
217 
221 
222  //conformation::Residue const & residue( Size seqpos );
223 
224 private:
225 
226  //rotamer_set::RotamerSetsCOP rotsets_;
230 
231 };
232 
233 } // namespace scmin
234 } // namespace pack
235 } // namespace core
236 
237 #endif