Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EnsembleEnergy.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 protocols/scoring/methods/EnsembleEnergy.cc
11 /// @brief Function to subtract out individual reference energies during ensemble docking
12 /// @author Monica Berrondo
13 
14 
15 // Unit headers
18 
19 // Package headers
20 #include <basic/datacache/BasicDataCache.hh>
21 #include <basic/datacache/CacheableStringFloatMap.hh>
22 
23 // AUTO-REMOVED #include <core/scoring/ScoringManager.hh>
25 // AUTO-REMOVED #include <core/scoring/EnergyGraph.hh>
26 
27 // Project headers
28 #include <core/pose/Pose.hh>
29 // AUTO-REMOVED #include <core/conformation/Residue.hh>
30 
31 
32 // Utility headers
33 
34 #include <basic/Tracer.hh>
35 
37 #include <utility/vector1.hh>
38 
39 using basic::T;
40 using basic::Error;
41 using basic::Warning;
42 
43 static basic::Tracer TR("protocols.scoring.methods.EnsembleEnergy");
44 
45 
46 // C++
47 
48 namespace protocols {
49 namespace scoring {
50 namespace methods {
51 
52 
53 /// @details This must return a fresh instance of the EnsembleEnergy class,
54 /// never an instance already in use
58 ) const {
59  return new EnsembleEnergy;
60 }
61 
64  using namespace core::scoring;
65  ScoreTypes sts;
66  sts.push_back( dock_ens_conf );
67  return sts;
68 }
69 
70 
71 /// c-tor
74 {}
75 
76 
77 /// clone
80 {
81  return new EnsembleEnergy();
82 }
83 
84 /////////////////////////////////////////////////////////////////////////////
85 // scoring
86 /////////////////////////////////////////////////////////////////////////////
87 
88 // calculate the score of the residues to constrain to the interface
89 void
91  core::pose::Pose & pose,
94 ) const
95 {
96  using namespace core;
97  using namespace core::scoring;
98  Real unbound_score ( 0.0 );
100  basic::datacache::CacheableStringFloatMapOP data
101  = dynamic_cast< basic::datacache::CacheableStringFloatMap * >
103  for ( std::map< std::string, float >::const_iterator iter = data->map().begin(),
104  end = data->map().end(); iter != end; iter++
105  ) {
106  // skip score entry, as it gets confusing
107  if ( iter->first == "dock_ens_conf1" || iter->first == "dock_ens_conf2" ) {
108 // TR << iter->first << ' ' << iter->second << std::endl;
109  unbound_score += iter->second;
110  }
111  }
112 
113  }
114 
115 // TR << "unbound score: " << unbound_score << std::endl;
116 
117  emap[ dock_ens_conf ] = -unbound_score;
118 }
119 
122 {
123  return 1; // Initial versioning
124 }
125 
126 }
127 }
128 }