31 #include <basic/Tracer.hh>
33 #include <utility/vector1.hh>
37 namespace frag_picker {
41 "protocols.frag_picker.scores.PartialSecondarySimilarity");
52 for (
Size j = 1; j <= chunk->size(); ++j) {
53 char s(chunk->at(j)->ss());
54 if (s ==
'H') chunk_ss_id[j] = 1;
55 if (s ==
'E') chunk_ss_id[j] = 2;
56 if (s ==
'L') chunk_ss_id[j] = 3;
60 for (
Size j = 1; j <= chunk->size(); ++j) {
65 <<
"x" << chunk->size() << std::endl;
71 values.resize(f->get_length());
73 for (
Size i = 1; i <= f->get_length(); i++) {
77 char s(chunk->at(f->get_first_index_in_vall() + i - 1)->ss());
79 values[i] =
raw_probs_[f->get_first_index_in_query() + i - 1][1];
82 values[i] =
raw_probs_[f->get_first_index_in_query() + i - 1][2];
85 values[i] =
raw_probs_[f->get_first_index_in_query() + i - 1][3];
90 std::sort( values.begin(), values.end() );
91 Real totalScore = 0.0;
93 for (
Size i = 1; i <= f->get_length(); i++) {
95 Real sigmoid_weight( 1 / ( 1 + exp( (10*( (
Real) i ) / f->get_length()) - 7 ) ) );
97 totalScore += sigmoid_weight*values[i];
100 totalScore /= (
Real) f->get_length();
111 empty_map->set_score_component(totalScore,
id_);
142 Size sequence_length,
Size longest_vall_chunk) :
144 "PartialSecondarySimilarity") , prediction_name_(prediction_name) {
154 Real highest_ss_pred(query_prediction->helix_fraction(i));
156 if (highest_ss_pred < query_prediction->strand_fraction(i)) {
157 highest_ss_pred = query_prediction->strand_fraction(i);
159 if (highest_ss_pred < query_prediction->loop_fraction(i)) {
160 highest_ss_pred = query_prediction->loop_fraction(i);
163 norm_query_H_[i] = query_prediction->helix_fraction(i) / highest_ss_pred;
164 norm_query_E_[i] = query_prediction->strand_fraction(i) / highest_ss_pred;
165 norm_query_L_[i] = query_prediction->loop_fraction(i) / highest_ss_pred;