27 #include <basic/Tracer.hh>
28 #include <basic/database/open.hh>
31 #include <utility/io/izstream.hh>
37 #include <ObjexxFCL/format.hh>
39 #include <utility/vector1.hh>
40 #include <ObjexxFCL/FArray3D.hh>
48 static basic::Tracer
TR(
"protocols.fldsgn.potentials.sspot.HSPairPotential", basic::t_info );
52 namespace potentials {
58 phithetascore_( 2, 3, 36, 36 )
72 if ( strand_seqsep >= 2 && strand_seqsep <= 10 ) {
75 if ( strand_seqsep > 10 ) {
81 Size iphi =
static_cast< Size >( 1 + ( phi + 180.0 )/10 );
84 }
else if ( iphi < 1 ) {
87 Size itheta =
static_cast< Size >( 1 + ( theta/5 ) );
90 }
else if ( itheta < 1 ) {
93 return phithetascore_( 1,
int( istrand_seqsep ),
int( iphi ),
int( itheta ) );
107 static Real const eleven_inv = 1.0 / 11.0;
108 Size const s1 = pos1;
109 Size const s2 = pos1+1;
110 Size const s3 = pos1+2;
111 Size const s4 = pos1+3;
113 Vector const Epos_sum( ( bb_pos.
CA( s1 ) + bb_pos.
C( s1 ) ) +
114 ( bb_pos.
N( s2 ) + bb_pos.
CA( s2 ) + bb_pos.
C( s2 ) ) +
115 ( bb_pos.
N( s3 ) + bb_pos.
CA( s3 ) + bb_pos.
C( s3 ) ) +
116 ( bb_pos.
N( s4 ) + bb_pos.
CA( s4 ) ) );
118 p1 = ( Epos_sum + bb_pos.
N( s1 ) ) * eleven_inv;
119 p2 = ( Epos_sum + bb_pos.
C( s4 ) ) * eleven_inv;
146 for(
Size ihelix=1; ihelix<=helices.size(); ihelix++ ) {
148 HelixOP const helix( helices[ ihelix ] );
150 if( helix->length() <= 3 )
continue;
152 for(
Size ss1=helix->begin(); ss1<=helix->end()-3; ss1++ ) {
158 iru = energy_graph.get_node( ss1+1 )->const_edge_list_begin(),
160 iru != irue; ++iru ) {
162 Size ss2( (*iru)->get_second_node_ind() );
164 if ( ss1+1 == ss2 ) ss2 = (*iru)->get_first_node_ind();
167 if( jstrand == 0 || ss_info.
strand_id( ss2+1 ) == 0 )
continue;
170 Vector const & pt3( bb_pos.N( ss2 ) );
171 Vector const & pt4( bb_pos.C( ss2+1 ) );
178 Vector mid_vector = cen2 -cen1;
182 spherical( pt2, pt4, phi, theta, cen1, cen2, mid_vector );
184 Size const helix_end_1 = helix->begin() - 1;
185 Size const helix_end_2 = helix->end() + 1;
187 Size const strand_end_1 = strands[ jstrand ]->begin() - 1;
188 Size const strand_end_2 = strands[ jstrand ]->end() + 1;
208 using ObjexxFCL::fmt::skip;
209 typedef ObjexxFCL::FArray3D< Real > FArray3D_real;
210 FArray3D_real pts_HS( 36, 36, 3 );
213 for (
int itheta = 1; itheta <= 36; ++itheta ) {
217 utility::io::izstream HS_stream;
218 basic::database::open( HS_stream, hs_filename );
219 for (
int isep = 1; isep <= 3; ++isep ) {
220 for (
int itheta = 1; itheta <= 36; ++itheta ) {
221 for (
int iph = 1; iph <= 36; ++iph ) {
222 HS_stream >> pts_HS( itheta, iph, isep ) >> skip;
229 for (
int isep = 1; isep <= 3; ++isep ) {
232 for (
int iph = 1; iph <= 36; ++iph ) {
233 for (
int itheta = 1; itheta <= 36; ++itheta ) {
235 pts_HS( itheta, iph, isep ) += iptsn( itheta )*0.000001f;
236 tot += pts_HS( itheta, iph, isep );
237 totn += iptsn( itheta );
240 for (
int iph = 1; iph <= 36; ++iph ) {
241 for (
int itheta = 1; itheta <= 36; ++itheta ) {
242 phithetascore_( 1, isep, iph, itheta ) = -std::log(pts_HS( itheta, iph, isep )/tot ) +
243 std::log(iptsn( itheta )/totn );