Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
YHHPlanarityEnergy.cc
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/methods/YHHPlanarityEnergy.hh
11 /// @brief Term for chi3 on tyrosine residues to prefer the hydrogen lie in the plane of the ring
12 /// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
13 
14 
15 // Unit headers
18 
19 // Package headers
23 
24 // Project headers
25 #include <core/id/TorsionID.hh>
26 #include <core/pose/Pose.hh>
27 // AUTO-REMOVED #include <core/conformation/Conformation.hh>
29 
30 // Numeric headers
31 #include <numeric/conversions.hh>
32 #include <numeric/constants.hh>
33 
34 #include <core/kinematics/Jump.hh>
35 #include <utility/vector1.hh>
36 
37 
38 namespace core {
39 namespace scoring {
40 namespace methods {
41 
42 
43 /// @details This must return a fresh instance of the P_AA_pp_Energy class,
44 /// never an instance already in use
48 ) const {
49  return new YHHPlanarityEnergy;
50 }
51 
54  ScoreTypes sts;
55  sts.push_back( yhh_planarity );
56  return sts;
57 }
58 
59 
60 
61 /// ctor
64 {}
65 
66 /// clone
69 {
70  return new YHHPlanarityEnergy;
71 }
72 
73 /////////////////////////////////////////////////////////////////////////////
74 // methods for ContextIndependentOneBodyEnergies
75 /////////////////////////////////////////////////////////////////////////////
76 
77 ///
78 void
80  conformation::Residue const & rsd,
81  pose::Pose const &,
82  EnergyMap & emap
83 ) const
84 {
85  using numeric::constants::d::degrees_to_radians;
86  using numeric::constants::d::pi;
87 
88  // ignore scoring residues which have been marked as "REPLONLY" residues (only the repulsive energy will be calculated)
90  return;
91  }
92  if ( defines_score_for_rsd(rsd) ) {
93  emap[ yhh_planarity ] += 0.5 * (std::cos( pi - 2*rsd.chi(3)*degrees_to_radians)+1);
94  }
95 }
96 
97 
98 bool
100 {
101  return true;
102 }
103 
104 Real
106  conformation::Residue const & rsd,
107  ResSingleMinimizationData const &,// min_data,
108  id::DOF_ID const &,// dof_id,
109  id::TorsionID const & tor_id,
110  pose::Pose const &,// pose,
111  ScoreFunction const &,// sfxn,
112  EnergyMap const & weights
113 ) const
114 {
115  using numeric::constants::d::degrees_to_radians;
116  using numeric::constants::d::pi;
117  // ignore scoring residues which have been marked as "REPLONLY" residues (only the repulsive energy will be calculated)
119  return 0.0;
120  }
121 
122  if ( ! tor_id.valid() ) return 0.0;
123  if ( defines_score_for_rsd(rsd) && tor_id.type() == id::CHI && tor_id.torsion() == 3 ) {
124  return
125  weights[ yhh_planarity ] * std::sin(pi -2*rsd.chi(3)*degrees_to_radians);
126  } else {
127  return 0.0;
128  }
129 }
130 
131 /// @brief P_AA_pp_Energy is context independent; indicates that no
132 /// context graphs are required
133 void
135 {}
136 
139 {
140  return 1; // Initial versioning
141 }
142 
143 bool
145 {
146  return rsd.aa() == chemical::aa_tyr && rsd.type().nchi() == 3 && rsd.type().atom_is_hydrogen( rsd.type().chi_atoms(3)[4] );
147 }
148 
149 } // methods
150 } // scoring
151 } // core
152