31 #include <basic/options/option.hh>
32 #include <basic/options/keys/OptionKeys.hh>
33 #include <basic/options/keys/frags.OptionKeys.gen.hh>
36 #include <basic/Tracer.hh>
38 #include <utility/vector1.hh>
42 namespace frag_picker {
45 using namespace basic::options;
46 using namespace basic::options::OptionKeys;
49 "protocols.frag_picker.scores.TalosSSSimilarity");
54 values.resize(f->get_length());
56 Real totalScore = 0.0;
57 for (
Size i = 1; i <= f->get_length(); i++) {
62 char s(chunk->at(f->get_first_index_in_vall() + i - 1)->ss());
64 if (s ==
'H') ss_id = 1;
65 if (s ==
'E') ss_id = 2;
66 if (s ==
'L') ss_id = 3;
68 values[i] = raw_probs_[f->get_first_index_in_query()+i-1][ss_id];
74 std::sort( values.begin(), values.end() );
76 for (
Size i = 1; i <= f->get_length(); i++) {
78 Real sigmoid_weight( 1 / ( 1 + exp( (10*( (
Real) i ) / f->get_length()) - 7 ) ) );
79 totalScore += sigmoid_weight*values[i];
83 totalScore /= (
Real) f->get_length();
84 empty_map->set_score_component(totalScore, id_);
85 if ((totalScore > lowest_acceptable_value_) && (use_lowest_ ==
true))
94 if (tmp.compare(cached_scores_id_) == 0)
96 cached_scores_id_ = tmp;
98 do_caching_simple(chunk);
99 for(
Size fl=1;fl<=cache_.size();fl++) {
100 if(cache_[fl].
size() != 0) {
102 <<
" of size " << chunk->size() <<
" for fragment size "<<fl<<std::endl;
112 for (
Size j = 1; j <= chunk->size(); ++j) {
113 char s(chunk->at(j)->ss());
114 if (s ==
'H') chunk_ss_id[j] = 1;
115 if (s ==
'E') chunk_ss_id[j] = 2;
116 if (s ==
'L') chunk_ss_id[j] = 3;
119 for (
Size i = 1; i <= query_len_; ++i) {
120 for (
Size j = 1; j <= chunk->size(); ++j) {
121 scores_[i][j] = raw_probs_[i][chunk_ss_id[j]];
125 <<
"x" << chunk->size() << std::endl;
141 Real totalScore = cache_[f->get_length()][f->get_first_index_in_query()][f->get_first_index_in_vall()];
143 totalScore /= (
Real) f->get_length();
145 empty_map->set_score_component(totalScore, id_);
146 if ((totalScore > lowest_acceptable_value_) && (use_lowest_ ==
true))
155 "TalosSSSimilarity") , prediction_name_(prediction_name) {
159 H_mult_ = option[frags::seqsim_H]();
160 E_mult_ = option[frags::seqsim_E]();
161 L_mult_ = option[frags::seqsim_L]();
175 if ( i<=query_prediction->total_residue() ) {
176 hf = query_prediction->helix_fraction(i);
177 sf = query_prediction->strand_fraction(i);
178 lf = query_prediction->loop_fraction(i);
179 confidence = query_prediction->confidence(i);
181 hf = sf = lf = 1.0/3.0;
185 Real average( (hf+sf+lf)/ 3.0 );
186 Real sdev( sqrt( (pow(hf-average,2) + pow(sf-average,2) + pow(lf-average,2))/3.0 ) );
202 if ( ( sdev <= 0.1 ) || (confidence <= 0.1) ) {
211 prow[1] = (-2*( 1 / ( 1 + exp(-7*hf + 5) ) ))*sqrt(confidence);
212 prow[2] = (-2*( 1 / ( 1 + exp(-7*sf + 5) ) ))*sqrt(confidence);
213 prow[3] = (-2*( 1 / ( 1 + exp(-7*lf + 5) ) ))*sqrt(confidence);