Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SmoothEnvEnergy.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/SmoothEnvEnergy.cc
11 /// @brief Smooth, differentiable, version of centroid env
12 /// @author Frank DiMaio
13 
14 
15 // Unit headers
16 // AUTO-REMOVED #include <core/scoring/methods/util.hh>
19 
20 // Package headers
25 // AUTO-REMOVED #include <core/scoring/EnergyGraph.hh>
26 
27 // Project headers
28 #include <core/pose/Pose.hh>
29 // AUTO-REMOVED #include <core/conformation/Conformation.hh>
31 
32 #include <core/kinematics/Jump.hh>
34 #include <utility/vector1.hh>
35 
36 // Utility headers
37 
38 // C++
39 
40 namespace core {
41 namespace scoring {
42 namespace methods {
43 
44 
45 /// @details This must return a fresh instance of the SmoothEnvEnergy class,
46 /// never an instance already in use
50 ) const {
51  return new SmoothEnvEnergy;
52 }
53 
56  ScoreTypes sts;
57  sts.push_back( cen_env_smooth );
58  sts.push_back( cbeta_smooth );
59  return sts;
60 }
61 
62 
63 
64 /// c-tor
67  potential_( ScoringManager::get_instance()->get_SmoothEnvPairPotential() )
68 {}
69 
70 
71 /// clone
74  return new SmoothEnvEnergy;
75 }
76 
77 
78 /////////////////////////////////////////////////////////////////////////////
79 // scoring
80 /////////////////////////////////////////////////////////////////////////////
81 
82 
83 ///
84 void
86  // compute interpolated number of neighbors at various distance cutoffs
89 }
90 
91 
92 ///////////////////////////////////////
93 //
94 // ENV SCORE AND CBETA SCORE
95 void
97  conformation::Residue const & rsd,
98  pose::Pose const & pose,
99  EnergyMap & emap
100 ) const {
101  // ignore scoring residues which have been marked as "REPLONLY" residues (only the repulsive energy will be calculated)
102  if ( rsd.has_variant_type( core::chemical::REPLONLY ) ) return;
103  if ( rsd.aa() > core::chemical::num_canonical_aas ) return;
104 
105  Real env_score( 0.0 ), cb_score6( 0.0 ), cb_score12( 0.0 ), cb_score( 0.0 );
106 
107  potential_.evaluate_env_and_cbeta_scores( pose, rsd, env_score, cb_score6, cb_score12 );
108 
109  env_score *= 2.019;
110  cb_score = 2.667 * ( cb_score6 + cb_score12 ) * 0.3;
111 
112  //fpd get rid of secstruct weighing
113  //core::Real rsd_wt = get_residue_weight_by_ss( pose.conformation().secstruct( rsd.seqpos() ) );
114 
115  emap[ cen_env_smooth ] += env_score;
116  emap[ cbeta_smooth ] += cb_score;
117 } // residue_energy
118 
119 
120 void
122  conformation::Residue const & rsd,
124  pose::Pose const & pose,
125  EnergyMap const & weights,
127 ) const {
128  if ( rsd.has_variant_type( core::chemical::REPLONLY ) ) return;
129  if ( rsd.aa() > core::chemical::num_canonical_aas ) return;
130 
131 
132  Real weight_env = weights[ cen_pair_smooth ];
133  Real weight_cbeta = weights[ cenpack_smooth ];
134 
135  numeric::xyzVector<Real> d_env_score, d_cb_score6, d_cb_score12, d_cb_score;
136  potential_.evaluate_env_and_cbeta_deriv( pose, rsd, d_env_score, d_cb_score6, d_cb_score12);
137 
138  // again, multiply by magic constants
139  d_env_score *= weight_env * 2.019;
140  d_cb_score = weight_cbeta * 2.667 * ( d_cb_score6 + d_cb_score12 ) * 0.3;
141 
142  numeric::xyzVector<core::Real> atom_x = rsd.atom( rsd.nbr_atom() ).xyz();
143 
144  numeric::xyzVector<core::Real> const f2_env( d_env_score );
145  numeric::xyzVector<core::Real> atom_y = -f2_env + atom_x;
146  Vector const f1_env( atom_x.cross( atom_y ) );
147 
148  numeric::xyzVector<core::Real> const f2_cbeta( d_cb_score );
149  atom_y = -f2_cbeta + atom_x;
150  Vector const f1_cbeta( atom_x.cross( atom_y ) );
151 
152  atom_derivs[ rsd.nbr_atom() ].f1() += f1_env + f1_cbeta;
153  atom_derivs[ rsd.nbr_atom() ].f2() += f2_env + f2_cbeta;
154 }
155 
156 
157 void
159  pose::Pose & pose,
160  ScoreFunction const &,
161  EnergyMap &
162 ) const {
163  potential_.finalize( pose );
164 }
165 
168  return 1; // Initial versioning
169 }
170 
171 }
172 }
173 }