21 #include <basic/Tracer.hh>
24 #include <numeric/xyzVector.hh>
25 #include <numeric/conversions.hh>
27 #include <utility/vector1.hh>
30 static basic::Tracer
TR(
"protocols.fldsgn.potentials.sspot.NatbiasHelicesSheetPotential", basic::t_info );
34 namespace potentials {
65 hss3set_( src.hss3set_ ),
66 hpairset_( src.hpairset_ ),
67 hs_dist_wts_( src.hs_dist_wts_ ),
68 hs_dist_( src.hs_dist_ ),
69 hs_dist_sigma2_( src.hs_dist_sigma2_ ),
70 hsheet_dist_repulsive_( src.hsheet_dist_repulsive_ ),
71 hs_angle_wts_( src.hs_angle_wts_ ),
72 hs_angle_( src.hs_angle_ ),
73 hs_angle_sigma2_( src.hs_angle_sigma2_ ),
74 hh_align_angle_wts_( src.hh_align_angle_wts_ ),
75 hh_align_angle_( src.hh_align_angle_ ),
76 hh_align_angle_sigma2_( src.hh_align_angle_sigma2_ )
120 Real const hs_dist_wts,
122 Real const hs_dist_sigma2 )
139 Real const hs_angle_wts,
141 Real const hs_angle_sigma2 )
151 Real const hh_align_angle_wts,
152 Real const hh_align_angle,
153 Real const hh_align_angle_sigma2 )
165 TR <<
"Distance pot of helix & strands: wts, atr_dist, sigma2 : "
170 TR <<
"Angle pot of helix & strands: wts, angle, sigma2 : "
173 TR <<
"Angle pot of helix-helix projected onto sheet: wts, angle, sigma2 : "
192 Real judge_hs_close = -0.5;
195 Helices const & helices( ss_info->helices() );
196 Strands const & strands( ss_info->strands() );
213 runtime_assert( helices.size() >= hssop->helix() );
214 runtime_assert( strands.size() >= hssop->strand1() );
215 runtime_assert( strands.size() >= hssop->strand2() );
217 hssop->calc_geometry( ss_info );
219 Real hsheet_dist = hssop->hsheet_dist();
220 Real hs1_dist = hssop->hs1_dist();
221 Real hs2_dist = hssop->hs2_dist();
227 TR.Debug <<
"hseet_dist=" << hsheet_dist << std::endl;
231 Real dist_score1( 0.0 ), dist_score2( 0.0 ), angle_score( 0.0 );
238 dist_score1 = -exp( -r );
246 dist_score2 = -exp( -r );
249 TR.Debug <<
"HS_dist_score: "
250 << hssop->helix() <<
"-" << hssop->strand1() <<
"," << hssop->strand2() <<
" "
251 << hsheet_dist <<
" " << hs1_dist <<
" " << hs2_dist <<
" "
252 << dist_score1 <<
" " << dist_score2 << std::endl;
255 if( dist_score1 <= judge_hs_close && dist_score2 <= judge_hs_close ) {
257 is_hs_close[ hssop->helix() ] =
true;
259 Real hs_angle = hssop->hs_angle();
266 angle_score = -exp( -r );
269 TR.Debug <<
"HS_angle_score: "
270 << hssop->helix() <<
"-" << hssop->strand1() <<
"," << hssop->strand2() <<
" "
271 << hs_angle <<
" " << angle_score <<
" " << std::endl;
291 for( HelixPairings::const_iterator it=hpairs.begin(), ite=hpairs.end(); it != ite; ++it ) {
296 HelixPairing
const & hpair( **it );
298 runtime_assert( helices.size() >= hpair.h1() && helices.size() >= hpair.h2() );
301 if( !is_hs_close[ hpair.h1() ] || !is_hs_close[ hpair.h2() ] )
continue;
303 Helix
const &
h1 = *helices[ hpair.h1() ];
304 Helix
const &
h2 = *helices[ hpair.h2() ];
310 runtime_assert( hssop1 && hssop2 );
315 Size const s1 = hssop1->strand1();
316 Size const s2 = hssop2->strand2();
318 Real ag = numeric::conversions::degrees( angle_of( strands[ s1 ]->orient(), strands[ s2 ]->orient() ) );
319 if( ag > 90.0 ) flip = -1.0;
320 Vector const v1 = strands[ s2 ]->mid_pos() - strands[ s1 ]->mid_pos();
321 Vector const v2 = strands[ s1 ]->orient() + flip*strands[ s2 ]->orient();
322 Vector const v3 = h1.orient().project_parallel( v1 ) + h1.orient().project_parallel( v2 );
323 Vector const v4 = h2.orient().project_parallel( v1 ) + h2.orient().project_parallel( v2 );
325 if( hpair.orient() ==
'A' ) flip = -1.0;
326 Real angle = numeric::conversions::degrees( angle_of( v3, flip*v4 ) );
338 TR.Debug <<
"HH_align_score : " << hpair.h1() <<
"-" << hpair.h2() <<
" " << angle <<
" " << score << std::endl;