Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DockingScoreFunction.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 // This file is part of the Rosetta software suite and is made available under license.
5 // The Rosetta software is developed by the contributing members of the Rosetta Commons consortium.
6 // (C) 199x-2009 Rosetta Commons participating institutions and developers.
7 // For more information, see http://www.rosettacommons.org/.
8 
9 /// @file core/scoring/ScoreFunction.cc
10 /// @brief ScoreFunction class definition.
11 /// @author Stuart G. Mentzer (Stuart_Mentzer@objexx.com)
12 /// @author Kevin P. Hinshaw (KevinHinshaw@gmail.com)
13 /// @author Modified by Sergey Lyskov
14 
15 
16 // Unit headers
18 
19 // Package headers
20 
21 // // Project headers
22 #include <core/pose/Pose.hh>
23 #include <core/pose/util.hh>
24 #include <core/kinematics/Jump.hh>
26 #include <core/scoring/Energies.hh>
27 #include <basic/Tracer.hh>
28 
29 static basic::Tracer tr("core.scoring.DockingScoreFunction");
30 
31 namespace core {
32 namespace scoring {
33 
34 ///////////////////////////////////////////////////////////////////////////////
37  {}
38 
39 ///////////////////////////////////////////////////////////////////////////////
42 {
43  return new DockingScoreFunction( *this );
44 }
45 
46 ///////////////////////////////////////////////////////////////////////////////
49 {
51  return *this;
52 }
53 
54 ///////////////////////////////////////////////////////////////////////////////
56  ScoreFunction( src )
57 {}
58 
60  ScoreFunction( src )
61 {}
62 
64  ScoreFunction( *src )
65 {}
66 
68  ScoreFunction( *src )
69 {}
70 
71 ///////////////////////////////////////////////////////////////////////////////
72 
73 // to start out, just thinking fullatom energies
74 //
75 // NOTE: no freakin rotamer trials inside scoring!
76 Real
78 {
79  Size interface_jump_id = 1; //for now
80 
81  core::kinematics::Jump bound_pose_jump = pose.jump( interface_jump_id );
82  core::kinematics::Jump unbound_pose_jump( bound_pose_jump );
83  Real trans_magnitude = 10000;
84 
85  core::kinematics::Stub upstream_stub = pose.conformation().upstream_jump_stub( interface_jump_id );
86  core::Vector dummy_axis(1,1,1);
87  unbound_pose_jump.translation_along_axis( upstream_stub, dummy_axis, trans_magnitude );
88  pose.set_jump( interface_jump_id, unbound_pose_jump );
89 
90  ScoreFunction::operator()( pose ); //score -- but without atom_pair_constraints..
91  // is probably cheaper to not apply a completely new scorefunction...
92  EnergyMap cst_free_weights( weights() );
93  Real cst_weight = cst_free_weights.get( atom_pair_constraint );
94  cst_free_weights[ atom_pair_constraint ] = 0;
95  Real unbound_energy = pose.energies().total_energies().dot( cst_free_weights );
96 
97 
98  pose.set_jump( interface_jump_id, bound_pose_jump );
99 
101  Real bound_energy = pose.energies().total_energies().dot( cst_free_weights );
102 
103  runtime_assert( pose.num_jump() > 0 );
104 
105  Real interaction_energy = (bound_energy - unbound_energy);
106 
107  pose.energies().total_energies()[ total_score ] = interaction_energy + pose.energies().total_energies()[ atom_pair_constraint ]*cst_weight;
108  tr.Debug << "unbound_energy " << unbound_energy << " full_score " << bound_energy << " diff " << interaction_energy << std::endl;
109  pose::setPoseExtraScores( pose, "I_sc", interaction_energy );
110  return pose.energies().total_energies()[ total_score ];
111 }
112 
113 
114 ///////////////////////////////////////////////////////////////////////////////
115 } // namespace scoring
116 } // namespace core