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 protocols/frag_picker/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_protocols_frag_picker_VallResidue_hh
15 #define INCLUDED_protocols_frag_picker_VallResidue_hh
16 
17 // unit headers
19 
20 // project headers
22 
23 // type headers
24 #include <core/types.hh>
25 
26 // utility headers
27 #include <utility/pointer/owning_ptr.hh>
28 #include <utility/pointer/ReferenceCount.hh>
29 // AUTO-REMOVED #include <utility/vector1.hh>
30 
31 // project headers
32 #include <core/chemical/AA.hh>
33 // AUTO-REMOVED #include <core/fragment/BBTorsionSRFD.hh>
34 
35 // C++ headers
36 #include <iostream>
37 #include <map>
38 
39 //Auto Headers
41 #include <utility/vector1_bool.hh>
42 
43 
44 namespace protocols {
45 namespace frag_picker {
46 
47 /// @brief class for managing a line of the Vall fragment library
49 
50 public:
51  // typedefs
52 
53  typedef core::Size Size;
54  typedef core::Real Real;
56 
59 
60 public:
61  // construct/destruct
62 
63  /// @brief default constructor
64  VallResidue();
65 
66  /// @brief string constructor
67  VallResidue(String const & line);
68 
69  /// @brief copy constructor
70  VallResidue(VallResidue const & rval);
71 
72  /// @brief default destructor
73  virtual ~VallResidue();
74 
75 public:
76  /// @brief copy assignment
77  VallResidue & operator =(VallResidue const & rval);
78 
79 public:
80  /// @brief build a BBTorsionSRFD from this page
82 
83 public:
84  /// @brief id of fragment source (e.g. pdb name)
85  inline String const & id() const {
86  return id_;
87  }
88 
89  /// @brief sets the key id
90  void key(Size key) { key_ = key; }
91 
92  /// @brief sets the key id
93  Size key() { return key_; }
94 
95  /// @brief one letter amino acid code
96  inline
97  char aa() const {
98  return aa_;
99  }
100 
101  /// @brief one letter secondary structure code
102  inline
103  char ss() const {
104  return ss_;
105  }
106 
107  /// @brief one letter secondary structure STR code
108  inline
109  char ss_str() const {
110  return ss_str_;
111  }
112 
113  /// @brief residue sequence number in source
114  inline Size resi() const {
115  return resi_;
116  }
117 
118  /// @brief x-coordinate of C-alpha
119  inline Real x() const {
120  return x_;
121  }
122 
123  /// @brief y-coordinate of C-alpha
124  inline Real y() const {
125  return y_;
126  }
127 
128  /// @brief z-coordinate of C-alpha
129  inline Real z() const {
130  return z_;
131  }
132 
133  /// @brief x-coordinate of C-beta
134  inline Real cbx() const {
135  return cbx_;
136  }
137 
138  /// @brief y-coordinate of C-beta
139  inline Real cby() const {
140  return cby_;
141  }
142 
143  /// @brief z-coordinate of C-beta
144  inline Real cbz() const {
145  return cbz_;
146  }
147 
148  /// @brief x-coordinate of centroid
149  inline Real cenx() const {
150  return cenx_;
151  }
152 
153  /// @brief y-coordinate of centroid
154  inline Real ceny() const {
155  return ceny_;
156  }
157 
158  /// @brief z-coordinate of centroid
159  inline Real cenz() const {
160  return cenz_;
161  }
162 
163  /// @brief solvent accessible area
164  inline Real sa() const {
165  return sa_;
166  }
167 
168  /// @brief solvent accessible area normalized
169  inline Real sa_norm() const {
170  return sa_norm_;
171  }
172 
173  /// @brief phi backbone torsion in degrees from DSSP
174  inline Real dssp_phi() const {
175  return dssp_phi_;
176  }
177 
178  /// @brief psi backbone torsion in degrees from DSSP
179  inline Real dssp_psi() const {
180  return dssp_psi_;
181  }
182 
183  /// @brief all-atom residue depth
184  inline Real depth() const {
186  }
187 
188  /// @brief number of alignments
189  inline Size nali() const {
190  return nali_;
191  }
192 
193  /// @brief phi backbone torsion in degrees
194  inline Real phi() const {
195  return phi_;
196  }
197 
198  /// @brief psi backbone torsion in degrees
199  inline Real psi() const {
200  return psi_;
201  }
202 
203  /// @brief omega backbone torsion in degrees
204  inline Real omega() const {
205  return omega_;
206  }
207 
208  /// @brief b factor average for backbone
209  inline Real bF() const {
210  return bF_;
211  }
212 
213  /// @brief per amino acid profile data
214  inline utility::vector1<Real> const & profile() const {
215  return profile_;
216  }
217 
218  /// @brief per amino acid structure profile data
219  inline utility::vector1<Real> const & profile_struct() const {
220  return profile_struct_;
221  }
222 
223  /// @brief secondary chemical shifts
225  return sec_shift_data_;
226  }
227 
228  /// @brief per amino acid profile data
229  inline void profile(utility::vector1<Real> const & v) {
230  profile_ = v;
231  }
232 
233  /// @brief per amino acid structure profile data
234  inline void profile_struct(utility::vector1<Real> const & v) {
235  profile_struct_ = v;
236  }
237 
238  /// @brief stores the 1-based indexing for accessing this residue
239  /// via VallSection::operator []
240  inline Size position_index() const {
241  return position_index_;
242  }
243 
244  /// @brief stores the 1-based indexing for accessing the VallSection
245  /// this residue is located in via VallLibrary::operator []
246  inline Size section_index() const {
247  return section_index_;
248  }
249 
250 public:
251  // mutators
252 
253  /// @brief id of fragment source (e.g. pdb name)
254  inline
255  void id(String const & s) {
256  id_ = s;
257  }
258 
259  /// @brief one letter amino acid code
260  inline
261  void aa(char const c) {
262  aa_ = c;
263  }
264 
265  /// @brief one letter secondary structure code
266  inline
267  void ss(char const c) {
268  ss_ = c;
269  }
270 
271  /// @brief one letter secondary structure STR code
272  inline
273  void ss_str(char const c) {
274  ss_str_ = c;
275  }
276 
277  inline
279  switch(ss_str_) {
280  case 'H':
281  ss_ = 'H';
282  break;
283  case 'G':
284  ss_ = 'H';
285  break;
286  case 'I':
287  ss_ = 'H';
288  break;
289  case 'A':
290  ss_ = 'E';
291  break;
292  case 'E':
293  ss_ = 'E';
294  break;
295  case 'M':
296  ss_ = 'E';
297  break;
298  case 'P':
299  ss_ = 'E';
300  break;
301  case 'Q':
302  ss_ = 'E';
303  break;
304  case 'Z':
305  ss_ = 'E';
306  break;
307  case 'B':
308  ss_ = 'E';
309  break;
310  default:
311  ss_ = 'L';
312  }
313  }
314 
315  /// @brief residue sequence number in source
316  inline
317  void resi(Size const i) {
318  resi_ = i;
319  }
320 
321  /// @brief x-coordinate of C-alpha
322  inline
323  void x(Real const val) {
324  x_ = val;
325  }
326 
327  /// @brief y-coordinate of C-alpha
328  inline
329  void y(Real const val) {
330  y_ = val;
331  }
332 
333  /// @brief z-coordinate of C-alpha
334  inline
335  void z(Real const val) {
336  z_ = val;
337  }
338 
339 
340  /// @brief x-coordinate of C-beta
341  inline
342  void cbx(Real const val) {
343  cbx_ = val;
344  }
345 
346  /// @brief y-coordinate of C-beta
347  inline
348  void cby(Real const val) {
349  cby_ = val;
350  }
351 
352  /// @brief z-coordinate of C-beta
353  inline
354  void cbz(Real const val) {
355  cbz_ = val;
356  }
357 
358  /// @brief x-coordinate of centroid
359  inline
360  void cenx(Real const val) {
361  cenx_ = val;
362  }
363 
364  /// @brief y-coordinate of centroid
365  inline
366  void ceny(Real const val) {
367  ceny_ = val;
368  }
369 
370  /// @brief z-coordinate of centroid
371  inline
372  void cenz(Real const val) {
373  cenz_ = val;
374  }
375 
376 
377  /// @brief solvent accessible area
378  inline
379  void sa(Real const val) {
380  sa_ = val;
381  }
382 
383  /// @brief number of alignments
384  inline
385  void nali(Size const val) {
386  nali_ = val;
387  }
388 
389  /// @brief all-atom residue depth
390  inline
391  void depth(Real const depth) {
393  }
394 
395  /// @brief phi backbone torsion in degrees
396  inline
397  void phi(Real const val) {
398  phi_ = val;
399  }
400 
401  /// @brief psi backbone torsion in degrees
402  inline
403  void psi(Real const val) {
404  psi_ = val;
405  }
406 
407  /// @brief omega backbone torsion in degrees
408  inline
409  void omega(Real const val) {
410  omega_ = val;
411  }
412 
413  /// @brief b factor average for backbone
414  inline
415  void bF(Real const val) {
416  bF_ = val;
417  }
418 
419  /// @brief stores the 1-based indexing for accessing this residue
420  /// via VallSection::operator []
421  inline
422  void position_index(Size const idx) {
423  position_index_ = idx;
424  }
425 
426  /// @brief stores the 1-based indexing for accessing the VallSection
427  /// this residue is located in via VallLibrary::operator []
428  inline
429  void section_index(Size const idx) {
430  section_index_ = idx;
431  }
432 
433 public:
434  // query
435 
436  /// @brief has profile info?
437  inline
438  bool has_profile() const {
439  return profile_.size() > 0;
440  }
441 
442  /// @brief has structure profile info?
443  inline
444  bool has_profile_struct() const {
445  return profile_struct_.size() > 0;
446  }
447 
448  inline
449  bool has_chemical_shifts() const {
450  return sec_shift_data_.size() > 0;
451  }
452 
453 public:
454  // methods
455 
456  /// @brief fill internal data from string
457  void fill_from_string(String const & line);
458 
459  /// @brief fill internal data from string
460  void fill_from_string_cs(String const & line);
461 
462  /// @brief fill internal data from string
463  void fill_from_string_version1(String const & line);
464 
466 
468 
470 
472 
473  Real distance_squared( VallResidueCOP r, ContactType const & type );
474 
475 private:
476  // static methods
477 
478  /// @brief return a vector specifying the order of profile data in Vall
480 
481  /// @brief return a formatting string for fill_from_string() dependent
482  /// upon actual type of core::Real and core::Size
483  /// @remarks This is necessary for sscanf; wrong type can give wrong
484  /// input.
485  static String format_string();
486  /// @brief return a formatting string for fill_from_string() dependent
487  /// upon actual type of core::Real and core::Size
488  /// @remarks This is necessary for sscanf; wrong type can give wrong
489  /// input.
490  static String format_string_cs();
491 
492  /// @brief return a formatting string for fill_from_string() dependent
493  /// upon actual type of core::Real and core::Size
494  /// @remarks This is necessary for sscanf; wrong type can give wrong
495  /// input.
497 
499 
500 private:
501  // data
502 
503  /// @brief integer key for a residue is simply the line number in a vall file
505 
506  /// @brief id of fragment source (e.g. pdb name)
508 
509  /// @brief one letter amino acid code
510  char aa_;
511 
512  /// @brief one letter secondary structure code (3 letter alphabet)
513  char ss_;
514 
515  /// @brief one letter secondary structure code (STR alphabet - Karplus et. al.)
516  char ss_str_;
517 
518  /// @brief residue sequence number in source
520 
521  /// @brief b factor average for backbone
523 
524  /// @brief x-coordinate of C-alpha
526 
527  /// @brief y-coordinate of C-alpha
529 
530  /// @brief z-coordinate of C-alpha
532 
533  /// @brief x-coordinate of C-beta
535 
536  /// @brief y-coordinate of C-beta
538 
539  /// @brief z-coordinate of C-beta
541 
542  /// @brief x-coordinate of centroid
544 
545  /// @brief y-coordinate of centroid
547 
548  /// @brief z-coordinate of centroid
550 
551  /// @brief phi backbone torsion in degrees
553 
554  /// @brief psi backbone torsion in degrees
556 
557  /// @brief omega backbone torsion in degrees
559 
560  /// @brief solvent accessible area
562 
563  /// @brief normalized solvent accessible area
565 
566  /// @brief phi backbone torsion in degrees from DSSP program
568 
569  /// @brief psi backbone torsion in degrees from DSSP program
571 
572  /// @brief number of alignments used for profile
574 
575  /// @brief per amino acid profile data
577 
578  /// @brief per amino acid structure profile data
580 
582 
583  /// @brief stores the 1-based indexing for accessing this residue
584  /// via VallSection::operator []
586 
587  /// @brief stores the 1-based indexing for accessing the VallSection
588  /// this residue is located in via VallLibrary::operator []
590 
592 
593 private:
594  // static data
595 
596  /// @brief order of amino acid profile data in Vall
598 
599 };
600 
601 } // frag_picker
602 } // protocols
603 
604 
605 #endif /* INCLUDED_protocols_frag_picker_VallResidue_HH */