Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PseudocontactShiftEnergy.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  //////////////////////////////////////////////
11  /// @begin
12  ///
13  /// @file protocols/scoring/PseudocontactShiftEnergy.cc
14  ///
15  /// @brief
16  ///
17  /// @detailed
18  ///
19  /// @param
20  ///
21  /// @return
22  ///
23  /// @remarks
24  ///
25  /// @references
26  ///
27  /// @authorsv Christophe Schmitz
28  ///
29  /// @last_modified June 2009
30  ////////////////////////////////////////////////
31 
32 
33 // Unit headers
36 
37 // Package headers
43 
44 // Project headers
46 #include <basic/options/option.hh>
47 #include <basic/options/keys/PCS.OptionKeys.gen.hh>
48 #include <core/pose/Pose.hh>
53 #include <basic/datacache/BasicDataCache.hh>
54 #include <basic/Tracer.hh>
55 
56 // Utility headers
57 #include <utility/vector1.hh>
58 
59 // Numeric headers
60 #include <numeric/xyzVector.hh>
61 
62 // Objexx headers
63 #include <ObjexxFCL/FArray1D.hh>
64 
65 // C++ headers
66 #include <sstream>
67 #include <fstream>
68 #include <iostream>
69 #include <iomanip>
70 
71 namespace protocols {
72 namespace scoring {
73 namespace methods {
74 namespace pcs {
75 
76 /// @details This must return a fresh instance of the CarbonHBondEnergy class,
77 /// never an instance already in use
81 ) const {
82  return new PCS_Energy;
83 }
84 
88  sts.push_back( core::scoring::pcs );
89  return sts;
90 }
91 
92 basic::Tracer TR_PCS_Energy("protocols.scoring.methods.pcs.PCS_Energy");
93 
94 void
96 }
97 
98 PCS_Energy &
100  std::cerr << "Error, == operator not correctly implemented in the PCS_Energy" << std::endl;
101  utility_exit_with_message("Exiting");
102  if ( this != &other ) {
103  }
104  return *this;
105 }
106 
108  parent( src )
109 {
110 }
111 
113 }
114 
115 /// c-tor
118 {}
119 
120 /// clone
123  return new PCS_Energy;
124 }
125 
126 /////////////////////////////////////////////////////////////////////////////
127 // scoring
128 /////////////////////////////////////////////////////////////////////////////
129 
130 void
133  core::scoring::EnergyMap & totals
134 ) const {
135  //using namespace conformation;
136  totals[ core::scoring::pcs ] = calculate_pcs_score( pose, false );
137 
138 } // finalize_total_energy
139 
140 
141 
142 PCS_data &
144 
146 
147  if ( (!have_exclusions_changed) &&
149  return *( static_cast< PCS_data * >( pose.data().get_ptr( core::pose::datacache::CacheableDataType::PSEUDOCONTACT_SHIFT_DATA )() ) );
150  }
151 
153 
154  using namespace basic::options;
155  using namespace basic::options::OptionKeys;
156 
157  utility::vector1<std::string> vec_filename;
158  utility::vector1<core::Real> vec_weight;
161 
162  TR_PCS_Energy << "Initialization of PCS_data" << std::endl;
163 
164  if(vec_filename.size() == 0){
165  utility_exit_with_message("Missing input file for PCS. Review your setup file");
166  }
167 
168  PCS_data_input pcs_d_i = PCS_data_input_manager::get_instance()->get_input_data(vec_filename, vec_weight);
169 
170  PCS_dataOP pcs_d;
171  if (has_exclude_residues) {
172  utility::vector1< bool > exclude_residues;
174  pcs_d = new PCS_data(pcs_d_i, exclude_residues);
175  } else {
176  pcs_d = new PCS_data(pcs_d_i);
177  }
178 
179  if ( have_exclusions_changed ) {
181  }
182 
184 
185  return *pcs_d;
186 }
187 
188 
189 void
191  utility::vector1<PCS_tensor> const & vec_tensor,
192  numeric::xyzVector< core::Real > const & best_coo,
193  PCS_data const & pcs_d
194 ) const
195 {
196  using namespace basic::options;
197  using namespace basic::options::OptionKeys;
198  using namespace core;
199  core::Size i, j;
200  static core::Size n_rescore(1);
202 
203  if( option[ basic::options::OptionKeys::PCS::write_extra ].user() ){
204 
205  std::string file_dump (option[ basic::options::OptionKeys::PCS::write_extra ]());
206 
207  std::ofstream myfile;
208  if(n_rescore == 1){
209  myfile.open (file_dump.c_str(), std::ios::out);
210  myfile << "# Tensor: Xxx Xxy Xxz Xyy Xyz x y z" << std::endl;
211  myfile << "# Spins: res_num atom_name PCS_exp PCS_calc PCS_dev PCS_abs_dev" << std::endl;
212  }
213  else{
214  myfile.open (file_dump.c_str(), std::ios::app);
215  }
216  if (!myfile.is_open ()){
217  std::cerr << "Unable to open the file '" << file_dump <<"'" << std::endl;
218  utility_exit();
219  }
220 
221 
222  const utility::vector1<core::Real> & X_all(pcs_d.get_X_all());
223  const utility::vector1<core::Real> & Y_all(pcs_d.get_Y_all());
224  const utility::vector1<core::Real> & Z_all(pcs_d.get_Z_all());
225 
226  for (i = 1 ; i <= pcs_d.get_n_lanthanides(); ++i){
227  PCS_data_per_lanthanides const & PCS_d_p_l (pcs_d.get_pcs_data_per_lanthanides_all()[i]);
228  utility::vector1<PCS_line_data> const & PCS_d_l_a_s (pcs_d.get_PCS_data_line_all_spin());
229 
230  myfile << "#" << PCS_d_p_l.get_filename() << " RESCORE NUMBER " << n_rescore << std::endl;
231 
232  core::Real Xxx(vec_tensor[i].chi_xx());
233  core::Real Xxy(vec_tensor[i].chi_xy());
234  core::Real Xxz(vec_tensor[i].chi_xz());
235  core::Real Xyy(vec_tensor[i].chi_yy());
236  core::Real Xyz(vec_tensor[i].chi_yz());
237  const utility::vector1<core::Size> & A_index( PCS_d_p_l.get_A_index());
238  const ObjexxFCL::FArray1D< core::Real > & fstyle_b(PCS_d_p_l.get_fstyle_b());
239 
240  myfile << "# Tensor: " << std::setw(10) << Xxx << " " << Xxy << " " << Xxz << " " << Xyy << " " << Xyz << " " << best_coo.x() << " " << best_coo.y() << " " << best_coo.z() << std::endl;
241 
242  for ( j = 1; j <= PCS_d_p_l.get_n_pcs(); ++j){
243  core::Real PCS_exp (fstyle_b(j));
244  core::Size idx (A_index[j]);
245  core::Real x (X_all[idx]);
246  core::Real y (Y_all[idx]);
247  core::Real z (Z_all[idx]);
248  core::Size res_num(PCS_d_l_a_s[idx].residue_num());
249  std::string atom_name(PCS_d_l_a_s[idx].atom_name());
250  fill_A_line(A, best_coo.x(), best_coo.y(), best_coo.z(), x, y, z);
251  core::Real PCS_calc(A[1]*Xxx + A[2]*Xxy + A[3]*Xxz + A[4]*Xyy + A[5]*Xyz);
252  core::Real PCS_dev (PCS_exp - PCS_calc);
253  core::Real PCS_abs_dev (fabs(PCS_exp - PCS_calc));
254  myfile << res_num <<" " << atom_name << std::setw(10) << PCS_exp << " " << PCS_calc<< " " << PCS_dev<< " " << PCS_abs_dev<< " " << std::endl;
255  }
256  }
257  n_rescore ++;
258  myfile.close();
259  }
260 }
261 
262 
264 PCS_Energy::calculate_pcs_score(core::pose::Pose & pdb, bool print_to_tracer) const{
265 
266  using namespace core;
267  using namespace basic::options;
268  using namespace basic::options::OptionKeys;
269 
270 
271  utility::vector1<PCS_tensor> vec_tensor;
273 
274  core::Real pcs_score_total;
275  core::Size i;
276 
277 
278  core::Real pcs_weight (PCS_Energy_parameters_manager::get_instance()->get_pcs_weight());
279 
280  PCS_data &pcs_d = PCS_data_from_pose(pdb);
281 
282  if (pcs_weight == 0){
283  return 0;
284  }
285 
286 
287  //alloc best score and vector and coordinate
288  for ( i = 1; i <= pcs_d.get_n_lanthanides(); ++i){
289  PCS_tensor PCS_t = PCS_tensor(0, 0, 0, 0, 0, ((pcs_d.get_pcs_data_per_lanthanides_all())[i]).get_filename());
290  vec_tensor.push_back(PCS_t);
291  }
292  vec_score.resize(pcs_d.get_n_lanthanides());
293 
295 
296  //call to calculate the tensors and the score
297  pcs_score_total = calculate_scores_and_tensors_from_pose_and_PCS_data(vec_score, vec_tensor, best_coo, pdb, pcs_d);
298 
299  bool minimize_best_tensor;
301 
302  print_to_tracer = false;
303 
304  if(minimize_best_tensor){
305  if(print_to_tracer){//Only called in PCS_main at the moment, quick flag.
306 
307  TR_PCS_Energy << "*** Before minimization of the tensor ***" << std::endl;
308  TR_PCS_Energy << "Score: " << pcs_score_total << std::endl;
309  TR_PCS_Energy << "Sum of: ";
310  for(i = 1; i <= vec_score.size(); ++i){
311  TR_PCS_Energy << vec_score[i] << " ";
312  }
313  TR_PCS_Energy << std::endl;
314  TR_PCS_Energy << "Score weighted: " << pcs_weight * pcs_score_total << std::endl;
315  TR_PCS_Energy << "Tensors found:" << std::endl;
316  for(i = 1; i <= vec_tensor.size(); ++i){
317  TR_PCS_Energy << vec_tensor[i] << std::endl;
318  }
319  TR_PCS_Energy << "Lanthanide position: " << best_coo.x() << " " << best_coo.y() << " " << best_coo.z() << std::endl;
320  }
321 
322  core::Real optimized_score (minimize_tensors_from_PCS_data(vec_tensor, best_coo, pcs_d));
323  // std::cerr << pcs_score_total << " -> " << optimized_score << std::endl;
324  core::Real tolerance( 0.001);
325  if((pcs_score_total + tolerance) < optimized_score){
326  TR_PCS_Energy << "Warning, optimized score has a higher value than starting position. Problem with minimizer?" << std::endl;
327  TR_PCS_Energy << pcs_score_total << " -> " << optimized_score << std::endl;
328  //utility_exit_with_message("PROBLEM WITH MINIMIZER");
329  }
330 
331  pcs_score_total = optimized_score;
332 
333  if(print_to_tracer){//Only called in PCS_main at the moment, quick flag.
334  TR_PCS_Energy << "*** After minimization of the tensor ***" << std::endl;
335  TR_PCS_Energy << "Score: " << optimized_score << std::endl;
336  TR_PCS_Energy << "Sum of: NOT AVAILABLE";
337  TR_PCS_Energy << std::endl;
338  TR_PCS_Energy << "Score weighted: " << pcs_weight * optimized_score << std::endl;
339  TR_PCS_Energy << "Tensors found:" << std::endl;
340  for(i = 1; i <= vec_tensor.size(); ++i){
341  TR_PCS_Energy << vec_tensor[i] << std::endl;
342  }
343  TR_PCS_Energy << "Lanthanide position: " << best_coo.x() << " " << best_coo.y() << " " << best_coo.z() << std::endl;
344  }
345  }
346 
347 
348  dump_PCS_info(vec_tensor, best_coo, pcs_d);
349 
350  return (pcs_weight * pcs_score_total);
351 }
352 
356  PCS_data const & pcs_d
357  ) const{
358 
359  core::Size i;
360 
361  utility::vector1<core::Real> vect_to_opt;
362  vect_to_opt.push_back(best_coo.x());
363  vect_to_opt.push_back(best_coo.y());
364  vect_to_opt.push_back(best_coo.z());
365 
366  if(vec_best_tensor.size() != pcs_d.get_n_lanthanides()){
367  utility_exit_with_message("n_lanthanides and vec_best_tensor size differs in minimize_tensors_from_PCS_data");
368  }
369 
370  for(i = 1; i <= vec_best_tensor.size(); ++i){
371  vect_to_opt.push_back(vec_best_tensor[i].chi_xx());
372  vect_to_opt.push_back(vec_best_tensor[i].chi_xy());
373  vect_to_opt.push_back(vec_best_tensor[i].chi_xz());
374  vect_to_opt.push_back(vec_best_tensor[i].chi_yy());
375  vect_to_opt.push_back(vec_best_tensor[i].chi_yz());
376  }
377 
378  TensorsOptimizer tensors_opt(pcs_d);
379  // optimization::MinimizerOptions options( "dfpmin_armijo_nonmonotone_atol", 0.0000001, true, false, false );
380  core::optimization::MinimizerOptions options( "dfpmin", 0.00001, true, false, false );
381  core::optimization::Minimizer minimizer(tensors_opt, options );
382 
383  core::Real optimized_cost(minimizer.run( vect_to_opt ));
384 
385  best_coo.assign(vect_to_opt[1], vect_to_opt[2], vect_to_opt[3]);
386 
387  for(i = 1; i <= vec_best_tensor.size(); ++i){
388  vec_best_tensor[i].reset_tensor((core::Real)vect_to_opt[3 + 5*(i-1) + 1],
389  (core::Real)vect_to_opt[3 + 5*(i-1) + 2],
390  (core::Real)vect_to_opt[3 + 5*(i-1) + 3],
391  (core::Real)vect_to_opt[3 + 5*(i-1) + 4],
392  (core::Real)vect_to_opt[3 + 5*(i-1) + 5]);
393  }
394  return (optimized_cost);
395 }
396 
397 
398 //This will be called for each new pose
401  utility::vector1<PCS_tensor> & vec_best_tensor,
403  core::pose::Pose const & pdb,
404  PCS_data & pcs_d) const{
405 
406  // using namespace basic::options;
407  // using namespace basic::options::OptionKeys;
408  core::Real x, y, z;
409  core::Real best_score, score; //, score2;
410  core::Size i;
411  core::Size size_of;
412  utility::vector1<core::Real> vec_score_temp;
413  utility::vector1<PCS_tensor> vec_tensor_temp;
414 
415  //ref to do atomic best switch in order to avoid copy stuff
416  utility::vector1<core::Real> * vec_score_ref_current;
417  utility::vector1<PCS_tensor> * vec_tensor_ref_current;
418 
419  //PCS_Energy_parameters_manager::get_instance()->print_grid_param();
420 
421  //some basic checking...
422  size_of = vec_best_score.size();
423  if((size_of != vec_best_tensor.size())||
424  (size_of != pcs_d.get_n_lanthanides())){
425  std::cerr << "Problem in calculate_scores_and_tensors_from_pose_and_PCS_data function" << std::endl;
426  std::cerr << "n_lanthanides = " << pcs_d.get_n_lanthanides();
427  std::cerr << "vec_best_tensor.size() = " << vec_best_tensor.size();
428  std::cerr << "vec_best_score.size() = " << vec_best_score.size() << std::endl;
429  utility_exit_with_message("Exiting");
430  }
431 
432  for( i = 1; i <= size_of; i++){
433  vec_tensor_temp.push_back(vec_best_tensor[i]);
434  }
435 
436  vec_score_temp.resize(size_of);
437 
438  //Must be after the resize statment!
439  vec_score_ref_current = & vec_score_temp;
440  vec_tensor_ref_current = & vec_tensor_temp;
441 
442  pcs_d.update_X_Y_Z_all(pdb);
443 
444  // TR_PCS_Energy << "Reading grid search paramaters" << std::endl;
445 
446  core::Real grid_edge (PCS_Energy_parameters_manager::get_instance()->get_grid_edge());
447  core::Real grid_step (PCS_Energy_parameters_manager::get_instance()->get_grid_step());
448  core::Real grid_small_cutoff (PCS_Energy_parameters_manager::get_instance()->get_grid_small_cutoff());
449  core::Real grid_large_cutoff (PCS_Energy_parameters_manager::get_instance()->get_grid_large_cutoff());
450  core::Real grid_cone_angle_cutoff (PCS_Energy_parameters_manager::get_instance()->get_grid_cone_angle_cutoff());
451  std::string grid_atom_name_1 (PCS_Energy_parameters_manager::get_instance()->get_grid_atom_name_1());
452  std::string grid_atom_name_2 (PCS_Energy_parameters_manager::get_instance()->get_grid_atom_name_2());
453  core::Size grid_residue_num_1 (PCS_Energy_parameters_manager::get_instance()->get_grid_residue_num_1());
454  core::Size grid_residue_num_2 (PCS_Energy_parameters_manager::get_instance()->get_grid_residue_num_2());
455  core::Real grid_k_vector (PCS_Energy_parameters_manager::get_instance()->get_grid_k_vector());
456 
457  if(grid_residue_num_1 > pdb.total_residue()){
458  std::cerr << "Error: Couldn't find residue " << grid_residue_num_1 << std::endl;
459  std::cerr << "Numbering residue within Rosetta match the sequence provided as input" << std::endl;
460  utility_exit_with_message("Can't define gridsearchiterator");
461  }
462  if( grid_residue_num_2> pdb.total_residue()){
463  std::cerr << "Error: Couldn't find residue " << grid_residue_num_1 << std::endl;
464  std::cerr << "Numbering residue within Rosetta match the sequence provided as input" << std::endl;
465  utility_exit_with_message("Can't define gridsearchiterator");
466  }
467  if( ! pdb.residue(grid_residue_num_1).has(grid_atom_name_1)){
468  std::cerr << "Error: Couldn't find the atom " << grid_atom_name_1 << " in residue " << grid_residue_num_1 << std::endl;
469  std::cerr << "Numbering residue within Rosetta match the sequence provided as input" << std::endl;
470  utility_exit_with_message("Can't define gridsearchiterator");
471  }
472  if( ! pdb.residue(grid_residue_num_2).has(grid_atom_name_2)){
473  std::cerr << "Error: Couldn't find the atom " << grid_atom_name_2 << " in residue " << grid_residue_num_2<< std::endl;
474  std::cerr << "Numbering residue within Rosetta match the sequence provided as input" << std::endl;
475  utility_exit_with_message("Can't define gridsearchiterator");
476  }
477 
478  numeric::xyzVector< core::Real > coo1 = pdb.residue(grid_residue_num_1).atom(grid_atom_name_1).xyz();
479  numeric::xyzVector< core::Real > coo2 = pdb.residue(grid_residue_num_2).atom(grid_atom_name_2).xyz();
480 
481  GridSearchIterator grid_it(coo1, coo2, grid_k_vector, grid_edge, grid_step, grid_small_cutoff, grid_large_cutoff, grid_cone_angle_cutoff);
482 
483  best_coo.assign(coo1.x(), coo1.y(), coo1.z());
484  best_score = 999999999999999999999999999.9; //std::numeric_limits::infinity();x
485  bool test_at_least_one_iteration = false;
486 
487  while(grid_it.next_center(x, y, z) == true){
488  test_at_least_one_iteration = true;
489  //TR_PCS_Energy << "trying x= " << x << "y= " << y << "z= " << z << std::endl;
490  // std::cout << x << " " << y << " " << z << " SCANNER " << std::endl;
491  pcs_d.update_matrix_A_all(x, y, z);
492 
493  score = 0;
494  for(i = 1; i <= pcs_d.get_n_lanthanides(); ++i){
495  (*vec_score_ref_current)[i] = pcs_d.get_pcs_data_per_lanthanides_all()[i].calculate_tensor_and_cost_with_svd((*vec_tensor_ref_current)[i]);
496  //score += (*vec_score_ref_current)[i];
497  score += (*vec_score_ref_current)[i] * (*vec_score_ref_current)[i];
498 
499  if (score > best_score){ // if a single lanthanide already give a worse score, no need to look for other lanthanides
500  continue;
501  }
502  }
503 
504  if ( score < best_score){
505  best_score = score;
506 
507  best_coo.assign(x, y, z);
508 
509  //atomic switch
510  if((vec_score_ref_current != &vec_score_temp) && (vec_score_ref_current != &vec_best_score)){ //test to make sure...
511  std::cerr << "Problem in calculate_scores_and_tensors_from_pose_and_PCS_data function" << std::endl;
512  std::cerr << "The atomic switch is not working (1)" << std::endl;
513  utility_exit_with_message("Exiting");
514  }
515  if(vec_tensor_ref_current == &vec_best_tensor){
516  vec_tensor_ref_current = &vec_tensor_temp;
517  vec_score_ref_current = &vec_score_temp;
518  }
519  else{
520  if(vec_tensor_ref_current != &vec_tensor_temp){ //test to make sure...
521  std::cerr << "Problem in calculate_scores_and_tensors_from_pose_and_PCS_data function" << std::endl;
522  std::cerr << "The atomic switch is not working (2)" << std::endl;
523  utility_exit_with_message("Exiting");
524  }
525  vec_tensor_ref_current = &vec_best_tensor;
526  vec_score_ref_current = &vec_best_score;
527  }
528  //end atomic switch
529  }
530  } //while
531 
532 
533  if(test_at_least_one_iteration == false){
534  std::cerr << "The description of the grid search given is too restrictive" << std::endl;
535  utility_exit_with_message("Exiting");
536  }
537 
538  if( vec_tensor_ref_current == &vec_best_tensor ){
539  for(i = 1; i <= vec_best_score.size(); ++i){
540  vec_best_tensor[i].copy_from_ref(vec_tensor_temp[i]);
541  }
542  }
543 
544  if( vec_score_ref_current == &vec_best_score ){
545  for(i = 1; i <= vec_best_score.size(); ++i){
546  vec_best_score[i] = vec_score_temp[i];
547  }
548  }
549  return (sqrt(best_score));
550 }
551 
554 {
555  return 1; // Initial versioning
556 }
557 
560  if ( instance_ == 0 ){
561  instance_ = new PCS_Energy_parameters_manager();
562  }
563  return instance_;
564 }
565 
567  /*
568 //Do I need to initialize to some values?? In principle no.
569  grid_edge_ = 20;
570  grid_step_ = 2;
571  grid_small_cutoff_ = 4;
572  grid_large_cutoff_ = 10;
573  grid_cone_angle_cutoff_ = 180;
574  grid_atom_name_1_ = "CA";
575  grid_atom_name_2_ = "CB";
576  grid_residue_num_1_ = 68;
577  grid_residue_num_2_ = 68;
578  grid_k_vector_ = 1;
579  minimize_best_tensor_ = true;
580  pcs_weight_ = 100;
581  */
582 
583  utility::vector1< bool > tmp(false, 0);
584  vec_exclude_residues_ = tmp;
585  vec_exclude_residues_exists_ = false;
586  vec_exclude_residues_changed_ = false;
587 }
588 
589 
590 //rvernon -> partial PCS score machinery in development
591 
592 // The input exclude residues vector is a list of residue numbers
593 // This function converts that into a vector of bools, where the index numbers are residues,
594 // so excluded residues return "true" and non excluded residues return "false"
595 //
596 // This is sized up to the largest excluded residue, so when doing the exclusion check you also have
597 // to say "excluded = false" for residues outside of the array.
598 void
600 
601  if (vec_exclude.size() > 0) {
602 
603  core::Size largest_n = 0;
604 
605  for (core::Size i = 1; i <= vec_exclude.size(); ++i) {
606  if ( vec_exclude[i] > largest_n ) {
607  largest_n = vec_exclude[i];
608  }
609  }
610 
611  utility::vector1< bool > temp (largest_n, false);
612 
613  for (core::Size i = 1; i <= vec_exclude.size(); ++i) {
614  temp[vec_exclude[i]] = true;
615  }
616 
617  if ( vec_exclude_residues_ == temp ) {
618  vec_exclude_residues_changed_ = false;
619  } else {
620  vec_exclude_residues_changed_ = true;
621  }
622 
623  vec_exclude_residues_ = temp;
624  vec_exclude_residues_exists_ = true;
625  }
626 }
627 
628 void
630  utility::vector1< bool > temp (false, 0);
631  vec_exclude_residues_ = temp;
632  vec_exclude_residues_exists_ = false;
633  vec_exclude_residues_changed_ = true;
634 }
635 
636 bool
638  return vec_exclude_residues_exists_;
639 }
640 
641 bool
643  return vec_exclude_residues_changed_;
644 }
645 
646 
649  return vec_exclude_residues_;
650 }
651 
652 void
654  vec_exclude_residues_changed_ = false;
655 }
656 
657 
658 //rvernon
659 
660 void
662  utility::vector1<core::Real> const vec_individual_weight){
663 
664  vec_filename_ = vec_filename;
665  vec_individual_weight_ = vec_individual_weight;
666 }
667 
668 void
670  core::Real const grid_step,
671  core::Real const grid_small_cutoff,
672  core::Real const grid_large_cutoff,
673  core::Real const grid_cone_angle_cutoff,
674  std::string const grid_atom_name_1,
675  std::string const grid_atom_name_2,
676  core::SSize const grid_residue_num_1,
677  core::SSize const grid_residue_num_2,
678  core::Real const grid_k_vector,
679  bool const minimize_best_tensor,
680  core::Real const pcs_weight
681  ){
682 
683  if((grid_residue_num_1 < 0)||(grid_residue_num_2 < 0)){
684  utility_exit_with_message("Residue num negative. Please review your setup files");
685  }
686  core::Size grid_residue_num_1_positif(grid_residue_num_1);
687  core::Size grid_residue_num_2_positif(grid_residue_num_2);
688 
689  grid_edge_ = grid_edge;
690  grid_step_ = grid_step;
691  grid_small_cutoff_ = grid_small_cutoff;
692  grid_large_cutoff_ = grid_large_cutoff;
693  grid_cone_angle_cutoff_ = grid_cone_angle_cutoff;
694  grid_atom_name_1_ = grid_atom_name_1;
695  grid_atom_name_2_ = grid_atom_name_2;
696  grid_residue_num_1_ = grid_residue_num_1_positif;
697  grid_residue_num_2_ = grid_residue_num_2_positif;
698  grid_k_vector_ = grid_k_vector;
699  minimize_best_tensor_ = minimize_best_tensor;
700  pcs_weight_ = pcs_weight;
701 }
702 
703 void
705  std::cout <<
706  grid_edge_<< " " <<
707  grid_step_<<" " <<
708  grid_small_cutoff_<<" " <<
709  grid_large_cutoff_<<" " <<
710  grid_cone_angle_cutoff_<<" " <<
711  grid_atom_name_1_<<" " <<
712  grid_atom_name_2_<<" " <<
713  grid_residue_num_1_<<" " <<
714  grid_residue_num_2_<<" " <<
715  grid_k_vector_<<" " <<
716  minimize_best_tensor_<<" " <<
717  pcs_weight_<<" " <<
718  std::endl;
719 }
720 
721 
722  // void
723  // PCS_Energy_parameters_manager::print_grid_param() const;
724 
725  core::Real
727  return grid_edge_;
728  }
729 
730  core::Real
732  return grid_step_;
733  }
734 
735  core::Real
737  return grid_small_cutoff_;
738  }
739 
740  core::Real
742  return grid_large_cutoff_;
743  }
744 
745  core::Real
747  return grid_cone_angle_cutoff_;
748  }
749 
752  return grid_atom_name_1_;
753  }
754 
757  return grid_atom_name_2_;
758  }
759 
760  core::Size
762  return grid_residue_num_1_;
763  }
764 
765  core::Size
767  return grid_residue_num_2_;
768  }
769 
770  core::Real
772  return grid_k_vector_;
773  }
774 
775  bool
777  return minimize_best_tensor_;
778  }
779 
780  core::Real
782  return pcs_weight_;
783  }
784 
787  return vec_filename_;
788  }
789 
792  return vec_individual_weight_;
793  }
794 
796 
797 } // pcs
798 } // methods
799 } // scoring
800 } // protocols