28 #include <basic/database/open.hh>
29 #include <basic/Tracer.hh>
30 #include <utility/io/izstream.hh>
31 #include <utility/string_util.hh>
35 #include <utility/tag/Tag.hh>
37 #include <utility/vector0.hh>
38 #include <utility/vector1.hh>
39 #include <boost/lexical_cast.hpp>
42 static basic::Tracer
TR(
"protocols.fldsgn.filters.ParallelBetaPairingPreferenceFilter");
50 Filter(
"ParallelBetaPairingPreference" ),
54 using namespace core::chemical;
56 utility::io::izstream stream;
57 basic::database::open( stream,
"parallel_beta_pairing_preference" );
62 while( getline( stream, line ) ){
64 runtime_assert( tokens.size() == 21 );
67 for(
Size ii=1; ii<=20; ii++ ) {
72 value = boost::lexical_cast<
Real>( tokens[ ii+1 ] );
111 out <<
"ParallelBetaPairingPreference: " <<
compute( pose ) <<
"\n";
149 float dssp_hbond_threshold = -0.5;
152 SS_Info2_OP ssinfo =
new SS_Info2( pose, dssp.get_dssp_secstruct() );
157 for( StrandPairings::const_iterator it=spairset.begin(), ite=spairset.end(); it != ite; ++it ) {
158 StrandPairing spair( **it );
160 if( spair.orient() ==
'A' )
continue;
162 for(
Size ires=spair.begin1(); ires<=spair.end1(); ires++ ) {
164 Size jres( spair.residue_pair( ires ) );
165 float score1 = dssp.bb_pair_score( ires, jres );
168 score2 = dssp.bb_pair_score( ires, jres+1 );
171 bool ires_HB(
false );
172 if( score1 >= dssp_hbond_threshold && score2 < dssp_hbond_threshold ) {
174 }
else if( score1 >= dssp_hbond_threshold && score2 >= dssp_hbond_threshold ) {
177 TR <<
"WARNING: " << ires <<
", " << jres <<
" is making strange hbond. " << std::endl;
192 TR << ires <<
" " << jres <<
" "
195 << ptn <<
" " << score2 <<
" " << sc << std::endl;
204 return score/
Real( num_pair );
221 verbose_ = tag->getOption<
bool>(
"verbose", 0 );