Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HBondOptions.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/hbonds/HBondOptions.cc
11 /// @brief HBondOptions class, holds the options for the hbond energy function
12 /// @author Matthew O'Meara
13 
14 /// @detail
15 /// To add an additional option for hydrogen bonds do the following:
16 ///
17 /// In HBondOptions.hh:
18 /// 1) add it to the default constructor
19 /// 2) add it to the copy constructor
20 /// 3) add a getter and a setter
21 /// 4) add it to operator==
22 /// 5) add it to the private data
23 /// 6) add it to HBondOptions::show
24 
25 // Unit Headers
27 
28 // Package Headers
29 #include <basic/options/option.hh>
30 #include <basic/options/keys/corrections.OptionKeys.gen.hh> //pba
31 #include <basic/options/keys/dna.OptionKeys.gen.hh> //sthyme
32 #include <basic/options/keys/score.OptionKeys.gen.hh>
33 #include <basic/options/keys/membrane.OptionKeys.gen.hh> //pba
34 
35 // C++ Headers
36 #include <string>
37 #include <iostream>
38 
39 #include <utility/vector1.hh>
40 
41 
42 
43 namespace core {
44 namespace scoring {
45 namespace hbonds {
46 
48  exclude_DNA_DNA_( true ),
49  include_intra_res_RNA_( false ),
50  exclude_self_hbonds_( true ),
51  use_hb_env_dep_ ( true ),
52  use_hb_env_dep_DNA_( true ),
53  smooth_hb_env_dep_( true ),
54  bb_donor_acceptor_check_( true ),
55  decompose_bb_hb_into_pair_energies_( false ),
56  params_database_tag_(params_db_tag),
57  use_incorrect_deriv_( true ),
58  use_sp2_chi_penalty_( false ),
59  sp2_BAH180_rise_( 0.75 ),
60  measure_sp3acc_BAH_from_hvy_( false ),
61  Mbhbond_( false ) //pba
62 {
63  using namespace basic::options;
64  if (option.has(OptionKeys::membrane::Mhbond_depth) &&
65  option[OptionKeys::membrane::Mhbond_depth].user()){
66  Mbhbond_ = option[OptionKeys::membrane::Mhbond_depth];//pba
67  }
68  exclude_DNA_DNA_ = option[OptionKeys::dna::specificity::exclude_dna_dna]; // adding because this parameter should absolutely be false for any structure with DNA in it and it doesn't seem to be read in via the weights file method, so now it's an option - sthyme
69  use_incorrect_deriv_ = option[OptionKeys::corrections::score::use_incorrect_hbond_deriv];
70  use_sp2_chi_penalty_ = option[OptionKeys::corrections::score::hb_sp2_chipen ];
71  bb_donor_acceptor_check_ = ! option[ OptionKeys::score::hbond_disable_bbsc_exclusion_rule ];
72  sp2_BAH180_rise_ = option[ OptionKeys::corrections::score::hb_sp2_BAH180_rise ];
73  measure_sp3acc_BAH_from_hvy_ = option[ OptionKeys::corrections::score::hbond_measure_sp3acc_BAH_from_hvy ];
74 }
75 
76 
77 
79  exclude_DNA_DNA_( true ),
80  include_intra_res_RNA_( false ),
81  exclude_self_hbonds_( true ),
82  use_hb_env_dep_ ( true ),
83  use_hb_env_dep_DNA_( true ),
84  smooth_hb_env_dep_( true ),
87  params_database_tag_("standard_params"),
88  use_incorrect_deriv_( false ),
89  use_sp2_chi_penalty_( false ),
90  sp2_BAH180_rise_( 0.75 ),
92  Mbhbond_( false ) //pba
93 {
94  using namespace basic::options;
95  if (option.has(OptionKeys::score::hbond_params) &&
96  option[OptionKeys::score::hbond_params].user()){
97  params_database_tag_ = option[OptionKeys::score::hbond_params];
98  }
99  if (option.has(OptionKeys::membrane::Mhbond_depth) &&
100  option[OptionKeys::membrane::Mhbond_depth].user()){
101  Mbhbond_ = option[OptionKeys::membrane::Mhbond_depth];//pba
102  }
103  exclude_DNA_DNA_ = option[OptionKeys::dna::specificity::exclude_dna_dna]; // adding because this parameter should absolutely be false for any structure with DNA in it and it doesn't seem to be read in via the weights file method, so now it's an option - sthyme
104  use_incorrect_deriv_ = option[OptionKeys::corrections::score::use_incorrect_hbond_deriv];
105  use_sp2_chi_penalty_ = option[OptionKeys::corrections::score::hb_sp2_chipen ];
106  bb_donor_acceptor_check_ = ! option[ OptionKeys::score::hbond_disable_bbsc_exclusion_rule ];
107  sp2_BAH180_rise_ = option[ OptionKeys::corrections::score::hb_sp2_BAH180_rise ];
108  measure_sp3acc_BAH_from_hvy_ = option[ OptionKeys::corrections::score::hbond_measure_sp3acc_BAH_from_hvy ];
109 }
110 
111 /// copy constructor
113  ReferenceCount( src )
114 {
115  *this = src;
116 }
117 
119 
120 /// copy operator
121 HBondOptions const &
123 {
137  Mbhbond_ = src.Mbhbond_; //pba
138  return *this;
139 }
140 
141 ///
142 bool
144 {
145  return exclude_DNA_DNA_;
146 }
147 
148 ///
149 void
150 HBondOptions::exclude_DNA_DNA( bool const setting )
151 {
152  exclude_DNA_DNA_ = setting;
153 }
154 
155 ///
156 bool
158 {
159  return include_intra_res_RNA_;
160 }
161 
162 ///
163 void
165 {
166  include_intra_res_RNA_ = setting;
167 }
168 
169 ///
170 bool
172 {
173  return exclude_self_hbonds_;
174 }
175 
176 ///
177 void
179 {
180  exclude_self_hbonds_ = setting;
181 }
182 
183 
184 
185 
186 ///
187 bool
189 {
190  return use_hb_env_dep_DNA_;
191 }
192 
193 ///
194 void
195 HBondOptions::use_hb_env_dep_DNA( bool const setting )
196 {
197  use_hb_env_dep_DNA_ = setting;
198 }
199 
200 ///
201 bool
203 {
204  return use_hb_env_dep_;
205 }
206 
207 ///
208 void
209 HBondOptions::use_hb_env_dep( bool const setting )
210 {
211  use_hb_env_dep_ = setting;
212 }
213 
214 ///
215 bool
217 {
218  return smooth_hb_env_dep_;
219 }
220 
221 ///
222 void
223 HBondOptions::smooth_hb_env_dep( bool const setting )
224 {
225  smooth_hb_env_dep_ = setting;
226 }
227 
228 ///
229 bool
231 {
233 }
234 
235 ///
236 void
238 {
240 }
241 
242 ///
243 bool
245 {
247 }
248 
249 ///
250 void
252 {
253  bb_donor_acceptor_check_ = setting;
254 }
255 
256 ///
257 std::string const &
259 {
260  return params_database_tag_;
261 }
262 
263 ///
264 void
266 {
267  params_database_tag_ = setting;
268 }
269 
270 ///pba
271 bool
273 {
274  return Mbhbond_;
275 }
276 
277 ///
278 void
279 HBondOptions::Mbhbond( bool const setting )
280 {
281  Mbhbond_ = setting;
282 }
283 
284 ///
285 bool
287 {
288  return use_incorrect_deriv_;
289 }
290 
291 ///
292 void
294 {
295  use_incorrect_deriv_ = setting;
296 }
297 
299 {
300  return use_sp2_chi_penalty_;
301 }
302 
304 {
305  use_sp2_chi_penalty_ = setting;
306 }
307 
310 
313 
314 
315 bool
316 operator==( HBondOptions const & a, HBondOptions const & b )
317 {
318  return ( ( a.exclude_DNA_DNA_ == b.exclude_DNA_DNA_ ) &&
321  ( a.use_hb_env_dep_ == b.use_hb_env_dep_ ) &&
329  ( a.sp2_BAH180_rise_ == b.sp2_BAH180_rise_ ) &&
331  ( a.Mbhbond_ == b.Mbhbond_ ) ); //pba
332 }
333 
334 bool
335 operator!=( HBondOptions const & a, HBondOptions const & b )
336 {
337  return !( a == b );
338 }
339 
340 std::ostream &
341 operator<< ( std::ostream & out, const HBondOptions & options ){
342  options.show( out );
343  return out;
344 }
345 
346 ///
347 void
348 HBondOptions::show( std::ostream & out ) const
349 {
350  out <<"HBondOptions::show: exclude_DNA_DNA: "
351  <<( exclude_DNA_DNA_ ? "true" : "false" ) << std::endl;
352  out <<"HBondOptions::show: include_intra_res_RNA_: "
353  <<( include_intra_res_RNA_ ? "true" : "false" ) << std::endl;
354  out <<"HBondOptions::show: exclude_self_hbonds: "
355  <<( exclude_self_hbonds_ ? "true" : "false" ) << std::endl;
356  out <<"HBondOptions::show: use_hb_env_dep: "
357  <<( use_hb_env_dep_ ? "true" : "false" ) << std::endl;
358  out <<"HBondOptions::show: use_hb_env_dep_DNA: "
359  <<( use_hb_env_dep_DNA_ ? "true" : "false" ) << std::endl;
360  out <<"HBondOptions::show: smooth_hb_env_dep: "
361  <<( smooth_hb_env_dep_ ? "true" : "false " ) << std::endl;
362  out <<"HBondOptions::show: bb_donor_acceptor_check: "
363  <<( bb_donor_acceptor_check_ ? "true" : "false " ) << std::endl;
364  out <<"HBondOptions::show: decompose_bb_hb_into_pair_energies: "
365  <<( decompose_bb_hb_into_pair_energies_ ? "true" : "false" ) << std::endl;
366  out <<"HBondOptions::show: params_database_tag_: "
367  << params_database_tag_ << std::endl;
368  out <<"HBondOptions::show: use_incorrect_deriv_: "
369  <<( use_incorrect_deriv_ ? "true" : "false" ) << std::endl;
370  out <<"HBondOptions::show: use_sp2_chi_penalty_: "
371  <<( use_sp2_chi_penalty_ ? "true" : "false" ) << std::endl;
372  out <<"HBondOptions::show: sp2_BAH180_rise_: "
373  << sp2_BAH180_rise_ << std::endl;
374  out <<"HBondOptions::show: measure_sp3acc_BAH_from_hvy_: "
375  <<( measure_sp3acc_BAH_from_hvy_ ? "true" : "false" ) << std::endl;
376  out <<"HBondOptions::show: Mbhbond: "
377  <<( Mbhbond_ ? "true" : "false " ) << std::endl; //pba
378 }
379 
380 }
381 }
382 }