Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VallResidue.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/fragment/picking_old/vall/VallResidue.hh
11 /// @brief class for managing a line of the Vall fragment library
12 /// @author Yih-En Andrew Ban (yab@u.washington.edu)
13 
14 #ifndef INCLUDED_core_fragment_picking_old_vall_VallResidue_hh
15 #define INCLUDED_core_fragment_picking_old_vall_VallResidue_hh
16 
17 
18 // unit headers
20 
21 // type headers
22 #include <core/types.hh>
23 
24 // project headers
25 #include <core/chemical/AA.hh>
27 
28 // utility headers
29 #include <utility/pointer/owning_ptr.hh>
30 // AUTO-REMOVED #include <utility/vector1.hh>
31 
32 // C++ headers
33 #include <iostream>
34 
35 #include <utility/vector1.hh>
36 
37 
38 
39 
40 namespace core {
41 namespace fragment {
42 namespace picking_old {
43 namespace vall {
44 
45 
46 /// @brief class for managing a line of the Vall fragment library
47 class VallResidue {
48 
49 
50 public: // typedefs
51 
52 
53  typedef core::Size Size;
54  typedef core::Real Real;
56 
59 
60 
61 public: // construct/destruct
62 
63 
64  /// @brief default constructor
65  VallResidue();
66 
67 
68  /// @brief string constructor
69  VallResidue( String const & line );
70 
71 
72  /// @brief copy constructor
73  VallResidue( VallResidue const & rval );
74 
75 
76  /// @brief default destructor
77  ~VallResidue();
78 
79 
80 public: // copy assignment
81 
82 
83  /// @brief copy assignment
84  VallResidue & operator =( VallResidue const & rval );
85 
86 
87 public: // conversion
88 
89 
90  /// @brief build a BBTorsionSRFD of the given type from this page
91  /// @param[in] srfd_type BBTorsionSRFD::create() will be called from this object.
92  /// @return A BBTorsionSRFD of the given type initialized with the backbone
93  /// torsion information from this page.
94  BBTorsionSRFDOP bbtorsion_srfd( BBTorsionSRFD const & srfd_type = BBTorsionSRFD() ) const;
95 
96 
97 public: // accessors
98 
99 
100  /// @brief id of fragment source (e.g. pdb name)
101  inline
102  String const & id() const {
103  return id_;
104  }
105 
106 
107  /// @brief one letter amino acid code
108  inline
109  char aa() const {
110  return aa_;
111  }
112 
113 
114  /// @brief one letter secondary structure code
115  inline
116  char ss() const {
117  return ss_;
118  }
119 
120 
121  /// @brief residue sequence number in source
122  inline
123  Size resi() const {
124  return resi_;
125  }
126 
127 
128  /// @brief x-coordinate of C-alpha
129  inline
130  Real x() const {
131  return x_;
132  }
133 
134 
135  /// @brief y-coordinate of C-alpha
136  inline
137  Real y() const {
138  return y_;
139  }
140 
141 
142  /// @brief z-coordinate of C-alpha
143  inline
144  Real z() const {
145  return z_;
146  }
147 
148 
149  /// @brief phi backbone torsion in degrees
150  inline
151  Real phi() const {
152  return phi_;
153  }
154 
155 
156  /// @brief psi backbone torsion in degrees
157  inline
158  Real psi() const {
159  return psi_;
160  }
161 
162 
163  /// @brief omega backbone torsion in degrees
164  inline
165  Real omega() const {
166  return omega_;
167  }
168 
169 
170  /// @brief per amino acid profile data
171  inline
173  return profile_;
174  }
175 
176 
177  /// @brief stores the 1-based indexing for accessing this residue
178  /// via VallSection::operator []
179  inline
181  return position_index_;
182  }
183 
184 
185  /// @brief stores the 1-based indexing for accessing the VallSection
186  /// this residue is located in via VallLibrary::operator []
187  inline
188  Size section_index() const {
189  return section_index_;
190  }
191 
192 
193 public: // mutators
194 
195 
196  /// @brief id of fragment source (e.g. pdb name)
197  inline
198  void id( String const & s ) {
199  id_ = s;
200  }
201 
202 
203  /// @brief one letter amino acid code
204  inline
205  void aa( char const c ) {
206  aa_ = c;
207  }
208 
209 
210  /// @brief one letter secondary structure code
211  inline
212  void ss( char const c ) {
213  ss_ = c;
214  }
215 
216 
217  /// @brief residue sequence number in source
218  inline
219  void resi( Size const i ) {
220  resi_ = i;
221  }
222 
223 
224  /// @brief x-coordinate of C-alpha
225  inline
226  void x( Real const val ) {
227  x_ = val;
228  }
229 
230 
231  /// @brief y-coordinate of C-alpha
232  inline
233  void y( Real const val ) {
234  y_ = val;
235  }
236 
237 
238  /// @brief z-coordinate of C-alpha
239  inline
240  void z( Real const val ) {
241  z_ = val;
242  }
243 
244 
245  /// @brief phi backbone torsion in degrees
246  inline
247  void phi( Real const val ) {
248  phi_ = val;
249  }
250 
251 
252  /// @brief psi backbone torsion in degrees
253  inline
254  void psi( Real const val ) {
255  psi_ = val;
256  }
257 
258 
259  /// @brief omega backbone torsion in degrees
260  inline
261  void omega( Real const val ) {
262  omega_ = val;
263  }
264 
265 
266  /// @brief per amino acid profile data
267  inline
268  void profile( utility::vector1< Real > const & v ) {
269  profile_ = v;
270  }
271 
272 
273  /// @brief stores the 1-based indexing for accessing this residue
274  /// via VallSection::operator []
275  inline
276  void position_index( Size const idx ) {
277  position_index_ = idx;
278  }
279 
280 
281  /// @brief stores the 1-based indexing for accessing the VallSection
282  /// this residue is located in via VallLibrary::operator []
283  inline
284  void section_index( Size const idx ) {
285  section_index_ = idx;
286  }
287 
288 
289 public: // query
290 
291 
292  /// @brief has profile info?
293  inline
294  bool has_profile() const {
295  return profile_.size() > 0;
296  }
297 
298 
299 public: // methods
300 
301 
302  /// @brief fill internal data from string
303  void fill_from_string( String const & line );
304 
305 
306 private: // static methods
307 
308 
309  /// @brief return a vector specifying the order of profile data in Vall
311 
312 
313  /// @brief return a formatting string for fill_from_string() dependent
314  /// upon actual type of core::Real and core::Size
315  /// @remarks This is necessary for sscanf; wrong type can give wrong
316  /// input.
317  static String format_string();
318 
319 
320 private: // data
321 
322 
323  /// @brief id of fragment source (e.g. pdb name)
325 
326 
327  /// @brief one letter amino acid code
328  char aa_;
329 
330 
331  /// @brief one letter secondary structure code
332  char ss_;
333 
334 
335  /// @brief residue sequence number in source
337 
338 
339  /// @brief x-coordinate of C-alpha
341 
342 
343  /// @brief y-coordinate of C-alpha
345 
346 
347  /// @brief z-coordinate of C-alpha
349 
350 
351  /// @brief phi backbone torsion in degrees
353 
354 
355  /// @brief psi backbone torsion in degrees
357 
358 
359  /// @brief omega backbone torsion in degrees
361 
362 
363  /// @brief per amino acid profile data
365 
366 
367  /// @brief stores the 1-based indexing for accessing this residue
368  /// via VallSection::operator []
370 
371 
372  /// @brief stores the 1-based indexing for accessing the VallSection
373  /// this residue is located in via VallLibrary::operator []
375 
376 
377 private: // static data
378 
379 
380  /// @brief order of amino acid profile data in Vall
382 
383 
384  /// @brief formatting string for fill_from_string()
385  static String format_;
386 
387 
388 };
389 
390 
391 /// @brief wrapper for a collection of VallResidue
392 class VallResidues : public utility::vector1< VallResidue > {
393 
394 
395 public: // typedefs
396 
397 
398  /// @brief Page typedef required to satisfy concept
399  typedef VallResidue Page;
400 
401 
402 };
403 
404 
405 } // vall
406 } // picking_old
407 } // fragment
408 } // core
409 
410 
411 #endif /* INCLUDED_core_fragment_picking_old_vall_VallResidue_HH */