Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DirectReadoutEnergy.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/DirectReadoutEnergy.cc
11 /// @brief Statistically derived DNA contact potential class implementation
12 /// @author Phil Bradley
13 /// @author Amy Ticoll
14 
15 // C++ headers
16 #include <iostream>
17 // AUTO-REMOVED #include <fstream>
18 #include <sstream>
19 // AUTO-REMOVED #include <math.h>
20 
21 // Unit headers
24 
25 // Package headers
28 // AUTO-REMOVED #include <core/scoring/EnergyGraph.hh>
29 // AUTO-REMOVED #include <core/scoring/methods/EnergyMethodOptions.hh>
30 //#include <core/scoring/etable/count_pair/CountPair1BC4.hh>
31 // AUTO-REMOVED #include <core/scoring/etable/count_pair/CountPairFunction.hh>
32 // AUTO-REMOVED #include <core/scoring/etable/count_pair/CountPairFactory.hh>
33 // AUTO-REMOVED #include <core/scoring/etable/count_pair/types.hh>
34 
35 // Project headers
36 // AUTO-REMOVED #include <core/chemical/ChemicalManager.fwd.hh>
37 #include <core/pose/Pose.hh>
39 
41 #include <utility/vector1.hh>
42 
43 
44 using namespace std;
45 
46 namespace core {
47 namespace scoring {
48 namespace methods {
49 
50 
51 /// @details This must return a fresh instance of the DirectReadoutEnergy class,
52 /// never an instance already in use
54 DirectReadoutEnergyCreator::create_energy_method(
56 ) const {
57  return new DirectReadoutEnergy;
58 }
59 
61 DirectReadoutEnergyCreator::score_types_for_method() const {
62  ScoreTypes sts;
63  sts.push_back( dna_dr );
64  return sts;
65 }
66 
67 
68 /// @details C-TOR
69 DirectReadoutEnergy::DirectReadoutEnergy() :
71  potential_( ScoringManager::get_instance()->get_DirectReadoutPotential() )
72 {}
73 
74 
75 /// @details Clone
78 {
79  return new DirectReadoutEnergy();
80 }
81 
82 /// @details Totally inefficient implementation to avoid defining nbr-ness
83 
84 void
86  pose::Pose const & pose,
87  ScoreFunction const & scorefxn,
88  EnergyMap & emap
89 ) const
90 {
91  Size const nres( pose.total_residue() );
92 
93  for ( Size i=1; i<= nres; ++i ) {
94  conformation::Residue const & rsd1( pose.residue(i) );
95  if ( !rsd1.is_protein() ) continue;
96 
97  for ( Size j=1; j<= nres; ++j ) {
98  conformation::Residue const & rsd2( pose.residue(j) );
99 
100  if ( !rsd2.is_DNA() ) continue;
101 
102  my_residue_pair_energy( rsd1, rsd2, pose, scorefxn, emap );
103  }
104  }
105 }
106 
107 
108 
109 
110 /// @details Unused rsd-pair implementation
111 void
113  conformation::Residue const & rsd1,
114  conformation::Residue const & rsd2,
115  pose::Pose const &,
116  ScoreFunction const &,
117  EnergyMap & emap
118 ) const
119 {
120 
121  Real score(0.0);
122 
123  if ( rsd1.is_protein() && rsd2.is_DNA() ) {
124  score = potential_.rsd_rsd_energy( rsd1, rsd2 );
125  } else if ( rsd1.is_DNA() && rsd2.is_protein() ) {
126  score = potential_.rsd_rsd_energy( rsd2, rsd1 );
127  }
128 
129  emap[ dna_dr ] += score; // change
130 
131 }
134 {
135  return 1; // Initial versioning
136 }
137 
138 
139 
140 
141 
142 
143 } // ns methods
144 } // ns scoring
145 } // ns core