65 #include <basic/Tracer.hh>
67 #include <utility/io/izstream.hh>
75 #include <utility/vector1.hh>
77 static basic::Tracer
tr(
"protocols.frag_picker.FragmentScoreManager");
80 namespace frag_picker {
96 return elem1->get_priority() > elem2->get_priority();
103 std::map<FragmentScoringMethodOP, Real> weights;
104 scores_.push_back(scoring_term);
108 std::pair<FragmentScoringMethodOP, Real> p(
scores_[i],
119 width_.insert(std::pair<FragmentScoringMethodOP, Size>(scoring_term,
121 precision_.insert(std::pair<FragmentScoringMethodOP, Size>(scoring_term,
127 if (!f->was_modified())
128 return f->get_most_recent_total_score();
136 f->recent_total_ = total;
137 f->was_modified_ =
false;
144 for (
Size iScore = 1; iScore <=
scores_.size(); ++iScore) {
149 score->do_caching(chunk);
155 for (
Size iScore = 1; iScore <=
scores_.size(); ++iScore) {
166 <<
"Fragment scoring scheme used:\n-----------------------------------------\n";
167 out <<
"id fragment score method name weight\n";
169 out << std::setw(3) <<
scores_[i]->get_id() <<
" " << std::setw(30)
170 <<
scores_[i]->get_score_name() << std::setw(5)
172 out <<
"-----------------------------------------\n" << std::endl;
179 using namespace ObjexxFCL::fmt;
180 if ( pairs.size() == 0 )
return;
181 bool if_quota =
false;
182 if( pairs[1].second->get_quota_score() < 999.98 ) if_quota =
true;
183 out <<
"#" << RJ(10,
"query_pos ");
184 out << RJ(10,
"vall_pos ");
185 out << RJ(6,
"pdbid");
190 out <<
" " <<
scores_[i]->get_score_name();
191 if (
scores_[i]->get_score_name().length() > w[i])
192 w[i] =
scores_[i]->get_score_name().length();
198 out <<
" QUOTA_TOT TOTAL POOL_NAME FRAG_ID"<<std::endl;
201 out <<
" TOTAL FRAG_ID"<<std::endl;
203 for (
Size iF = 1; iF <= pairs.size(); ++iF) {
204 if ( !pairs[iF].first || !pairs[iF].second ) {
205 tr.Warning <<
"final_frag candidate " << iF <<
" is corrupted. skipping... " << std::endl;
211 out <<
" " << I(10, fr->get_first_index_in_query());
213 out <<
" " << I(10, r->resi());
214 out <<
" " << RJ(5, fr->get_pdb_id());
215 out <<
" " << fr->get_chain_id();
216 out <<
" " << fr->get_middle_ss();
220 out <<
" " << F(w[i], p, sc->get_score_components()[i]);
225 out <<
" " << std::setw(w[
scores_.size()+3])<<fr->get_pool_name();
229 assert ( fr->key() > 0 );
230 assert ( fr->key() < 4000000 );
232 out << I(10, fr->key() ) << std::endl;
240 for (
Size iScore = 1; iScore <=
scores_.size(); iScore++) {
243 if (!
scores_[iScore]->score(candidate, empty_map))
253 for (
Size iScore = 1; iScore <=
scores_.size(); iScore++ ) {
255 scores_[iScore]->score(candidate, empty_map);
265 for (
Size iScore = 1; iScore <=
scores_.size(); iScore++ ) {
271 if ( !s->cached_score(candidate, empty_map) )
274 if ( !
scores_[iScore]->score(candidate, empty_map) )
284 = scoring_term_maker;
342 std::map<std::string, MakeFragmentScoringMethodOP>::iterator m =
345 utility_exit_with_message(
"[ERROR]: unknown score type " + score_name
349 add_scoring_method(m->second->make(priority, lowest, use_lowest, picker, config_line),
356 utility::io::izstream input(file_name.c_str());
358 utility_exit_with_message(
"[ERROR]: can't open file " + file_name +
"!");
370 while (getline(input, line)) {
374 std::istringstream line_stream(line);
375 line_stream >> score_name >> priority >> weight >> low_string;
377 if (low_string ==
"-") {
381 std::istringstream low_stream(low_string);
383 low_stream >> lowest;
388 if (line_stream.good()) {
389 line_stream >> remark;