Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SS_Info2.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 ./src/protocols/fldsgn/topology/SS_Info2.hh
11 /// @brief
12 /// @author Nobuyasu Koga ( nobuyasu@u.washington.edu )
13 
14 #ifndef INCLUDED_protocols_fldsgn_topology_SS_Info2_hh
15 #define INCLUDED_protocols_fldsgn_topology_SS_Info2_hh
16 
17 /// Unit headers
19 
20 /// Package headers
22 
23 // Project headers
24 #include <core/types.hh>
25 #include <basic/datacache/CacheableData.hh>
26 
27 /// Numeric headers
28 #include <numeric/xyzVector.hh>
29 
30 // C++ headers
31 #include <string>
32 
33 #include <utility/vector1.hh>
34 
35 
36 namespace protocols {
37 namespace fldsgn {
38 namespace topology {
39 
41 public:
42 
43 
44  typedef core::Size Size;
45  typedef core::Real Real;
48 
49 
50 public:// construct/destruct
51 
52 
53  /// @brief default constructor
54  SS_Base();
55 
56  /// @brief value constructor
57  SS_Base( Size const & begin, Size const & end );
58 
59  /// @brief value constructor
60  // SS_Base( Size const & begin, Size const & end, Vector const & v );
61 
62  /// @brief copy constructor
63  SS_Base( SS_Base const & s );
64 
65  /// @brief destructor
66  virtual ~SS_Base();
67 
68 
69 public:// accessors
70 
71 
72  inline Size begin() const { return begin_; }
73 
74  inline Size end() const { return end_; }
75 
76  inline Size length() const { return end_ - begin_ + 1; }
77 
78  inline Vector orient() const { return orient_; }
79 
80  inline Vector Nend_orient() const { return Nend_orient_; }
81 
82  inline Vector Cend_orient() const { return Cend_orient_; }
83 
84  inline Vector Nend_pos() const { return Nend_pos_; }
85 
86  inline Vector Cend_pos() const { return Cend_pos_; }
87 
88  inline Vector mid_pos() const { return mid_pos_; }
89 
90 
91 public:// accessors
92 
93 
94  inline bool is_geometry_initialized() const { return is_geometry_initialized_; }
95 
96 
97 protected: // setters
98 
99 
100  /// @brief set vector from Ca of Nterminal to Ca of Cterminal
101  void orient( Vector const & v ) { orient_ = v; }
102 
103  /// @brief set orient vector of N-terminal SS
104  void Nend_orient( Vector const & v ) { Nend_orient_ = v; }
105 
106  /// @brief set orient vector of C-terminal SS
107  void Cend_orient( Vector const & v ) { Cend_orient_ = v; }
108 
109  /// @brief set positional vector of N-terminal
110  void Nend_pos( Vector const & v ) { Nend_pos_ = v; }
111 
112  /// @brief set positional vector of C-terminal
113  void Cend_pos( Vector const & v ) { Cend_pos_ = v; }
114 
115  /// @brief set positional vector of mid point
116  void mid_pos( Vector const & v ) { mid_pos_ = v; }
117 
118  /// @brief set geometry is initialized or not
119  void is_geometry_initialized( bool const v ) { is_geometry_initialized_ = v; }
120 
121 
122 private: ///data
123 
124 
125  /// @brief begintial residue of strand
127 
128  /// @brief end residue of strand
130 
131  /// @brief
133 
134  /// @brief orient vector from Ca of Nterminal to Ca of Cterminal
136 
137  /// @brief orient vector of Nterminal end
139 
140  /// @brief orient vector of Cterminal end
142 
143  /// @brief positional vector of N- and C- teriminals
145 
146  /// @brief positional vector of mid point
148 
149 
150 };
151 
152 //////////////////////////////////////////////////////////////////////////////////////////////////////
153 class Strand : public SS_Base {
154 
155 
156  typedef SS_Base Parent;
157 
158 
159 public:// construct/destruct
160 
161 
162  /// @brief default constructor
163  Strand();
164 
165  /// @brief value constructor
166  Strand( Size const & begin, Size const & end );
167 
168  /// @brief copy constructor
169  Strand( Strand const & s );
170 
171  /// @brief destructor
172  ~Strand();
173 
174  /// @brief
175  friend std::ostream & operator<<(std::ostream & out, const Strand & st );
176 
177 
178 public:
179 
180 
181  // @brief
182  void calc_geometry( BB_Pos const & bbpos );
183 
184 
185 };
186 
187 //////////////////////////////////////////////////////////////////////////////////////////////////////
188 class Helix : public SS_Base {
189 
190 
191  typedef SS_Base Parent;
193 
194 
195 public: // constructor/destructor
196 
197 
198  /// @brief default constructor
199  Helix();
200 
201  /// @brief value constructor
202  Helix( Size const & begin, Size const & end );
203 
204  /// @brief copy constructor
205  Helix( Helix const & s );
206 
207  /// @brief destructor
208  ~Helix();
209 
210  /// @brief
211  Real bend() const { return bend_; }
212 
213  /// @brief
214  friend std::ostream & operator<<( std::ostream & out, const Helix & hx );
215 
216 
217 public: //
218 
219 
220  /// @brief calc geometry of helix
221  void calc_geometry( BB_Pos const & bbpos );
222 
223 
224 private: // data
225 
226 
228 
229 
230 };
231 
232 //////////////////////////////////////////////////////////////////////////////////////////////////////
233 class Loop : public SS_Base {
234 
236  typedef SS_Base Parent;
238 
239 
240 public: // constructor/destructor
241 
242 
243  /// @brief default constructor
244  Loop();
245 
246  /// @brief value constructor
247  Loop( Size const & begin, Size const & end, String const & type="" );
248 
249  /// @brief copy constructor
250  Loop( Loop const & s );
251 
252  /// @brief destructor
253  ~Loop();
254 
255  /// @brief
256  friend std::ostream & operator<<( std::ostream & out, const Loop & hx );
257 
258 
259 public:
260 
261  String type() const { return type_; };
262 
263 public:
264 
265  /// @brief
266  String type_;
267 
268 
269 };
270 
271 //////////////////////////////////////////////////////////////////////////////////////////////////////
272 class SS_Info2 : public basic::datacache::CacheableData {
273 
274 
275  typedef core::Size Size;
279 
280 
281 public: // constructor/destructor
282 
283 
284  /// @brief default constructor
285  SS_Info2();
286 
287  /// @brief value constructor
288  SS_Info2( String const & secstruct );
289 
290  /// @brief value constructor
291  SS_Info2( Pose const & pose, String const & secstruct = "" );
292 
293  /// @brief copy constructor
294  SS_Info2( SS_Info2 const & s );
295 
296  /// @brief destructor
297  ~SS_Info2();
298 
299 
300 public:
301 
302 
303  /// @brief make clone
304  basic::datacache::CacheableDataOP clone() const;
305 
306  /// @brief output info of SS_Info2
307  friend
308  std::ostream & operator<<(std::ostream & out, const SS_Info2 & ssinfo );
309 
310  /// @brief initialize parameters of this class
311  void initialize( String const & secstruct );
312 
313  /// @brief initialize parameters of this class
314  void initialize( Pose const & pose, String const & secstruct = "" );
315 
316 
317 public:
318 
319 
320  /// @brief get flag for telling whether bb_pos_ was initiliazed by pose or not
321  inline
322  bool
323  bbpos_is_set() const
324  {
325  return bbpos_is_set_;
326  }
327 
328  /// @brief string of secondary structure elements
329  inline
330  String
331  secstruct() const
332  {
333  return secstruct_;
334  }
335 
336  inline
337  char
338  secstruct( Size ii ) const
339  {
340  return secstruct_.at( ii-1 );
341  }
342 
343  /// @brief get xyz-coordinates of backbone structure
344  inline
345  BB_Pos const &
346  bb_pos() const
347  {
348  return bb_pos_;
349  }
350 
351  /// @brief return strands
352  inline
353  Strands const &
354  strands() const
355  {
356  return strands_;
357  }
358 
359  /// @brief return helices
360  inline
361  Helices const &
362  helices() const
363  {
364  return helices_;
365  }
366 
367  /// @brief return loops
368  inline
369  Loops const &
370  loops() const
371  {
372  return loops_;
373  }
374 
375  /// @brief return owning pointer of strand given an index of strands
376  StrandCOP const
377  strand( Size is ) const
378  {
379  runtime_assert( is <= strands_.size() );
380  return strands_[ is ];
381  }
382 
383  /// @brief return owning pointer of helix given an index of helices
384  HelixCOP const
385  helix( Size ih ) const
386  {
387  runtime_assert( ih <= helices_.size() );
388  return helices_[ ih ];
389  }
390 
391  /// @brief return owning pointer of loop given an index of loops
392  LoopCOP const
393  loop( Size il ) const
394  {
395  runtime_assert( il <= loops_.size() );
396  return loops_[ il ];
397  }
398 
399  /// @brief return strand index in strands given a residue number
400  inline
401  Size
402  strand_id( Size const nres ) const
403  {
404  return strand_id_[ nres ];
405  }
406 
407  /// @brief return helix index in helices given a residue number
408  inline
409  Size
410  helix_id( Size const nres ) const
411  {
412  return helix_id_[ nres ];
413  }
414 
415  /// @brief return loop index in loops given a residue number
416  inline
417  Size
418  loop_id( Size const nres ) const
419  {
420  return loop_id_[ nres ];
421  }
422 
423  /// @brief return the index of secondary structure element given a residue number
424  inline
425  Size
426  ss_element_id( Size const nres ) const
427  {
428  return ss_element_id_[ nres ];
429  }
430 
431 
432 
433 public:
434 
435 
436  /// @brief set orientation vector of secondary structures given a pose
437  void set_SSorient( Pose const & pose );
438 
439  /// @brief set orientation vector of secondary structures given a pose which is defined in the constructor
440  void set_SSorient();
441 
442  /// @brief clear data
443  void clear_data();
444 
445 
446 private:
447 
448 
449  /// @brief
450  void
451  resize( Size const nres );
452 
453  /// @brief identify secondary structures
454  void identify_ss( String const & secstruct );
455 
456 
457 private: //data
458 
459 
460  /// @brief flag for telling whether bb_pos_ was initiliazed by pose or not
462 
463  /// @brief string of secondary structure elements
465 
466  /// @brief xyz-coordinates of backbone
468 
469  /// @brief vector of StrandOP
471 
472  /// @brief vector for storing index of strand id for each residue position
474 
475  /// @brief vector of HelixOP
477 
478  /// @brief vector for storing index of helix id for each residue position
480 
481  /// @brief vector of loops
484 
485  /// @brief vector for storing index of secondary structure element for each residue position
487 
488 
489 };
490 
491 } // namespace topology
492 } // namespace fldsgn
493 } // naemspace protocols
494 
495 #endif