Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SymmetricConformation.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 // This file is part of the Rosetta software suite and is made available under license.
5 // The Rosetta software is developed by the contributing members of the Rosetta Commons consortium.
6 // (C) 199x-2009 Rosetta Commons participating institutions and developers.
7 // For more information, see http://www.rosettacommons.org/.
8 
9 /// @file core/conformation/symmetry/SymmetricConformation.hh
10 /// @brief symmetry conformation container.
11 // Contains overloaded functions needed to
12 // make changes in conformation symmetric
13 /// @author Phil Bradley, Ingemar Andre
14 
15 
16 #ifndef INCLUDED_core_conformation_symmetry_SymmetricConformation_hh
17 #define INCLUDED_core_conformation_symmetry_SymmetricConformation_hh
18 
19 
20 // Unit headers
23 
25 
26 // Numeric
27 #include <numeric/HomogeneousTransform.hh>
28 
29 #include <utility/vector1.hh>
30 
31 
32 namespace core {
33 namespace conformation {
34 namespace symmetry {
35 
36 /// @brief A symmetric conformation: has an additional data member "SymmetryInfo" class
37 /// @details Handles symmetrizing of *some* of the conformation-changing methods of Conformation
38 
40 
41 public:
42 
43  /////////////////////////////////////////
44  //// Construction / Copying
45  /////////////////////////////////////////
46 
47  /// @brief Default CTOR
49 
50  /// @brief Default CTOR
51  SymmetricConformation( Conformation const & conf, SymmetryInfo const & symm_info );
52 
53  /// @brief copy constructor
55 
56  /// @brief operator
57  Conformation &
58  operator=( SymmetricConformation const & src );
59 
61  clone() const;
62 
63  virtual
64  bool
65  same_type_as_me( Conformation const & other, bool recurse /* = true */ ) const;
66 
68 
70 
71  /////////////////////////////////////////
72  //// Setters
73  /////////////////////////////////////////
74 
75  /// DOF
76  virtual
77  void
78  set_dof( DOF_ID const & id, Real const setting );
79 
80  void
81  set_secstruct( Size const seqpos, char const setting );
82 
83  /// BONDS/TORSIONS
84  virtual
85  void
86  set_torsion( TorsionID const & id, Real const setting );
87 
88  /// JUMPS
89  /// @brief set a jump
90  virtual
91  void
92  set_jump(
93  int const jump_number,
94  Jump const & new_jump
95  );
96 
97  /// @brief set a jump and force immediate calculation of affected XYZ coords
98  virtual
99  void
100  set_jump_now(
101  int const jump_number,
102  Jump const & new_jump
103  );
104 
105  /// @brief set a jump
106  virtual
107  void
108  set_jump(
109  AtomID const & id,
110  Jump const & new_jump
111  );
112 
113  ///
114  virtual
115  void
117  AtomID const & atom1,
118  AtomID const & atom2,
119  AtomID const & atom3,
120  Real const setting
121  );
122 
123  ///
124  virtual
125  void
127  AtomID const & atom1,
128  AtomID const & atom2,
129  Real const setting
130  );
131 
132  ///
133  virtual
134  void
136  AtomID const & atom1,
137  AtomID const & atom2,
138  AtomID const & atom3,
139  AtomID const & atom4,
140  Real const setting
141  );
142 
143  virtual utility::vector1<bool>
144  get_residue_mask() const;
145 
146  virtual Real
147  get_residue_weight(core::Size resid1, core::Size resid2) const;
148 
149  /// @brief replace residue
150  virtual void
152  Size const seqpos,
153  Residue const & new_rsd,
154  bool const orient_backbone
155  );
156 
157  virtual void
159  Size const seqpos,
160  Residue const & new_rsd,
161  utility::vector1< std::pair< std::string, std::string > > const & atom_pairs
162  );
163 
164  /// @brief set the fold_tree .. update symminfo if jump numbering changed
165  virtual void
166  fold_tree( FoldTree const & fold_tree_in );
167 
168  /// @brief FoldTree access
169  virtual FoldTree const &
170  fold_tree() const
171  {
172  return Conformation::fold_tree();
173  }
174 
175  /// @brief Get the transformation controlling resid i
176  numeric::HomogeneousTransform< core::Real >
178 
179  /// @brief Remap coordinate X from resid i's frame to resid j's frame
181  apply_transformation( PointPosition Xin, core::Size residfrom, core::Size residto );
182 
183  /// @brief Symmetric set_xyz
184  virtual void
185  set_xyz( AtomID const & id, PointPosition const & position );
186 
187  /// @brief Symmetric batch_set_xyz
188  virtual void
190  utility::vector1<AtomID> const & ids,
191  utility::vector1<PointPosition> const & positions
192  );
193 
194  ///
195  virtual
197 
198  /// @brief Append a new residue by a jump; clones this append to all copies
199  void
201  conformation::Residue const & new_rsd,
202  Size const anchor_residue,
203  std::string const& anchor_atom = "", // the atom in the anchor_residue
204  std::string const& root_atom = "", // the atom in the new residue
205  bool const start_new_chain = false
206  );
207 
208  /// @brief Append a new conformation by a jump; clones this append to all copies
209  void
211  Conformation const & conf, // the conformation to be inserted
212  Size const insert_seqpos, // rsd 1 in conf goes here
213  Size const insert_jumppos, // jump#1 in conf goes here, see insert_fold_tree_by_jump
214  Size const anchor_pos, // in the current sequence numbering, ie before insertion of conf
215  Size const anchor_jump_number = 0, // the desired jump number of the anchoring jump, default=0
216  std::string const & anchor_atom = "", // "" means take default anchor atom
217  std::string const & root_atom = "" // "" means take default root atom
218  );
219 
220  //fpd eventually we should have symmetric implementations of all the insert/append/delete residue functions
221 
222  virtual
223  void
225 
226 
227 private:
228 
229  /////////////////////////////////////////////////////////////////////////////
230  // private methods
231  /////////////////////////////////////////////////////////////////////////////
232 
233  // public: -- apl -- does this need to be public?
234 
235  // utility function gets the nearest upstream virtual
236  core::Size
237  get_upstream_vrt( core::Size seqpos ) const;
238 
239  // force recomputation of Tsymm_'s from the current conformation
240  void
242 
243 #ifdef USEBOOSTSERIALIZE
244  friend class boost::serialization::access;
245 
246  template<class Archive>
247  void serialize(Archive & ar, const unsigned int version){
248  ar & boost::serialization::base_object<Conformation>(*this);
249  ar & symm_info_;
250  }
251 
252 #endif
253 
254 
255 private:
256 
257  /////////////////////////////////////////////////////////////////////////////
258  // data
259  /////////////////////////////////////////////////////////////////////////////
260 
262 
263  // stores the symmetric transformation between subunits
264  // computed when needed, invalidated when a jump changes
266 
267 };
268 
269 } // symmetry
270 } // conformation
271 } // core
272 
273 
274 
275 #endif