Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MembraneLipo.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/RMS_Energy.cc
11 /// @brief RMS Energy function. Used to optimize the RMSD between two structures.
12 /// @author James Thompson
13 
14 
15 // Unit headers
18 
19 // Package headers
20 // AUTO-REMOVED #include <core/conformation/Residue.hh>
21 // AUTO-REMOVED #include <core/conformation/Atom.hh>
22 
26 // AUTO-REMOVED #include <core/scoring/EnergyGraph.hh>
27 //#include <core/scoring/rms_util.hh>
28 
29 //#include <core/io/pdb/pose_io.hh>
30 
31 //symmetry
33 // AUTO-REMOVED #include <core/conformation/symmetry/util.hh>
34 
37 
38 //#include <basic/options/option.hh>
39 //#include <basic/options/keys/OptionKeys.hh>
40 
41 #include <core/pose/Pose.hh>
43 #include <basic/datacache/BasicDataCache.hh>
44 
46 #include <utility/vector1.hh>
47 
48 
49 //#include <basic/prof.hh>
50 //#include <utility/exit.hh>
51 
52 namespace core {
53 namespace scoring {
54 namespace methods {
55 
56 
57 /// @details This must return a fresh instance of the MembraneLipo class,
58 /// never an instance already in use
62 ) const {
63  return new MembraneLipo;
64 }
65 
68  ScoreTypes sts;
69  sts.push_back( Mlipo );
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 MembraneLipo();
86 }
87 
88 
89 /////////////////////////////////////////////////////////////////////////////
90 // scoring
91 /////////////////////////////////////////////////////////////////////////////
92 
93 /// @brief Calculate the RMS difference between native_pose_ (provided by
94 /// the option -in::file::native and the given Pose. The actual energy calculation
95 /// is the difference between the RMSD and the target RMSD. Target RMSD is specified
96 /// the option -score::rms_target.
97 
98 ///
99 
100 void
102 {
103  // compute interpolated number of neighbors at various distance cutoffs
106 // potential_.compute_membrane_embedding( pose );
107 
108 }
109 
110 void
112  pose::Pose & pose,
113  ScoreFunction const &,
114  EnergyMap & emap
115 ) const {
116 
117  //using namespace core::pose::datacache::CacheableDataType;
118 
119 // if(potential_.Menv_penalties()) //bw quick hack before putting them as individual scoring terms....
120 // {
121 // Real tm_projection(0);
122 // Real hbond_pen(0);
123 // Real termini_pen(0);
124 // potential_.tm_projection_penalty(pose,tm_projection);
125 // potential_.hbond_penalty(pose,hbond_pen);
126 // potential_.termini_penalty(pose,termini_pen);
127 // emap[ Menv_hbond ]=hbond_pen;
128 // emap[ Menv_termini ]=termini_pen;
129 
130  Real lipo(0);
131 
132  MembraneTopology const & topology( *( static_cast< MembraneTopology const * >( pose.data().get_const_ptr( core::pose::datacache::CacheableDataType::MEMBRANE_TOPOLOGY )())));
133  if(topology.LipoDefined()) {
134  Real cen10Buried(0);
135  Real cen10Exposed(0);
136  Real cen10Buried_norm(0);
137  Real cen10Exposed_norm(0);
138  CenListInfo const & cenlist( *( static_cast< CenListInfo const * >( pose.data().get_const_ptr( core::pose::datacache::CacheableDataType::CEN_LIST_INFO )() ))); //cenlist_from_pose( pose ));
139  for(Size i=1;i<=pose.total_residue();++i) {
140  Size rsdSeq(i);
141  if ( core::pose::symmetry::is_symmetric( pose ) ) {
142  using namespace core::conformation::symmetry;
143  SymmetricConformation const & symm_conf (
144  dynamic_cast< SymmetricConformation const & > ( pose.conformation() ) );
145  SymmetryInfoCOP symm_info( symm_conf.Symmetry_Info() );
146  if (!symm_info->bb_is_independent(pose.residue(i).seqpos())) {
147  rsdSeq = symm_info->bb_follows(pose.residue(i).seqpos());
148  }
149  if (symm_info->is_virtual(i)) {
150  rsdSeq = 0;
151  }
152  }
153 
154  if (rsdSeq ==0 ) continue;
155  if ( pose.residue(rsdSeq).aa() == core::chemical::aa_vrt ) continue;
156  if(topology.allow_scoring(rsdSeq)) {
157  Real B(topology.LipidBurial(rsdSeq));
158  Real E(topology.LipidExposure(rsdSeq));
159  if(B!=0) {
160  cen10Buried+=B*cenlist.fcen10(i);
161  cen10Buried_norm+=1;
162  }
163  if(E!=0) {
164  cen10Exposed+=E*cenlist.fcen10(i);
165  cen10Exposed_norm+=1;
166  }
167 
168  //std::cout << i << " " << cenlist.fcen10(i) << " " << topology.tmh_inserted() << "\n";
169  }
170  }
171  Real B_mean(0);
172  Real E_mean(0);
173  if(cen10Exposed_norm!=0)
174  E_mean=cen10Exposed/cen10Exposed_norm;
175  if(cen10Buried_norm!=0)
176  B_mean=cen10Buried/cen10Buried_norm;
177  lipo=(E_mean-B_mean)*topology.tmh_inserted();
178  }
179  emap[ Mlipo ]=lipo;
180  potential_.finalize( pose );
181 //
182 
183 // std::cout << "Menv_penalties (tm_projection+hbond_pen+termini_pen+10) " << tm_projection << " " << hbond_pen << " " << termini_pen << std::endl;
184 // }
185 // potential_.finalize( pose );
186 // totals[ rms ] = std::abs( rms_target_ - rmsd );
187 
188  // PROF_STOP( basic::RMS );
189 }
190 /*
191 MembraneTopology const &
192 MembraneLipo::MembraneTopology_from_pose( pose::Pose & pose ) const
193  {
194  return *( static_cast< MembraneTopology const * >( pose.data().get_const_ptr( basic::MEMBRANE_TOPOLOGY )() ));
195 
196  }
197 core::Size
198 MembraneLipo::version() const
199 {
200  return 1; // Initial versioning
201 }
202 
203  */
206 {
207  return 1; // Initial versioning
208 }
209 
210 } // namespace methods
211 } // namespace scoring
212 } // namespace core