Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RNA_SugarCloseEnergy.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/RNA_SugarCloseEnergy.cc
11 /// @brief RNA_SugarClose energy method class implementation
12 /// @author Rhiju Das
13 
14 // Unit Headers
17 
18 // Package Headers
21 // AUTO-REMOVED #include <core/scoring/ScoringManager.hh>
28 #include <basic/options/option.hh>
29 #include <basic/options/keys/score.OptionKeys.gen.hh>
30 #include <basic/options/keys/rna.OptionKeys.gen.hh>
31 
32 
33 // Project headers
34 #include <core/pose/Pose.hh>
35 
36 // Utility headers
37 #include <numeric/conversions.hh>
38 // AUTO-REMOVED #include <numeric/xyz.functions.hh>
39 
41 #include <utility/vector1.hh>
42 #include <ObjexxFCL/format.hh>
43 
44 
45 // C++
46 
47 
48 namespace core {
49 namespace scoring {
50 namespace rna {
51 
52 /// @details This must return a fresh instance of the RNA_SugarCloseEnergy class,
53 /// never an instance already in use
57 ) const {
58  return new RNA_SugarCloseEnergy;
59 }
60 
63  ScoreTypes sts;
64  sts.push_back( rna_sugar_close );
65  return sts;
66 }
67 
68 
69 /// ctor
72  scale_rna_torsion_tether_( 0.05 ), // THIS IS A SCALING FACTOR FOR ALL CONSTRAINTS.
73  scale_rna_torsion_sd_( 1.0 / std::sqrt( scale_rna_torsion_tether_ ) ),
74  o4star_c1star_bond_length_( 1.414 ),
75  o4star_c1star_sd_( 0.01 ),
76  o4star_c1star_dist_harm_func_( new constraints::HarmonicFunc( o4star_c1star_bond_length_, scale_rna_torsion_sd_ * o4star_c1star_sd_ )),
77  angle_sd_( numeric::conversions::radians( 1.0 ) ),
78  o4star_c1star_c2star_bond_angle_( numeric::conversions::radians( 106.39 ) ),
79  o4star_c1star_c2star_angle_harm_func_(
80  new constraints::HarmonicFunc( o4star_c1star_c2star_bond_angle_, scale_rna_torsion_sd_ * angle_sd_ ) ),
81  o4star_c1star_first_base_bond_angle_( numeric::conversions::radians( 108.2 ) ),
82  o4star_c1star_first_base_angle_harm_func_(
83  new constraints::HarmonicFunc( o4star_c1star_first_base_bond_angle_, angle_sd_ ) ),
84  c4star_o4star_c1star_bond_angle_( numeric::conversions::radians( 110.4 ) ),
85  c4star_o4star_c1star_angle_harm_func_(
86  new constraints::HarmonicFunc( c4star_o4star_c1star_bond_angle_, scale_rna_torsion_sd_ * angle_sd_ ) ),
87  //phenix_based_sugar_close params
88  use_phenix_sugar_close_( basic::options::option[ basic::options::OptionKeys::rna::corrected_geo ]() ),
89  o4star_c1star_bond_north_(1.412),
90  o4star_c1star_bond_south_(1.415),
91  bond_sd_(0.015),
92  o4star_c1star_c2star_angle_north_( numeric::conversions::radians(107.6) ),
93  o4star_c1star_c2star_angle_south_( numeric::conversions::radians(105.8) ),
94  o4star_c1star_n1_9_angle_north_( numeric::conversions::radians(108.5) ),
95  o4star_c1star_n1_9_angle_south_( numeric::conversions::radians(108.2) ),
96  c4star_o4star_c1star_angle_north_( numeric::conversions::radians(109.7) ),
97  c4star_o4star_c1star_angle_south_( numeric::conversions::radians(109.9) ),
98  angle_sd1_( numeric::conversions::radians(1.0) ),
99  angle_sd2_( numeric::conversions::radians(1.5) )
100 {}
101 
103 
104 /// clone
107 {
108  return new RNA_SugarCloseEnergy;
109 }
110 
111 
112 ///////////////////////////////////////////////////////////////////////////////
113 void
115 {
117 }
118 
119 
120 ///////////////////////////////////////////////////////////////////////////////
121 void
123  conformation::Residue const & rsd,
124  EnergyMap & emap ) const {
125 
126  constraints::ConstraintSet residue_rna_sugar_close_constraints;
127  add_sugar_ring_closure_constraints( rsd, residue_rna_sugar_close_constraints );
128  residue_rna_sugar_close_constraints.eval_intrares_energy( rsd, emap );
129 
130 }
131 
132 ///////////////////////////////////////////////////////////////////////////////
133 void
135  conformation::Residue const & rsd,
136  pose::Pose const &,
137  EnergyMap & emap ) const {
138  return residue_energy( rsd, emap );
139 }
140 
141 ///////////////////////////////////////////////////////////////////////////////
142 void
144  id::AtomID const & id,
145  pose::Pose const & pose,
146  kinematics::DomainMap const &, // domain_map,
147  ScoreFunction const & sfxn,
148  EnergyMap const & weights,
149  Vector & F1,
150  Vector & F2
151 ) const
152 {
153  //rna_sugar_close_constraints_->eval_atom_derivative( id, pose, sfxn, weights, F1, F2 );
154  // eval_atom_derivative became deprecated while I was working in another branch -- need to find a replacement?
155  rna_sugar_close_constraints_->deprecated_eval_atom_derivative( id, pose, sfxn, weights, F1, F2 );
156 }
157 
158 
159 /////////////////////////////////////////////////////////////////////////////////////////
160 void
163 
164  for (Size i = 1; i <= pose.total_residue(); i++ ){
166  }
167 
168 }
169 
170 /////////////////////////////////////////////////////////////////////////////////////////
171 void
173 
174  using namespace core::scoring::constraints;
175 
176  if ( !rsd.is_RNA() ) return;
177 
178  Size const & i( rsd.seqpos() );
179 
180  //fast look up!
181  Size const o4star_index=rsd.RNA_type().o4star_atom_index();
182  Size const c1star_index=rsd.RNA_type().c1star_atom_index();
183  Size const c2star_index=rsd.RNA_type().c2star_atom_index();
184  Size const c4star_index=rsd.RNA_type().c4star_atom_index();
185 
186  //consistency_check
187  if(o4star_index!=7) utility_exit_with_message("o4star_id="+ObjexxFCL::string_of(o4star_index) + "!=7");
188  if(c1star_index!=10) utility_exit_with_message("c1star_id="+ObjexxFCL::string_of(c1star_index) +"!=10");
189  if(c2star_index!=11) utility_exit_with_message("c2star_id="+ObjexxFCL::string_of(c2star_index) +"!=11");
190  if(c4star_index!=6) utility_exit_with_message("c4star_id="+ObjexxFCL::string_of(c4star_index) +"!=16");
191 
192  id::AtomID const o4star_id( o4star_index, i );
193  id::AtomID const c1star_id( c1star_index, i );
194  id::AtomID const c2star_id( c2star_index, i );
195  id::AtomID const c4star_id( c4star_index, i );
196  id::AtomID const first_base_atom_id( first_base_atom_index( rsd ), i );
197 
198  constraints::ConstraintOP dist_cst, angle1, angle2, angle3;
200  Real const delta = rsd.mainchain_torsion( DELTA );
201  RNA_FittedTorsionInfo rna_torsion_fitted_info;
202  Real const delta_cutoff = rna_torsion_fitted_info.delta_cutoff();
203  if ( delta < delta_cutoff ) { //NORTH
204  dist_cst = new AtomPairConstraint( o4star_id, c1star_id,
206  angle1 = new AngleConstraint( o4star_id, c1star_id, c2star_id,
208  angle2 = new AngleConstraint( c4star_id, o4star_id, c1star_id,
210  angle3 = new AngleConstraint( o4star_id, c1star_id, first_base_atom_id,
212  } else { //SOUTH
213  dist_cst = new AtomPairConstraint( o4star_id, c1star_id,
215  angle1 = new AngleConstraint( o4star_id, c1star_id, c2star_id,
217  angle2 = new AngleConstraint( c4star_id, o4star_id, c1star_id,
219  angle3 = new AngleConstraint( o4star_id, c1star_id, first_base_atom_id,
221  }
222  } else {
223  dist_cst =
225  angle1 =
226  new AngleConstraint( o4star_id, c1star_id, c2star_id, o4star_c1star_c2star_angle_harm_func_, rna_sugar_close );
227  angle2 =
228  new AngleConstraint( c4star_id, o4star_id, c1star_id, c4star_o4star_c1star_angle_harm_func_, rna_sugar_close );
229  angle3 =
230  new AngleConstraint( o4star_id, c1star_id, first_base_atom_id, o4star_c1star_first_base_angle_harm_func_, rna_sugar_close );
231  }
232 
233  cst_set.add_constraint( dist_cst );
234  cst_set.add_constraint( angle1 ); //Note to Rhiju (12/25/2011): Previously in Trunk version, angle1 was not added to the cst_set!
235  cst_set.add_constraint( angle2 );
236  cst_set.add_constraint( angle3 );
237 
238 }
239 
240 
241 
243 
246 {
247  return 1; // A new torsion potential (integration from Das lab branch -- Aug 2011)
248 }
249 
250 
251 } // rna
252 } // scoring
253 } // core
254