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.LAMBEGO_Similarity"
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() );
53 char const ss ( chunk->at(j)->ss() );
60 tr.Debug <<
"precomputed matrix of scores " <<
scores_.size()
61 <<
"x" << chunk->size() << std::endl;
75 for (
Size i = 1; i <= f->get_length(); ++i) {
76 assert( f->get_first_index_in_query() + i - 1 <=
scores_.size() );
77 assert( f->get_first_index_in_vall() + i - 1 <=
scores_[1].size() );
78 total_score +=
scores_[f->get_first_index_in_query() + i - 1][f->get_first_index_in_vall() + i - 1];
82 total_score /= (
Real) f->get_length();
84 empty_map->set_score_component(total_score,
id_);
98 bool const loop( ss ==
'L' );
100 if ( std::abs( omega ) < 90 ) {
102 }
else if ( phi >= 0.0 ) {
103 if ( -100 < psi && psi <= 100 ) {
109 if ( -125 < psi && psi <= 50 ) {
110 if ( loop )
return 'L';
113 if ( loop )
return 'M';
122 case 'L':
return 1;
break;
123 case 'A':
return 1;
break;
124 case 'M':
return 2;
break;
125 case 'B':
return 2;
break;
126 case 'E':
return 3;
break;
127 case 'G':
return 4;
break;
128 case 'O':
return 5;
break;
130 std::string const msg(
"Error: don't recognize bin" + bin_name );
131 utility_exit_with_message(msg);
140 Real lowest_acceptable_value,
148 using utility::io::izstream;
149 using namespace basic::options;
150 using namespace basic::options::OptionKeys;
153 if ( !option[ in::file::torsion_bin_probs ].user() ) {
154 utility_exit_with_message(
"Error: no file specified");
156 reader.read( izstream( option[ in::file::torsion_bin_probs ]() ) );
157 if ( reader.nrows() == 0 ) {
158 utility_exit_with_message(
"Error: didn't read any torsions!" );
160 Size const sequence_length( reader.nrows() );
161 Size const vall_max_len( picker->get_vall()->get_largest_chunk_size() );
168 lowest_acceptable_value,