Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RMS_Energy.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 
23 // AUTO-REMOVED #include <core/scoring/EnvPairPotential.hh>
24 //#include <core/scoring/ScoringManager.hh>
25 // AUTO-REMOVED #include <core/scoring/EnergyGraph.hh>
26 #include <core/scoring/rms_util.hh>
27 
28 // AUTO-REMOVED #include <core/io/pdb/pose_io.hh>
29 
30 #include <basic/options/option.hh>
31 
32 #include <core/pose/Pose.hh>
33 
34 // AUTO-REMOVED #include <basic/prof.hh>
35 #include <utility/exit.hh>
36 
37 
38 // option key includes
39 
40 #include <basic/options/keys/score.OptionKeys.gen.hh>
41 #include <basic/options/keys/in.OptionKeys.gen.hh>
42 
43 #include <core/io/pdb/file_data.hh>
45 #include <utility/vector1.hh>
46 
47 
48 
49 namespace core {
50 namespace scoring {
51 namespace methods {
52 
53 
54 /// @details This must return a fresh instance of the RMS_Energy class,
55 /// never an instance already in use
59 ) const {
60  return new RMS_Energy;
61 }
62 
65  ScoreTypes sts;
66  sts.push_back( rms );
67  return sts;
68 }
69 
70 
71 /// c-tor
74 {
75  // configure native pose. Not perfect, ideally we should have some way of
76  // guaranteeing that the native pose and pose provided for scoring have
77  // the same ResidueTypeSet.
78  if ( basic::options::option[ basic::options::OptionKeys::in::file::native ].user() ) {
79  //core::import_pose::pose_from_pdb( native_pose_, basic::options::option[ basic::options::OptionKeys::in::file::native ]() );
80  core::io::pdb::build_pose_from_pdb_as_is(native_pose_, basic::options::option[ basic::options::OptionKeys::in::file::native ]() );
81  } else {
82  utility_exit_with_message( "Error: must provide native pose when scoring with RMS_Energy!\n" );
83  }
84 
85  // configure target RMSD.
86  rms_target_ = basic::options::option[ basic::options::OptionKeys::score::rms_target ]();
87 }
88 
89 
90 /// clone
93 {
94  return new RMS_Energy();
95 }
96 
97 
98 /////////////////////////////////////////////////////////////////////////////
99 // scoring
100 /////////////////////////////////////////////////////////////////////////////
101 
102 /// @brief Calculate the RMS difference between native_pose_ (provided by
103 /// the option -in::file::native and the given Pose. The actual energy calculation
104 /// is the difference between the RMSD and the target RMSD. Target RMSD is specified
105 /// the option -score::rms_target.
106 
107 void
109  pose::Pose & pose,
110  ScoreFunction const &,
111  EnergyMap & totals
112 ) const {
113 
114  // PROF_START( basic::RMS );
115 
116  ///////////////////////////////////////
117  //
118  // RMS SCORE
120  totals[ rms ] = std::abs( rms_target_ - rmsd );
121 
122  // PROF_STOP( basic::RMS );
123 }
126 {
127  return 1; // Initial versioning
128 }
129 
130 } // namespace methods
131 } // namespace scoring
132 } // namespace core