Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MembraneCenPairEnergy.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/MembraneCenPairEnergy.cc
11 /// @brief Statistically derived rotamer pair potential class implementation
12 /// @author Phil Bradley
13 /// @author Andrew Leaver-Fay
14 
15 
16 // Unit headers
17 // AUTO-REMOVED #include <core/scoring/methods/util.hh>
20 
21 // Package headers
24 // AUTO-REMOVED #include <core/scoring/EnergyGraph.hh>
25 
26 // Project headers
27 #include <core/pose/Pose.hh>
28 #include <basic/datacache/BasicDataCache.hh>
31 
32 //symmetry
36 // AUTO-REMOVED #include <core/conformation/symmetry/util.hh>
37 
38 
41 #include <utility/vector1.hh>
42 
43 
44 
45 // Utility headers
46 
47 
48 
49 // C++
50 
51 
52 namespace core {
53 namespace scoring {
54 namespace methods {
55 
56 
57 /// @details This must return a fresh instance of the MembraneCenPairEnergy class,
58 /// never an instance already in use
62 ) const {
63  return new MembraneCenPairEnergy;
64 }
65 
68  ScoreTypes sts;
69  sts.push_back( Mpair );
70  return sts;
71 }
72 
73 
74 /// c-tor
77  potential_( ScoringManager::get_instance()->get_MembranePotential() )
78 {}
79 
80 
81 /// clone
84 {
85  return new MembraneCenPairEnergy();
86 }
87 
88 
89 /////////////////////////////////////////////////////////////////////////////
90 // scoring
91 /////////////////////////////////////////////////////////////////////////////
92 
93 
94 ///
95 void
97 {
98  // compute interpolated number of neighbors at various distance cutoffs
102 
103 
104 
105 }
106 
107 
108 //////////////////////////////////////////////////////////////
109 //
110 // MembraneCenTROID PAIR SCORE
111 // and
112 // "MembraneCenTROID PACK" SCORE (helps reproduce pairwise correlations
113 // between MembraneCentroids, observed in PDB)
114 //
115 void
117  conformation::Residue const & rsd1,
118  conformation::Residue const & rsd2,
119  pose::Pose const & pose,
120  ScoreFunction const &,
121  EnergyMap & emap
122 ) const
123 {
124  Real pair_score( 0.0 ); //, cenpack_score( 0.0 );
125 
126  Size rsd1Seq(rsd1.seqpos()), rsd2Seq(rsd2.seqpos());
127  if ( core::pose::symmetry::is_symmetric( pose ) ) {
128  using namespace core::conformation::symmetry;
129  SymmetricConformation const & symm_conf (
130  dynamic_cast< SymmetricConformation const & > ( pose.conformation() ) );
131  SymmetryInfoCOP symm_info( symm_conf.Symmetry_Info() );
132 
133  if (!symm_info->bb_is_independent(rsd1.seqpos())) {
134  rsd1Seq = symm_info->bb_follows(rsd1.seqpos());
135  }
136  if (symm_info->is_virtual(rsd1.seqpos())) {
137  rsd1Seq = 0;
138  }
139 
140  if (!symm_info->bb_is_independent(rsd2.seqpos())) {
141  rsd2Seq = symm_info->bb_follows(rsd2.seqpos());
142  }
143  if (symm_info->is_virtual(rsd2.seqpos())) {
144  rsd2Seq = 0;
145  }
146 
147  }
148  if (rsd1Seq ==0 || rsd2Seq ==0 ) {
149  return;
150  }
151 
152 
154  {
155  /// assumes centroids are being used
156  conformation::Atom const & cen1 ( rsd1.atom( rsd1.nbr_atom() ) ), cen2 (rsd2.atom( rsd2.nbr_atom() ) );
157  Real const cendist = cen1.xyz().distance_squared( cen2.xyz() );
158 
159  /// accumulate total energies
160 
161  potential_.evaluate_pair( pose, rsd1, rsd2, cendist, pair_score);
162 
163  //if ( rsd1.aa() == chemical::aa_his && rsd2.aa() == chemical::aa_his && true /*replace with option[ no_his_his_pairE ]*/ ) {
164  // pair_score = 0;
165  //}
166 
167 //pair_score *= 2.019f;
168  // cenpack_score *= 2.0f;
169 
170  //core::Real rsd_wt = 0.5 *
171  // ( get_residue_weight_by_ss( pose.conformation().secstruct( rsd1.seqpos() ) ) +
172  // get_residue_weight_by_ss( pose.conformation().secstruct( rsd2.seqpos() ) )
173  // );
174 
175  //Rosetta++ used the first residue's weight for both sides of the pair. I hate that. The above
176  //comment is an example of an alternative we should probably test in the distant future.
177  //bw is this something we like?
178 // core::Real rsd_wt = get_residue_weight_by_ss( pose.conformation().secstruct( rsd1.seqpos() )) ;
179  }
180  emap[ Mpair ] += pair_score ; // * rsd_wt;
181  //}
182  // emap[ cenpack ] += cenpack_score;
183 }
184 
185 void
187  pose::Pose & pose,
188  ScoreFunction const &,
189  EnergyMap &
190 ) const
191 {
192  potential_.finalize( pose );
193 }
194 MembraneTopology const &
196 {
197  //using core::pose::datacache::CacheableDataType::MEMBRANE_TOPOLOGY;
198  return *( static_cast< MembraneTopology const * >( pose.data().get_const_ptr( core::pose::datacache::CacheableDataType::MEMBRANE_TOPOLOGY )() ));
199 }
200 ///// @brief MembraneCenPairEnergy distance cutoff
201 Distance
203 {
204  return 6.0; /// now subtracted off 6.0 from cutoffs in MembraneCentroid params files
205 // return 0.0; /// since all the cutoffs for MembraneCentroid mode are rolled into the MembraneCendist check
206 }
209 {
210  return 1; // Initial versioning
211 }
212 
213 }
214 }
215 }