16 #ifndef INCLUDED_core_scoring_packstat_compute_sasa_hh
17 #define INCLUDED_core_scoring_packstat_compute_sasa_hh
27 #include <utility/pointer/owning_ptr.hh>
28 #include <utility/pointer/ReferenceCount.hh>
30 #include <numeric/constants.hh>
31 #include <numeric/trig.functions.hh>
34 #include <ObjexxFCL/ubyte.hh>
36 #include <ObjexxFCL/FArray2D.hh>
37 #include <ObjexxFCL/Fmath.hh>
42 #include <utility/vector1.hh>
56 extern int const nphi;
58 extern int const nolp;
59 extern int const nori;
62 extern ObjexxFCL::FArray2D_int
angles;
63 extern ObjexxFCL::FArray2D_ubyte
masks;
95 if ( dist < epsilon ) {
103 }
else if ( rb+dist <= ra ) {
107 }
else if ( rb+dist <= ra ) {
117 costh = (ra*ra+dist*dist-rb*rb)/(2*ra*dist);
118 olp =
static_cast< int >((1.0f-costh)*50)+1;
121 }
else if ( olp < 0 ) {
137 utility::exit( EXIT_FAILURE, __FILE__, __LINE__);
156 using namespace numeric::constants::d;
157 using numeric::sin_cos_range;
162 XYZ diff( ( a - b ) / dist );
180 aphi =
static_cast< int >( p );
182 if ( aphi >
nphi ) aphi = 1;
187 theta =
static_cast< int >(
t );
191 }
else if ( theta >
ntheta ) {
248 int include_water = -1
253 SasaOptions
const & opts
259 SasaOptions
const & opts
266 SasaOptions
const & opts
272 SasaOptions
const & opts
285 SasaOptions
const & opts
294 SasaOptions
const & opts
371 using namespace core;
372 using namespace numeric;
373 using namespace utility;
378 int olp, aphi, theta, point, masknum;
380 Size const Nspheres( S.size() );
381 ObjexxFCL::FArray2D_ubyte atom_sasa_masks(
old::nbytes, Nspheres, NULL );
383 for(
size_t i = 1; i <= Nspheres; ++i ) {
384 for(
size_t j = 1; j < i; ++j ) {
386 PackstatReal const dth = S[i].radius+S[j].radius+2*probe;
387 if ( dist_sq > dth*dth )
continue;
388 if ( dist_sq <= 0.0 )
continue;
395 point =
angles(aphi,theta);
396 masknum = point*100+olp;
397 for (
int bb = 1, l = atom_sasa_masks.index(bb,i); bb <=
nbytes; ++bb, ++l ) {
398 atom_sasa_masks[ l ] = ObjexxFCL::bit::bit_or( atom_sasa_masks[ l ],
masks(bb,masknum) );
403 point =
angles(aphi,theta);
404 masknum = point*100+olp;
405 for (
int bb = 1, l = atom_sasa_masks.index(bb,j); bb <=
nbytes; ++bb, ++l ) {
406 atom_sasa_masks[ l ] = ObjexxFCL::bit::bit_or( atom_sasa_masks[ l ],
masks(bb,masknum) );
414 for(
size_t is = 1; is <= Nspheres; ++is ) {
417 for (
size_t bb = 1, l = atom_sasa_masks.index(bb,is); (
int)bb <=
nbytes; ++bb, ++l ) {
421 if(
csa ) total_sa = 4.0 * numeric::constants::d::pi * ( irad * irad );
422 else total_sa = 4.0 * numeric::constants::d::pi * ( (irad+probe) * (irad+probe) );
423 expose = ( 1.0f - fraction ) * total_sa;
440 #endif // INCLUDED_core_scoring_packstat_compute_sasa_HH