Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PcsGridSearchParameter.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/methods/pcs2/PcsGridSearchParameter.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 February 2010
30  ////////////////////////////////////////////////
31 
32 
33 // Unit Headers
35 
36 // Package Headers
37 
38 // Project Headers
39 #include <basic/Tracer.hh>
40 
41 // Utility headers
42 #include <utility/exit.hh>
43 
44 // ObjexxFCL Headers
45 
46 // C++ headers
47 #include <iostream>
48 
49 #include <utility/vector1.hh>
50 
51 
52 static basic::Tracer TR_PcsGridSearchParameter("protocols.scoring.methods.pcs.PcsGridSearchParameter");
53 
54 
55 namespace protocols {
56 namespace scoring {
57 namespace methods {
58 namespace pcs2 {
59 
60 using namespace protocols;
61 
63 }
64 
67  if ( this != &other ) {
68  include_only_start_stage1_ = other.include_only_start_stage1_;
69  include_only_start_stage2_ = other.include_only_start_stage2_;
70  include_only_start_stage3_ = other.include_only_start_stage3_;
71  include_only_start_stage4_ = other.include_only_start_stage4_;
72 
73  include_only_end_stage1_ = other.include_only_end_stage1_;
74  include_only_end_stage2_ = other.include_only_end_stage2_;
75  include_only_end_stage3_ = other.include_only_end_stage3_;
76  include_only_end_stage4_ = other.include_only_end_stage4_;
77 
78  n_trial_min_stage1_ = other.n_trial_min_stage1_;
79  n_trial_min_stage2_ = other.n_trial_min_stage2_;
80  n_trial_min_stage3_ = other.n_trial_min_stage3_;
81  n_trial_min_stage4_ = other.n_trial_min_stage4_;
82 
83  pcs_weight_stage1_ = other.pcs_weight_stage1_;
84  pcs_weight_stage2_ = other.pcs_weight_stage2_;
85  pcs_weight_stage3_ = other.pcs_weight_stage3_;
86  pcs_weight_stage4_ = other.pcs_weight_stage4_;
87 
88  individual_scale_stage1_ = other.individual_scale_stage1_;
89  individual_scale_stage2_ = other.individual_scale_stage2_;
90  individual_scale_stage3_ = other.individual_scale_stage3_;
91  individual_scale_stage4_ = other.individual_scale_stage4_;
92 
93  filenames_ = other.filenames_;
94  individual_weights_ = other.individual_weights_;
95 
96  }
97  return *this;
98 }
99 
100 
102 
103  include_only_start_stage1_ = other.include_only_start_stage1_;
104  include_only_start_stage2_ = other.include_only_start_stage2_;
105  include_only_start_stage3_ = other.include_only_start_stage3_;
106  include_only_start_stage4_ = other.include_only_start_stage4_;
107 
108  include_only_end_stage1_ = other.include_only_end_stage1_;
109  include_only_end_stage2_ = other.include_only_end_stage2_;
110  include_only_end_stage3_ = other.include_only_end_stage3_;
111  include_only_end_stage4_ = other.include_only_end_stage4_;
112 
113  n_trial_min_stage1_ = other.n_trial_min_stage1_;
114  n_trial_min_stage2_ = other.n_trial_min_stage2_;
115  n_trial_min_stage3_ = other.n_trial_min_stage3_;
116  n_trial_min_stage4_ = other.n_trial_min_stage4_;
117 
118  pcs_weight_stage1_ = other.pcs_weight_stage1_;
119  pcs_weight_stage2_ = other.pcs_weight_stage2_;
120  pcs_weight_stage3_ = other.pcs_weight_stage3_;
121  pcs_weight_stage4_ = other.pcs_weight_stage4_;
122 
123  individual_scale_stage1_ = other.individual_scale_stage1_;
124  individual_scale_stage2_ = other.individual_scale_stage2_;
125  individual_scale_stage3_ = other.individual_scale_stage3_;
126  individual_scale_stage4_ = other.individual_scale_stage4_;
127 
128 
129  filenames_ = other.filenames_;
130  individual_weights_ = other.individual_weights_;
131 }
132 
133 
135 
136  include_only_start_stage1_ = 0;
137  include_only_start_stage2_ = 0;
138  include_only_start_stage3_ = 0;
139  include_only_start_stage4_ = 0;
140 
141  include_only_end_stage1_ = 0;
142  include_only_end_stage2_ = 0;
143  include_only_end_stage3_ = 0;
144  include_only_end_stage4_ = 0;
145 
146  n_trial_min_stage1_ = 0;
147  n_trial_min_stage2_ = 0;
148  n_trial_min_stage3_ = 0;
149  n_trial_min_stage4_ = 0;
150 
151  pcs_weight_stage1_ = 1.0;
152  pcs_weight_stage2_ = 1.0;
153  pcs_weight_stage3_ = 1.0;
154  pcs_weight_stage4_ = 1.0;
155 
156  individual_scale_stage1_ = -1.0;
157  individual_scale_stage2_ = -1.0;
158  individual_scale_stage3_ = -1.0;
159  individual_scale_stage4_ = -1.0;
160 
161 }
162 
163 
164 std::ostream &
165 operator << ( std::ostream& out, const PcsGridSearchParameter &me ){
166  out << "pcs_weight_stage[1->4] " <<
167  me.pcs_weight_stage1_ << " " <<
168  me.pcs_weight_stage2_ << " " <<
169  me.pcs_weight_stage3_ << " " <<
170  me.pcs_weight_stage4_ << " " <<std::endl;
171 
172  out << "include_only_start_stage[1->4] " <<
173  me.include_only_start_stage1_ << " " <<
174  me.include_only_start_stage2_ << " " <<
175  me.include_only_start_stage3_ << " " <<
176  me.include_only_start_stage4_ << " " <<std::endl;
177 
178  out << "include_only_end_stage[1->4] " <<
179  me.include_only_end_stage1_ << " " <<
180  me.include_only_end_stage2_ << " " <<
181  me.include_only_end_stage3_ << " " <<
182  me.include_only_end_stage4_ << " " <<std::endl;
183 
184  out << "n_trial_min_stage[1->4] " <<
185  me.n_trial_min_stage1_ << " " <<
186  me.n_trial_min_stage2_ << " " <<
187  me.n_trial_min_stage3_ << " " <<
188  me.n_trial_min_stage4_ << " " <<std::endl;
189 
190  out << "individual_scale[1->4] " <<
191  me.individual_scale_stage1_<< " " <<
192  me.individual_scale_stage2_<< " " <<
193  me.individual_scale_stage3_<< " " <<
194  me.individual_scale_stage4_<< " " <<std::endl;
195 
196  out <<"filenames / individual_weights" << std::endl;
197  core::Size i;
198  for(i = 1; i <= me.filenames_.size(); ++i){
199  out <<" "<< me.filenames_[i] << " " << me.individual_weights_[i] << std::endl;
200  }
201 
202  return out;
203 }
204 
205 void
207  std::cerr << "In the definition of the grid search parameters for the PseudocontactShift, you should ensure that for all stages:" << std::endl;
208  std::cerr << "1. the PCS_WEIGHT is positif" << std::endl;
209  std::cerr << "2. the weight of each lanthanide is positif" << std::endl;
210  std::cerr << "3. If the INCLUDE_ONLY tag is used: 0 < residue_start < residue_end" << std::endl;
211  std::cerr << "4. If the INDIVIDUAL_SCALE tag is used: its value must be positive" << std::endl;
212  std::cerr << "Looks like the problem is " << id << std::endl;
213  utility_exit_with_message("Please, review your PseudocontactShift parameter file and correct it");
214 }
215 
216 bool
218  if((start == 0) && (end == 0)){
219  return true;
220  }
221  if (start == 0 ){
222  return false;
223  }
224  if(start >= end){
225  return false;
226  }
227  return true;
228 }
229 
230 void
232 
233  core::Size i;
234  if(
235  (pcs_weight_stage1_ < 0)||
236  (pcs_weight_stage2_ < 0)||
237  (pcs_weight_stage3_ < 0)||
238  (pcs_weight_stage4_ < 0)
239  ){
241  }
242  if(valide_include_only_stage(include_only_start_stage1_, include_only_end_stage1_) == false){
244  }
245  if(valide_include_only_stage(include_only_start_stage2_, include_only_end_stage2_) == false){
247  }
248  if(valide_include_only_stage(include_only_start_stage3_, include_only_end_stage3_) == false){
250  }
251  if(valide_include_only_stage(include_only_start_stage4_, include_only_end_stage4_) == false){
253  }
254  if(
255  (individual_scale_stage1_ < 0) ||
256  (individual_scale_stage2_ < 0) ||
257  (individual_scale_stage3_ < 0) ||
258  (individual_scale_stage4_ < 0)
259  ){
260  if(
261  (individual_scale_stage1_ != -1.0) &&
262  (individual_scale_stage2_ != -1.0) &&
263  (individual_scale_stage3_ != -1.0) &&
264  (individual_scale_stage4_ != -1.0)
265  ){
267  }
268  }
269 
270  for(i = 1; i <= individual_weights_.size(); i++){
271  if(individual_weights_[i] < 0 ){
273  }
274  }
275 
276 }
277 
278 }//namespace pcs2
279 }//namespace methods
280 }//namespace scoring
281 }//namespace protocols