Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SecondaryStructurePotential.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/ScoringManager.hh
11 /// @brief Scoring manager class header
12 /// @author Andrew Leaver-Fay (leaverfa@email.unc.edu)
13 
14 
15 #ifndef INCLUDED_core_scoring_SecondaryStructurePotential_hh
16 #define INCLUDED_core_scoring_SecondaryStructurePotential_hh
17 
18 #include <core/types.hh>
19 #include <core/pose/Pose.fwd.hh>
20 // AUTO-REMOVED #include <core/scoring/SS_Info.hh>
22 
25 
26 // ObjexxFCL Headers
27 #include <ObjexxFCL/FArray1D.hh>
28 // AUTO-REMOVED #include <ObjexxFCL/FArray1A.hh>
29 #include <ObjexxFCL/FArray2D.hh>
30 #include <ObjexxFCL/FArray4D.hh>
31 
32 // C++ headers
33 #include <string>
34 
36 #include <utility/vector1.hh>
37 #include <utility/pointer/ReferenceCount.hh>
38 
39 
40 namespace core {
41 namespace scoring {
42 
43 
44 /// @brief secondary structure scoring cut from classic rosetta structure.h/structure.cc
46 
47 public:
48 
49  typedef ObjexxFCL::FArray1D< Real > FArray1D_real;
50  typedef ObjexxFCL::FArray2D< Real > FArray2D_real;
51  typedef ObjexxFCL::FArray4D< Real > FArray4D_real;
52  typedef ObjexxFCL::FArray1< Real > FArray1_real;
53  typedef ObjexxFCL::FArray1A< Real > FArray1A_real;
54  typedef ObjexxFCL::FArray1D< int > FArray1D_int;
55  // Symmetry
58 
59 public: // construct/destruct
60 
61  /// @brief default constructor
63 
64  /// @brief default destructor
65  inline
67  {}
68 
69 
70 public: // scoring
71 
72  void
73  setup_for_scoring( pose::Pose & pose ) const;
74 
75  /// @brief score secondary structure
76  void
77  score(
78  pose::Pose const & pose,
79  SecondaryStructureWeights const & weights,
80  Real & hs_score,
81  Real & ss_score,
82  Real & rsigma_score,
83  Real & sheet_score
84  ) const;
85 
86 private:
87 
88  /// @brief score hspair
89  void
90  hspair(
91  pose::Pose const & pose,
92  Real & hs_score
93  ) const;
94 
95  /// @brief score sspair
96  void
97  sspair(
98  pose::Pose const & pose,
99  SecondaryStructureWeights const & weights,
100  Real & ss_score,
101  Real & rsigma_score
102  ) const;
103 
104 
105  float
107  pose::Pose const & pose,
108  Size const & pos1,
109  Size const & pos2,
110  Real const & theta,
111  float const & ss_score
112  ) const;
113 
114  /// @brief This function takes a set of dimer neighbors, and determines how
115  /// many sheets there, and how many strands are in each sheet
116  /// This information is then used to calculate the "poker hand" score,
117  /// which reflects to probability of that distribution of strands and
118  /// sheets.
119 
120  Real
122  pose::Pose const & pose
123  ) const;
124 
125 
126 private: // methods
127 
128  /// @brief identifies secondary structure at the start of scoring and loads the Strands/Helices
129  /// data
130  void
131  identify_ss(
132  pose::Pose const & pose,
133  Helices & helices,
134  Strands & strands
135  ) const;
136 
137  /// @brief function reads in two points in sequence and returns two points in space,
138  /// the endpoints of the axis through an alpha-helix
139  void
140  helix_end(
141  int const & pos1,
142  BB_Pos const & bb_pos,
143  Vector & p1,
144  Vector & p2
145  ) const;
146 
147  /// @brief calculate sum of dot product of the co vectors of strand dimers ss1 and ss2
148  /// with the vector connecting the midpoints of the dimer vectors (vdist)
149  /// also determine return the sign of the dot products for each dimer
150  /// to determine which direction the CO groups point
151  void
152  pair_dp(
153  int const & ss1,
154  int const & ss2,
155  BB_Pos const & bb_pos,
156  Real & dp,
157  Vector const & vdist,
158  int & sign1,
159  int & sign2
160  ) const;
161 
162  /// @brief identifies the sequence separation along the fold tree
163  /// add the gap_size (default 10 ) into seqsep when there is chain break between pos1 and pos2
164  int
166  pose::Pose const & pose,
167  int pos1,
168  int pos2,
169  int gap_size=10
170  ) const;
171 
172 
173 private: // static math methods
174 
175  /// @brief find the vector connecting the midpoints of two line segments
176  /// defined by a1,a2 and a3,a4
177  /// @param[out] dist length of v21
178  /// @param[out] v21 vector connecting midpoints
179  static
180  void
181  dist_pair(
182  Vector const & a1,
183  Vector const & a2,
184  Vector const & a3,
185  Vector const & a4,
186  Real & dist,
187  Vector & cen1,
188  Vector & cen2,
189  Vector & v21
190  );
191 
192  /// @brief find the angle (theta) between two vectors v1 and v2
193  /// and the angle (phi) by which v2 is rotated out of the plane
194  /// defined by v1 and v21 around v1 (ie v1 is the z-axis)
195  static
196  void
197  spherical(
198  Vector const & a2,
199  Vector const & a4,
200  Real & phi,
201  Real & theta,
202  Vector const & cen1,
203  Vector const & cen2,
204  Vector const & v21
205  );
206 
207  /// @brief find angle sigma between vectors cen1->a2 and v21
208  /// @param[out] sig sigma
209  static
210  void
211  sigma(
212  Vector const & a2,
213  Vector const & cen1,
214  Vector const & v21,
215  Real & sig
216  );
217 
218 
219 private: // initialization
220 
221  /// @brief load phi/theta bins for use in secondary structure scoring
222  void
224  std::string const & hs_filename = "scoring/score_functions/SecondaryStructurePotential/phi.theta.36.HS.resmooth",
225  std::string const & ss_filename = "scoring/score_functions/SecondaryStructurePotential/phi.theta.36.SS.resmooth"
226  );
227 
228 
229 private: // initializers for static data
230 
231  static
232  void
234  FArray1D_int & idsn
235  );
236 
237  static
238  void
240  FArray1D_int & ids
241  );
242 
243  static
244  void
246  FArray2D_real & ssdist
247  );
248 
249  static
250  void
252  FArray1D_real & hs_dp
253  );
254 
255  static
256  void
258  FArray4D_real & rsigma_dot
259  );
260 
261  static
262  void
264  FArray1D_real & m_term
265  );
266 
267  /// @brief Penalty for pairing strand dimers that are close in sequence.
268  /// @details Inferred from the log ratio of pairing probabilities of strands
269  /// @details in the PDB vs. in Rosetta decoys. Calculated as a function of
270  /// @details strand separation.
271  static
272  void
274  FArray1D_real & SS_penalty
275  );
276 
277 private: // secondary structure data
278 
282 
286  FArray1D_real const hs_dp_; // not in use?
287  FArray4D_real const rsigma_dot_; // lookup for new rsigma score
289 
290 };
291 
292 } // ns scoring
293 } // ns core
294 
295 
296 #endif