42 #include <numeric/random/random.hh>
43 #include <utility/pointer/ReferenceCount.hh>
44 #include <utility/string_util.hh>
49 #include <utility/io/ozstream.hh>
53 #include <basic/Tracer.hh>
55 #if (defined _WIN32) && (!defined WIN_PYROSETTA)
58 #include <utility/vector1.hh>
64 namespace downstream {
65 static basic::Tracer
TR(
"core.protocols.match.downstream");
109 TR << s_in << std::endl;
111 std::string const keywordSCORING (
"SCORING_SECMATCH::");
112 std::string const keywordFilename (
"weights_file:");
115 std::string const keywordTotal_score (
"total_score");
118 it_line != end_line; ++it_line ) {
121 if ((*it_line).find(keywordSCORING) != std::string::npos){
128 if ((*it).find(keywordFilename) != std::string::npos){
131 sfxn_->add_weights_from_file(*it);
134 }
else if ((*it).find(keywordWeight)!= std::string::npos){
144 sfxn_->set_weight( sType, weight );
150 }
else if ((*it).find(keywordCutOff)!= std::string::npos){
155 if ((*it).find(keywordTotal_score) != std::string::npos){
161 TR <<
"TotalScore is the sum of context independent two bodies and context dependent two bodies" << std::endl;
170 std::string errorStr =
"This constraint, " + *it +
", is not a two bodies scoretype.";
171 utility_exit_with_message (errorStr);
176 core::Real sc_cutoff ( std::atof((*it).c_str()) );
185 if (it ==
end)
break;
197 bool noCutOff =
true;
200 sco_it != secmatch_scotypes_temp.end(); ++sco_it ){
203 if (*sco_it == *cut_it){
208 TR <<
"ERROR: There is no specific weight for the following scoretype " << *cut_it << std::endl;
225 using namespace core::scoring::methods;
230 energy_method_options->set_method_weights( sType , wtsV );
234 bool twobodiesterm =
false;
237 switch ( method->method_type() ) {
239 twobodiesterm =
true;
241 TR <<
"ci_2b:" << sType <<
" weight:" << wts << std::endl;
245 twobodiesterm =
true;
247 TR <<
"cd_2b:" << sType <<
" weight:" << wts << std::endl;
251 twobodiesterm =
false;
252 TR <<
"ci_1b:" << sType <<
" weight:" << wts << std::endl;
256 twobodiesterm =
false;
257 TR <<
"cd_1b:" << sType <<
" weight:" << wts << std::endl;
261 twobodiesterm =
true;
263 TR <<
"ci_lr_2b:" << sType <<
" weight:" << wts << std::endl;
267 twobodiesterm =
true;
269 TR <<
"cd_lr_2b:" << sType <<
" weight:" << wts << std::endl;
273 twobodiesterm =
false;
274 TR <<
"ws:" << sType <<
" weight:" << wts << std::endl;
278 utility_exit_with_message(
"unrecognized scoreType:"
283 return twobodiesterm;
292 bool returnVal =
false;
308 std::stringstream out;
309 out << numeric::random::random_range(0,INT_MAX);
312 #ifndef WIN_PYROSETTA
318 utility::io::ozstream outstream;
320 outstream.open( timeStr, std::ios::app );
334 if( !returnVal )
return false;
349 TR <<
"CAUTION: There is no long range implementation" << std::endl;
350 utility_exit_with_message(
"CAUTION: There is no long range implementation");
376 TR <<
"Caution::The context dependent two bodies energy term is computational expensive and it will slow down matcher." << std::endl;
385 value = emap.
dot(
sfxn_->weights() );
386 TR <<
"Calculated TotalScore:" << value << std::endl;
432 core::Real checkCutoff = emap[ *sco_it ] *
sfxn_->weights()[ *sco_it ];
433 TR <<
"sco_it:" << *sco_it <<
" checkCutoff:" << checkCutoff << std::endl;
434 if (checkCutoff > *real_it)
return false ;