Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DNAChiEnergy.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/dna/DNAChiEnergy.cc
10 /// @brief DNA Chi torsion energy method implementation
11 /// @author Jim Havranek
12 
13 // Unit headers
17 
18 // Package Headers
21 
23 
24 // Project headers
25 #include <core/pose/Pose.hh>
26 #include <core/id/TorsionID.hh>
27 
28 // Utility headers
29 #include <numeric/conversions.hh>
30 
31 #include <basic/Tracer.hh>
32 
33 static basic::Tracer tr( "core.scoring.dna.DNAChiEnergy" );
34 
35 namespace core {
36 namespace scoring {
37 namespace dna {
38 
42 ) const {
43  return new DNAChiEnergy;
44 }
45 
48  ScoreTypes sts;
49  sts.push_back( dna_chi );
50  return sts;
51 }
52 
53 /// ctor
56  potential_( ScoringManager::get_instance()->get_DNABFormPotential() )
57 {}
58 
60 
61 /// clone
64 {
65  return new DNAChiEnergy();
66 }
67 
68 /////////////////////////////////////////////////////////////////////////////
69 // methods for ContextIndependentOneBodyEnergies
70 /////////////////////////////////////////////////////////////////////////////
71 
72 ///
73 void
75  conformation::Residue const & rsd,
76  pose::Pose const & ,
77  EnergyMap & emap
78 ) const
79 {
80  if( rsd.is_DNA() ) {
81 // Real this_chi( (rsd.chi())[1] );
82 // tr << "Calculating chi as: " << this_chi << std::endl;
83  Real this_score( 0.0 );
84  Real this_deriv( 0.0 );
85  potential_.eval_dna_bform_chi_torsion_score_residue( rsd, this_score, this_deriv );
86 // tr << "Calculating dna chi score as: " << this_score << std::endl;
87  emap[ dna_chi ] = this_score;
88  }
89 }
90 
91 
92 ///
93 Real
95  id::DOF_ID const &,// dof_id,
96  id::TorsionID const & tor_id,
97  pose::Pose const & pose,
98  ScoreFunction const &,
99  EnergyMap const & weights
100 ) const
101 {
102  Real this_score( 0.0 );
103  Real this_deriv( 0.0 );
104  if ( tor_id.valid() && tor_id.type() == id::CHI ) {
105  conformation::Residue const & rsd( pose.residue( tor_id.rsd() ) );
106  if( rsd.is_DNA() ) {
107  potential_.eval_dna_bform_chi_torsion_score_residue( rsd, this_score, this_deriv );
108  }
109 // tr << "Calculating dna chi score as: " << this_score << std::endl;
110  }
111  return ( weights[ dna_chi ] * this_deriv );
112 }
113 
114 /// @brief DNAChiEnergy is context independent; indicates that no context graphs are required
115 void
117  utility::vector1< bool > & /*context_graphs_required*/
118 ) const
119 {}
120 
123 {
124  return 1;
125 }
126 
127 
128 } // dna
129 } // scoring
130 } // core
131