Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MembraneEnvEnergy.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/EnvPairEnergy.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 // AUTO-REMOVED #include <basic/MetricValue.hh>
21 // Package headers
25 // AUTO-REMOVED #include <core/scoring/EnergyGraph.hh>
26 
27 // Project headers
28 #include <core/pose/Pose.hh>
30 #include <basic/datacache/BasicDataCache.hh>
32 
34 #include <utility/vector1.hh>
35 
36 
37 // Utility headers
38 
39 // C++
40 
41 namespace core {
42 namespace scoring {
43 namespace methods {
44 
45 
46 /// @details This must return a fresh instance of the MembraneEnvEnergy class,
47 /// never an instance already in use
51 ) const {
52  return new MembraneEnvEnergy;
53 }
54 
57  ScoreTypes sts;
58  sts.push_back( Menv );
59  return sts;
60 }
61 
62 
63 /// c-tor
66  potential_( ScoringManager::get_instance()->get_MembranePotential() )
67 {}
68 
69 
70 /// clone
73 {
74  return new MembraneEnvEnergy;
75 }
76 
77 
78 /////////////////////////////////////////////////////////////////////////////
79 // scoring
80 /////////////////////////////////////////////////////////////////////////////
81 
82 
83 ///
84 void
86 {
87  // compute interpolated number of neighbors at various distance cutoffs
91 
92 }
93 
94 void
96 {
97  setup_for_scoring(pose,sf);
98 }
99 
100 
101 ///////////////////////////////////////
102 //
103 // ENV SCORE
104 void
106  conformation::Residue const & rsd,
107  pose::Pose const & pose,
108  EnergyMap & emap
109 ) const
110 {
111  Real env_score( 0.0 ); // cb_score( 0.0 ); //, cb_score12( 0.0 ), cb_score( 0.0 );
112 // basic::MetricValue<core::Vector> depth_vector;
113 // pose.metric("MCN","depth",depth_vector);
114 // Size pos=rsd.seqpos();
115 // Real depth=depth_vector[ rsd.seqpos() ];
116 // Real depth=30;
117 // std::cout << rsd.seqpos() << "\n "; << depth << "\n";
118  //std::cout << pos << "\n";
119  if ( rsd.aa() == core::chemical::aa_vrt ) return;
121  {
122  potential_.evaluate_env( pose, rsd, env_score);
123  //potential_.evaluate_cbeta( pose, rsd,cb_score);
124  }
125 // env_score *= 0.5;2.019;
126  //cb_score = 2.667 * ( cb_score ) * 0.3;
127 //bw is this something we like?
128  //core::Real rsd_wt = get_residue_weight_by_ss( pose.conformation().secstruct( rsd.seqpos() ) );
129 
130  emap[ Menv ] += env_score;// * rsd_wt;
131  //emap[ Mcbeta ] = cb_score;// * rsd_wt;
132 
133 } // residue_energy
134 
135 void
137  pose::Pose & pose,
138  ScoreFunction const &,
139  EnergyMap &
140 ) const
141 {
142  /*
143  std::cout << "BEFORE emap[ Menv ] " << emap[ Menv ] << std::endl;
144  if(potential_.Menv_penalties()) //bw quick hack before putting them as individual scoring terms....
145  {
146  Real tm_projection(0);
147  Real hbond_pen(0);
148  Real termini_pen(0);
149  potential_.tm_projection_penalty(pose,tm_projection);
150  potential_.hbond_penalty(pose,hbond_pen);
151  potential_.termini_penalty(pose,termini_pen);
152  emap[ Menv ]+=(tm_projection+hbond_pen+termini_pen+10);
153 
154  std::cout << "Menv_penalties (tm_projection+hbond_pen+termini_pen+10) " << tm_projection << " " << hbond_pen << " " << termini_pen << std::endl;
155  }
156  std::cout << "AFTER emap[ Menv ] " << emap[ Menv ] << std::endl;
157  */
158  potential_.finalize( pose );
159  //std::cout << "AFTER2 emap[ Menv ] " << emap[ Menv ] << std::endl;
160 }
161 MembraneTopology const &
163 {
164  //using core::pose::datacache::CacheableDataType::MEMBRANE_TOPOLOGY;
165  return *( static_cast< MembraneTopology const * >( pose.data().get_const_ptr( core::pose::datacache::CacheableDataType::MEMBRANE_TOPOLOGY )() ));
166 }
169 {
170  return 1; // Initial versioning
171 }
172 
173 }
174 }
175 }