22 #include <basic/options/option.hh>
23 #include <basic/options/keys/in.OptionKeys.gen.hh>
25 #include <basic/Tracer.hh>
27 #include <utility/vector1.hh>
28 #include <utility/io/izstream.hh>
31 namespace frag_picker {
34 static basic::Tracer
tr(
35 "protocols.frag_picker.scores.TorsionBinSimilarity"
45 tr.Debug <<
"caching score for " << chunk->get_pdb_id()
46 <<
" of size " << chunk->size() << std::endl;
49 for (
Size j = 1; j <= chunk->size(); ++j) {
50 Real const phi ( chunk->at(j)->phi() );
51 Real const psi ( chunk->at(j)->psi() );
52 Real const omega( chunk->at(j)->omega() );
59 tr.Debug <<
"precomputed matrix of scores " <<
scores_.size()
60 <<
"x" << chunk->size() << std::endl;
74 for (
Size i = 1; i <= f->get_length(); ++i) {
75 assert( f->get_first_index_in_query() + i - 1 <=
scores_.size() );
76 assert( f->get_first_index_in_vall() + i - 1 <=
scores_[1].size() );
77 total_score +=
scores_[f->get_first_index_in_query() + i - 1][f->get_first_index_in_vall() + i - 1];
81 total_score /= (
Real) f->get_length();
83 empty_map->set_score_component(total_score,
id_);
95 if ( std::abs( omega ) < 90 ) {
97 }
else if ( phi >= 0.0 ) {
98 if ( -100 < psi && psi <= 100 ) {
104 if ( -125 < psi && psi <= 50 ) {
115 case 'A':
return 1;
break;
116 case 'B':
return 2;
break;
117 case 'E':
return 3;
break;
118 case 'G':
return 4;
break;
119 case 'O':
return 5;
break;
121 std::string const msg(
"Error: don't recognize bin" + bin_name );
122 utility_exit_with_message(msg);
131 Real lowest_acceptable_value,
139 using utility::io::izstream;
140 using namespace basic::options;
141 using namespace basic::options::OptionKeys;
144 if ( !option[ in::file::torsion_bin_probs ].user() ) {
145 utility_exit_with_message(
"Error: no file specified");
147 reader.read( izstream( option[ in::file::torsion_bin_probs ]() ) );
148 if ( reader.nrows() == 0 ) {
149 utility_exit_with_message(
"Error: didn't read any torsions!" );
151 Size const sequence_length( reader.nrows() );
152 Size const vall_max_len( picker->get_vall()->get_largest_chunk_size() );
159 lowest_acceptable_value,