Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ChemicalShiftAnisotropy.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/scoring/ChemicalShiftAnisotropy.hh
11 /// @brief Uses NMR CSA for scoring
12 /// @author Lei Shi
13 
14 #ifndef INCLUDED_core_scoring_ChemicalShiftAnisotropy_hh
15 #define INCLUDED_core_scoring_ChemicalShiftAnisotropy_hh
16 
18 #include <core/types.hh>
19 #include <numeric/xyzVector.hh>
20 #include <numeric/xyzMatrix.hh>
21 
22 #include <basic/datacache/CacheableData.hh>
23 #include <numeric/numeric.functions.hh>
24 #include <core/pose/Pose.fwd.hh>
25 
26 //Auto Headers
27 #include <utility/vector1_bool.hh>
28 
29 namespace core {
30 namespace scoring {
31 
35 
36 ///@brief ChemicalShiftAnisotropys are mainly handled by this class
37 ///@detail related classed: CSA --- a single line in an CSA file - representing a single csa coupling
38 /// ChemicalShiftAnisotropyEnergy -- an energy method which triggers computations handled by this class.
39 ///
40 class ChemicalShiftAnisotropy: public basic::datacache::CacheableData {
41  // friend class ChemicalShiftAnisotropyEnergy;
42 public:
43  // typedefs
44  typedef core::Size Size;
46 
47 public:
48 //need to make sure it reads as the flags
49  /// @brief standard c'stor -- will access option -in:file:csa to read CSA data
51  if (filename != "" ) {
53  }else {
54  read_CSA_file( );
55  }
56  }
57 
58  //explicit copy c'stor to initialize buffers
60 
61  //explicit assignment operator to initialize buffers
63 
64  //explicit destructor because we use raw pointers for buffers
66 
67  //this class lives in the PoseCache.... need to provide clone()
68  basic::datacache::CacheableDataOP clone() const {
69  return new ChemicalShiftAnisotropy(*this);
70  }
71 
72  ///@brief compute csa score for given pose (non-constant due to membrane)
74 
75  void show(std::ostream&) const;
76 
77  ///@brief get the raw CSA data
78  inline CSA_lines const& get_CSA_data() const {
79  return All_CSA_lines_;
80  }
81 
82 private:
83  ///@brief read CSA data from file
84  void read_CSA_file( std::string const& filename );
85  void read_CSA_file( );
86 
87 private:
88  /// some internal buffers in
90 };
91 
92 
93 /////////////////////////////////////////////////
94 //@brief short class that stores the CSA data lines
95 /////////////////////////////////////////////////
96 class CSA {
97 
98 public:
99  CSA() :
101  res1_(),
102  res2_(),
103  res3_(),
104  sigma1_(),
105  sigma2_(),
106  sigma3_(),
107  alpha_(),
108  beta_(),
109  gamma_(),
110  CSAval_(),
111  CSAerr_(),
112  weight_()
113  {
114  }
115 
117  CSAval_computed_(-999),f1ij_(0.0),f2ij_(0.0),f3ij_(0.0),
118  res1_(res1), res2_(res1-1), res3_(res1),
119  atom1_(atom1), atom2_("C"), atom3_("CA"),
120  sigma1_(sigma1), sigma2_(sigma2), sigma3_(sigma3),
121  alpha_(0), beta_(105), gamma_(0),
122  CSAval_(CSAval), CSAerr_(CSAerr),
123  weight_(weight)
124  {}
125 
126  inline Size res1() const {
127  return res1_;
128  }
129 
130  inline Size res2() const {
131  return res2_;
132  }
133 
134  inline Size res3() const {
135  return res3_;
136  }
137 
138  std::string const& atom1() const {
139  return atom1_;
140  }
141 
142  std::string const& atom2() const {
143  return atom2_;
144  }
145 
146  std::string const& atom3() const {
147  return atom3_;
148  }
149 
150  inline Real sigma1() const {
151  return sigma1_;
152  }
153 
154  inline Real sigma2() const {
155  return sigma2_;
156  }
157 
158  inline Real sigma3() const {
159  return sigma3_;
160  }
161 
162  inline Real alpha() const {
163  return alpha_;
164  }
165 
166  inline Real beta() const {
167  return beta_;
168  }
169 
170  inline Real gamma() const {
171  return gamma_;
172  }
173 
174  inline Real CSAval() const {
175  return CSAval_;
176  }
177 
178  inline Real CSAerr() const {
179  return CSAerr_;
180  }
181 
182  Real const& CSAcomputed() const {
183  return CSAval_computed_;
184  }
185 
187  return CSAval_computed_;
188  }
189 
190  Vector f1ij() const {
191  return f1ij_;
192  }
193 
194  Vector f2ij() const {
195  return f2ij_;
196  }
197 
198  Vector f3ij() const {
199  return f3ij_;
200  }
201 
202 
203  Real weight() const {
204  return weight_;
205  }
206 
207  void set_weight(Real w_in) {
208  weight_ = w_in;
209  }
210 
212 
213  void show(std::ostream&) const;
214 
215 public :
220 
221 private:
228 
229 };
230 
231 extern std::ostream& operator<<(std::ostream&, ChemicalShiftAnisotropy const&);
232 extern std::ostream& operator<<(std::ostream&, CSA const&);
233 
234 } //scoring
235 } //core
236 #endif