IMP  2.0.0
The Integrative Modeling Platform
SolventAccessibleSurface.h
Go to the documentation of this file.
1 /**
2  * \file IMP/saxs/SolventAccessibleSurface.h \brief
3  *
4  * Copyright 2007-2013 IMP Inventors. All rights reserved.
5  *
6  */
7 
8 #ifndef IMPSAXS_SOLVENT_ACCESSIBLE_SURFACE_H
9 #define IMPSAXS_SOLVENT_ACCESSIBLE_SURFACE_H
10 
11 #include <IMP/saxs/saxs_config.h>
12 #include <IMP/core/XYZR.h>
13 
14 IMPSAXS_BEGIN_NAMESPACE
15 
16 /**
17  Class for estimation of accessible surface area. The probe (sampled
18  with dots) is rolled over the atoms. The area is estimated by the
19  number of dots that do not collide with atoms. Note, this is a rough
20  estimate of the area (enough for SAXS).
21 */
22 class IMPSAXSEXPORT SolventAccessibleSurface {
23 public:
24  //! estimate surface accessability of each atom.
25  /**
26  \param[in] points A set of points for which surface accessability is
27  computed. Each point should have an XYZ coordinate and a radius.
28  \param[in] probe_radius Radius of the probe to roll over points.
29  \param[in] density Sampling density per A^2 for area estimation
30  \return a value between 0 to 1, for surface accessability,
31  where 0 means buried and 1 means fully accessible to the water
32  */
33  IMP::Floats get_solvent_accessibility(const core::XYZRs& points,
34  float probe_radius = 1.8,
35  float density = 5.0);
36  private:
37  bool is_intersecting(const algebra::Vector3D& sphere_center1,
38  const algebra::Vector3D& sphere_center2,
39  const float radius1, const float radius2) {
40  float squared_radius_sum = (radius1+radius2)*(radius1+radius2);
41  float squared_dist =
42  algebra::get_squared_distance(sphere_center1, sphere_center2);
43  if(fabs(squared_radius_sum - squared_dist) < 0.0001)
44  return false;
45  if(squared_radius_sum > squared_dist)
46  return true;
47  return false;
48  }
49 
50  algebra::Vector3Ds create_sphere_dots(float radius, float density);
51 
52 };
53 
54 IMPSAXS_END_NAMESPACE
55 
56 #endif /* IMPSAXS_SOLVENT_ACCESSIBLE_SURFACE_H */