Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CenPairEnergy.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/CenPairEnergy.cc
11 /// @brief Statistically derived rotamer pair potential class implementation
12 /// @author Phil Bradley
13 /// @author Andrew Leaver-Fay
14 
15 
16 // Unit headers
20 
21 // Package headers
25 // AUTO-REMOVED #include <core/scoring/EnergyGraph.hh>
26 
27 // Project headers
28 #include <core/pose/Pose.hh>
31 
33 #include <utility/vector1.hh>
34 
35 
36 
37 // Utility headers
38 
39 
40 
41 // C++
42 
43 
44 namespace core {
45 namespace scoring {
46 namespace methods {
47 
51 ) const {
52  return new methods::CenPairEnergy;
53 }
54 
55 /// @brief Return the set of score types claimed by the EnergyMethod
56 /// this EnergyMethodCreator creates in its create_energy_method() function
59  ScoreTypes sts;
60  sts.push_back( pair );
61  sts.push_back( cenpack );
62  return sts;
63 }
64 
65 
66 /// c-tor
69  potential_( ScoringManager::get_instance()->get_EnvPairPotential() )
70 {}
71 
72 
73 /// clone
76 {
77  return new CenPairEnergy();
78 }
79 
80 
81 /////////////////////////////////////////////////////////////////////////////
82 // scoring
83 /////////////////////////////////////////////////////////////////////////////
84 
85 
86 ///
87 void
89 {
90  // compute interpolated number of neighbors at various distance cutoffs
93 }
94 
95 
96 //////////////////////////////////////////////////////////////
97 //
98 // CENTROID PAIR SCORE
99 // and
100 // "CENTROID PACK" SCORE (helps reproduce pairwise correlations
101 // between centroids, observed in PDB)
102 //
103 void
105  conformation::Residue const & rsd1,
106  conformation::Residue const & rsd2,
107  pose::Pose const & pose,
108  ScoreFunction const &,
109  EnergyMap & emap
110 ) const
111 {
112  // ignore scoring residues which have been marked as "REPLONLY" residues (only the repulsive energy will be calculated)
114  return;
115  }
116  if(rsd1.aa()==core::chemical::aa_unk) return;
117  if(rsd2.aa()==core::chemical::aa_unk) return;
118 
119  /// assumes centroids are being used
120  conformation::Atom const & cen1 ( rsd1.atom( rsd1.nbr_atom() ) ), cen2 (rsd2.atom( rsd2.nbr_atom() ) );
121  Real const cendist = cen1.xyz().distance_squared( cen2.xyz() );
122 
123  //fpd ignore cen-cen distances above 12.05A
124  if (cendist > 12.05*12.05) return;
125 
126  /// accumulate total energies
127  Real pair_score( 0.0 ), cenpack_score( 0.0 );
128  potential_.evaluate_pair_and_cenpack_score( rsd1, rsd2, cendist,
129  pair_score, cenpack_score );
130 
131  //if ( rsd1.aa() == chemical::aa_his && rsd2.aa() == chemical::aa_his && true /*replace with option[ no_his_his_pairE ]*/ ) {
132  // pair_score = 0;
133  //}
134 
135  pair_score *= 2.019f;
136  cenpack_score *= 2.0f;
137 
138  //core::Real rsd_wt = 0.5 *
139  // ( get_residue_weight_by_ss( pose.conformation().secstruct( rsd1.seqpos() ) ) +
140  // get_residue_weight_by_ss( pose.conformation().secstruct( rsd2.seqpos() ) )
141  // );
142 
143  //Rosetta++ used the first residue's weight for both sides of the pair. I hate that. The above
144  //comment is an example of an alternative we should probably test in the distant future.
145  core::Real rsd_wt = get_residue_weight_by_ss( pose.conformation().secstruct( rsd1.seqpos() )) ;
146 
147  emap[ pair ] += pair_score * rsd_wt;
148  emap[ cenpack ] += cenpack_score;
149 }
150 
151 void
153  pose::Pose & pose,
154  ScoreFunction const &,
155  EnergyMap &
156 ) const
157 {
158  potential_.finalize( pose );
159 }
160 
161 /// @brief CenPairEnergy distance cutoff
162 Distance
164 {
165  return 6.0; /// now subtracted off 6.0 from cutoffs in centroid params files
166 // return 0.0; /// since all the cutoffs for centroid mode are rolled into the cendist check
167 }
170 {
171  return 1; // Initial versioning
172 }
173 
174 }
175 }
176 }