30 #include <basic/Tracer.hh>
34 #include <basic/options/option.hh>
36 #include <basic/options/keys/OptionKeys.hh>
37 #include <basic/options/keys/frags.OptionKeys.gen.hh>
42 #include <utility/vector1.hh>
46 namespace frag_picker {
49 using namespace basic::options;
50 using namespace basic::options::OptionKeys;
53 "protocols.frag_picker.scores.ProfileScore");
60 if (tmp.compare(cached_scores_id_) == 0)
62 cached_scores_id_ = tmp;
63 Size size_q = query_profile_->length();
65 assert( chunk_profile->length() !=0 );
66 trProfScore.Debug <<
"caching profile score for " << chunk->get_pdb_id()
67 <<
" of size " << chunk->size() << std::endl;
68 assert( chunk->size() == chunk_profile->length() );
69 for (
Size i = 1; i <= size_q; ++i) {
70 for (
Size j = 1; j <= chunk->size(); ++j) {
71 scores_[i][j] = profile_scoring_->score(query_profile_,
76 trProfScore.Debug <<
"precomputed matrix of scores " << scores_.size()
77 <<
"x" << chunk->size() << std::endl;
88 for (
Size i = 1; i <= f->get_length(); i++) {
89 assert(f->get_first_index_in_query() + i - 1 <= scores_.size());
90 assert(f->get_first_index_in_vall()
91 + i - 1<= scores_[1].size());
93 += scores_[f->get_first_index_in_query() + i - 1][f->get_first_index_in_vall()
96 totalScore /= (
Real) f->get_length();
97 empty_map->set_score_component(totalScore, id_);
98 if ((totalScore > lowest_acceptable_value_) && (use_lowest_ ==
true))
108 f->get_chunk()->get_profile();
109 Size firstQ = f->get_first_index_in_query();
110 Size firstV = f->get_first_index_in_vall();
112 out <<
"\nvall: " << f->get_chunk()->get_pdb_id() <<
" " << I(5,
113 f->get_first_index_in_vall()) <<
" " << out <<
"\nquery " << I(5,
114 f->get_first_index_in_query()) <<
"\n";
116 for (
Size i = 1; i <= f->get_length(); ++i) {
117 out <<
"V row: " << F(5, 3, chunk_profile->prof_row(firstV + i - 1)[1]);
118 for (
Size j = 2; j <= 20; ++j) {
119 out <<
" " << F(5, 3, chunk_profile->prof_row(firstV + i - 1)[j]);
123 << F(5, 3, query_profile_->prof_row(firstQ + i - 1)[1]);
124 for (
Size j = 2; j <= 20; ++j) {
125 out <<
" " << F(5, 3, query_profile_->prof_row(firstQ + i - 1)[j]);
128 out <<
"Position score: " << scores_[firstQ + i - 1][firstV + i - 1]
131 += scores_[f->get_first_index_in_query() + i - 1][f->get_first_index_in_vall()
134 if ((totalScore > lowest_acceptable_value_) && (use_lowest_ ==
true))
135 out <<
"Total score " << F(5, 3, totalScore) <<
" ACCEPTED"
138 out <<
"Total score " << F(5, 3, totalScore) <<
" REJECTED"
140 totalScore /= (
Real) f->get_length();
141 empty_map->set_score_component(totalScore, id_);
142 if ((totalScore > lowest_acceptable_value_) && (use_lowest_ ==
true))
150 if (option[frags::scoring::profile_score].user()) {
151 Size len = picker->get_vall()->get_largest_chunk_size();
154 option[frags::scoring::profile_score]()));
156 << option[frags::scoring::profile_score]() << std::endl;
158 lowest_acceptable_value, use_lowest, picker->get_query_seq(), ss, len);
160 utility_exit_with_message(
161 "[ERROR] Undefined profile scoring method. Provide it with frags::scoring::profile_score flag");