Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DNABFormPotential.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/DNABFormPotential.cc
10 /// @brief DNA B-form specific torsion potential class implementation
11 /// @author Jim Havranek
12 
13 // Unit Headers
15 
16 // Package Headers
18 
19 // Project Headers
20 #include <core/chemical/AA.hh>
21 #include <core/pose/Pose.hh>
22 //#include <core/io/database/open.hh>
23 //#include <basic/options/option.hh>
24 
25 // Numeric Headers
26 #include <numeric/angle.functions.hh>
27 #include <numeric/interpolation/periodic_range/half/interpolation.hh>
28 #include <numeric/random/random.hh>
29 #include <numeric/conversions.hh>
30 
31 // Utility Headers
32 #include <utility/pointer/ReferenceCount.hh>
33 #include <utility/io/izstream.hh>
34 
35 // ObjexxFCL Headers
36 #include <ObjexxFCL/FArray1D.hh>
37 #include <ObjexxFCL/FArray2D.hh>
38 #include <ObjexxFCL/FArray4D.hh>
39 #include <ObjexxFCL/string.functions.hh>
40 
41 #include <basic/basic.hh>
42 #include <basic/Tracer.hh>
43 
44 static basic::Tracer tr( "core.scoring.dna.DNABFormPotential" );
45 
46 using namespace ObjexxFCL;
47 
48 namespace core {
49 namespace scoring {
50 namespace dna {
51 
52 ///////////////////////////////////////////////////////////////////////////////
53 ///
54 Real
55 TorsionFourierComponent::compute( Real const torsion_angle, Real & return_deriv ) const
56 {
57  using numeric::conversions::radians;
58 
59  Real score( 0.0 );
60 
61  // the torsion_angle and the phase should be in degrees
62  Real const trig_term( radians( ( periodicity()*torsion_angle ) - phase() ) );
63 
64  score = factor()*( 1.0 + cos( trig_term ) );
65  return_deriv = -1.0*factor()*periodicity()*sin( trig_term );
66 
67  return score;
68 }
69 
70 ///////////////////////////////////////////////////////////////////////////////
71 ///
72 
73 DNABFormPotential::DNABFormPotential()
74 {
75  dummy_ = 0;
76  init_dna_bform_data();
77 }
78 
79 ///////////////////////////////////////////////////////////////////////////////
80 ///
81 
82 void
83 DNABFormPotential::init_dna_bform_data()
84 {
85 
86  // Parameters for DNA backbone torsions are taken from the Amber MM code -
87  // Alpha and gamma are from the refitting of Perez et.al. in Biophys. J. (2007)
88  // v92 pp. 3816-3829.
89  // The rest are taken from the parm99 parameter set available with the Ambertools
90  // online.
91  // It is my understanding that these should also work for RNA.
92  // -jjh
93 
95  alpha_components.push_back( new TorsionFourierComponent( 0.185181, 1.0, 31.79508 ) );
96  alpha_components.push_back( new TorsionFourierComponent( 1.256531, 2.0, 351.95960 ) );
97  alpha_components.push_back( new TorsionFourierComponent( 0.354858, 3.0, 357.24748 ) );
98 
100  beta_components.push_back( new TorsionFourierComponent( 1.150000, 3.0, 0.00000 ) );
101 
103  gamma_components.push_back( new TorsionFourierComponent( 1.178040, 1.0, 190.97653 ) );
104  gamma_components.push_back( new TorsionFourierComponent( 0.092102, 2.0, 295.63279 ) );
105  gamma_components.push_back( new TorsionFourierComponent( 0.962830, 3.0, 348.09535 ) );
106 
108  delta_components.push_back( new TorsionFourierComponent( 1.400000, 3.0, 0.00000 ) );
109 
111  epsilon_components.push_back( new TorsionFourierComponent( 1.150000, 3.0, 0.00000 ) );
112 
114  zeta_components.push_back( new TorsionFourierComponent( 1.200000, 2.0, 0.00000 ) );
115  zeta_components.push_back( new TorsionFourierComponent( 0.250000, 3.0, 0.00000 ) );
116 
117  bb_fourier_data.push_back( alpha_components );
118  bb_fourier_data.push_back( beta_components );
119  bb_fourier_data.push_back( gamma_components );
120  bb_fourier_data.push_back( delta_components );
121  bb_fourier_data.push_back( epsilon_components );
122  bb_fourier_data.push_back( zeta_components );
123 
124 }
125 
126 ///////////////////////////////////////////////////////////////////////////////
127 ///
128 void
129 DNABFormPotential::eval_dna_bform_bb_torsion_score_residue(
130  conformation::Residue const & rsd,
131  Real & score,
132  Real & dscore_dchi,
133  Size const torsion_id
134 ) const
135 {
136  using namespace numeric;
137 
138  assert( rsd.is_DNA() );
139 
140  // Get the correct set of dihedral score components
141  utility::vector1< TorsionFourierComponentCOP > const & this_data( bb_fourier_data[ torsion_id ] );
142 
143  Real total_score( 0.0 );
144  Real total_deriv( 0.0 );
145 
146  // This loop sums over all the Fourier components for a dihedral's total score
147  for( Size icomp( 1 ) ; icomp <= this_data.size() ; ++icomp ) {
148  Real this_deriv( 0.0 );
149  total_score += (this_data[icomp])->compute( rsd.mainchain_torsion( torsion_id ), this_deriv );
150  total_deriv += this_deriv;
151  }
152 
153  score = total_score;
154  dscore_dchi = total_deriv;
155 
156 }
157 
158 ///////////////////////////////////////////////////////////////////////////////
159 ///
160 void
161 DNABFormPotential::eval_dna_bform_chi_torsion_score_residue(
162  conformation::Residue const & rsd,
163  Real & score,
164  Real & dscore_dchi
165 ) const
166 {
167  using namespace numeric;
168 
169  assert( rsd.is_DNA() );
170 
171  Real chi = basic::unsigned_periodic_range( (rsd.chi())[1], 360.0 );
172 
173 // tr << "Found chi of " << chi << " for " << rsd.seqpos() << std::endl;
174 
175  // Very hacky for now - decide whether syn or anti, then pick a value based
176  // on whether a purine or pyrimidine base.
177 
178  bool syn( false );
179  if( chi > 0.0 && chi < 90.0 ) {
180 // tr << "Using syn data " << std::endl;
181  syn = true;
182  } else {
183 // tr << "Using anti data " << std::endl;
184  syn = false;
185  }
186 
187  Real pot_min;
188  Real pot_width;
189  Real pot_depth( 1.0 );
190  if( rsd.aa() == core::chemical::na_ade || rsd.aa() == core::chemical::na_gua ) {
191  // purines
192  if( syn ) {
193  pot_min = 45.0;
194  pot_width = 8.0;
195  } else {
196  pot_min = 258.0;
197  pot_width = 14.0;
198  }
199  } else {
200  // pyrimidines
201  if( syn ) {
202  pot_min = 45.0;
203  pot_width = 8.0;
204  } else {
205  pot_min = 241.0;
206  pot_width = 8.0;
207  }
208  }
209 
210  score = (pot_depth*( chi - pot_min )*( chi - pot_min ))/( pot_width * pot_width );
211  dscore_dchi = -1.0*(pot_depth/(pot_width*pot_width))*( chi - pot_min );
212 
213 }
214 
215 
216 }
217 }
218 }