Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DipolarCoupling.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/DipolarCoupling.hh
11 /// @brief Uses NMR DC for scoring
12 /// @author Lei Shi
13 
14 #ifndef INCLUDED_core_scoring_DipolarCoupling_hh
15 #define INCLUDED_core_scoring_DipolarCoupling_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 DipolarCouplings are mainly handled by this class
37 ///@detail related classed: DC --- a single line in an DC file - representing a single dc coupling
38 /// DipolarCouplingEnergy -- an energy method which triggers computations handled by this class.
39 ///
40 class DipolarCoupling: public basic::datacache::CacheableData {
41  // friend class DipolarCouplingEnergy;
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:dc to read DC data
51  if (filename != "" ) {
53  }else {
54  read_DC_file( );
55  }
56  }
57 
58  //explicit copy c'stor to initialize buffers
59  DipolarCoupling(DipolarCoupling const& other);
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 DipolarCoupling(*this);
70  }
71 
72  ///@brief compute dc score for given pose (non-constant due to membrane)
74 
75  void show(std::ostream&) const;
76 
77  ///@brief get the raw DC data
78  inline DC_lines const& get_DC_data() const {
79  return All_DC_lines_;
80  }
81 
82 private:
83  ///@brief read DC data from file
84  void read_DC_file( std::string const& filename );
85  void read_DC_file( );
86 
87 private:
88  /// some internal buffers in
90 };
91 
92 
93 /////////////////////////////////////////////////
94 //@brief short class that stores the DC data lines
95 /////////////////////////////////////////////////
96 class DC {
97 
98 public:
99  enum DC_TYPE {
101  };
102 
103  DC() :
104  DCval_computed_(),
105  type_(),
106  res1_(),
107  res2_(),
108  DCval_(),
109  DCerr_(),
110  weight_()
111  {}
112 
114  DCval_computed_(-999), f1ij_(0.0), f2ij_(0.0),
115  type_(get_DC_data_type(atom1, atom2)),
116  res1_(res1), res2_(res2),
117  atom1_(atom1), atom2_(atom2),
118  DCval_(DCval), DCerr_(DCerr),
119  weight_(weight)
120  {}
121 
122  DC_TYPE type() const {
123  return type_;
124  }
125 
127 
128  inline Size res1() const {
129  return res1_;
130  }
131 
132  inline Size res2() const {
133  return res2_;
134  }
135 
136  std::string const& atom1() const {
137  return atom1_;
138  }
139 
140  std::string const& atom2() const {
141  return atom2_;
142  }
143 
144  inline Real DCval() const {
145  return DCval_;
146  }
147 
148  inline Real DCerr() const {
149  return DCerr_;
150  }
151 
152  Real const& DCcomputed() const {
153  return DCval_computed_;
154  }
155 
157  return DCval_computed_;
158  }
159 
160  Vector f1ij() const {
161  return f1ij_;
162  }
163 
164  Vector f2ij() const {
165  return f2ij_;
166  }
167 
168 
169  Real weight() const {
170  return weight_;
171  }
172 
173  void set_weight(Real w_in) {
174  weight_ = w_in;
175  }
176 
177 
178 //Dcconst()/3/r^3/2
179  inline Real Dconst() const {
180  core::Real Dcnst(0.0);
181  if (type() == DC_TYPE_NH)
182  Dcnst = 10.735/2;
183  //Dcnst = 36.5089/3/1.04/1.04/1.04/2;
184  if (type() == DC_TYPE_NC)
185  Dcnst = 9.179532/3/1.341/1.341/1.341/2;
186  if (type() == DC_TYPE_CH)
187  Dcnst = 90.55324/3/1.08/1.08/1.08/2;
188  if (type() == DC_TYPE_CC)
189  Dcnst = 22.76805/3/1.525/1.525/1.525/2;
190  runtime_assert( Dcnst != 0 );
191  return Dcnst;
192  }
193 
194  friend class DipolarCoupling;
195 
196  void show(std::ostream&) const;
197 
198 public :
202 
203 private:
209 
210 };
211 
212 extern std::ostream& operator<<(std::ostream&, DipolarCoupling const&);
213 extern std::ostream& operator<<(std::ostream&, DC const&);
214 
215 } //scoring
216 } //core
217 #endif