Rosetta
Public Member Functions | Private Member Functions | Private Attributes | List of all members
core::scoring::sasa::LeGrandSasa Class Reference

LeGrand SASA approximation method Used by SasaCalc but can be used by itself. Virt atms are skipped as radii=0. More...

#include <LeGrandSasa.hh>

Inheritance diagram for core::scoring::sasa::LeGrandSasa:
Inheritance graph
[legend]

Public Member Functions

 LeGrandSasa (Real probe_radius, SasaRadii radii_set)
 
 ~ LeGrandSasa () override
 
Real calculate (const pose::Pose &pose, const id::AtomID_Map< bool > &atom_subset, id::AtomID_Map< Real > &atom_sasa, utility::vector1< Real > &rsd_sasa) override
 Calculate Sasa. Atoms not calculated have -1 sasa. This is carried over for compatability purposes. More...
 
std::string get_name () const override
 
ObjexxFCL::FArray2D_int const & get_angles () const
 Returns const access to the angles FArray, which contains the information in the SASA database file sampling/SASA-angles.dat. Adding this in so that the values in the SASA database files can be used in SASA-based scores. (ronj) More...
 
ObjexxFCL::FArray2D_ubyte const & get_masks () const
 Returns const access to the masks FArray, which contains the information in the SASA database file sampling/SASA-masks.dat. Adding this in so that the values in the SASA database files can be used in SASA-based scores. (ronj) More...
 
void get_overlap (Real const radius_a, Real const radius_b, Real const distance_ijxyz, int &degree_of_overlap) const
 
void get_orientation (Vector const &a_xyz, Vector const &b_xyz, int &phi_index, int &theta_index, Real distance_ijxyz) const
 Gets the orientation of a to b (i to j, see below). Does this by calculating two angles, aphi and theta. (j) More...
 
void get_2way_orientation (Vector const &a_xyz, Vector const &b_xyz, int &phi_a2b_index, int &theta_a2b_index, int &phi_b2a_index, int &theta_b2a_index, Real distance_ijxyz) const
 Gets the orientation of a to b (i to j, see below). Does this by calculating two angles, aphi and theta. (j) More...
 
void calc_atom_masks (conformation::Residue const &irsd, conformation::Residue const &jrsd, Real const probe_radius, Real const cutoff_distance, utility::vector1< Real > const &radii, id::AtomID_Map< bool > const &atom_subset, id::AtomID_Map< utility::vector1< ObjexxFCL::ubyte > > &atom_mask) const
 
- Public Member Functions inherited from core::scoring::sasa::SasaMethod
 SasaMethod (Real probe_radius, SasaRadii radii_set)
 
 ~SasaMethod () override
 
void set_include_probe_radius_in_calc (bool include_probe_radius)
 Include the probe radius in calc. Typical for SASA. More...
 
void set_probe_radius (Real probe_radius)
 Set the probe radius. Typical value is that of water at 1.4 A. More...
 
void set_radii_set (SasaRadii radii_set)
 Set the radii type. More...
 
void set_sasa_method_hp_mode (SasaMethodHPMode const mode_in)
 Set whether we're counting all SASA (default), polar SASA, or hydrophobic SASA. More...
 
SasaMethodHPMode sasa_method_hp_mode () const
 Get whether we're counting all SASA (default), polar SASA, or hydrophobic SASA. More...
 
void set_use_big_polar_hydrogen (bool big_polar_h)
 Legacy option to increase polar hydrogen radii to 1.08A. Supported for now. More...
 

Private Member Functions

void init ()
 Initialize the class - allows alternate constructors, copy constructors, etc. More...
 
void read_angles ()
 Read angles db file into private FArray. More...
 
void read_masks ()
 Read masks db file into private FArray. More...
 
void print_dot_bit_string (utility::vector1< ObjexxFCL::ubyte > &values) const
 helper method to try to confirm that the dots are being overlapped and bits are being set correctly (ronj). More...
 

Private Attributes

int num_bytes_
 
int num_phi_
 
int num_theta_
 
int num_overlaps_
 
int num_orientations_
 
int maskbits_
 
ObjexxFCL::FArray2D< int > angles_
 
ObjexxFCL::FArray2D< ObjexxFCL::ubyte > masks_
 

Additional Inherited Members

- Static Public Member Functions inherited from core::scoring::sasa::SasaMethod
static SasaMethodHPMode sasa_metric_mode_from_name (std::string const &mode_name)
 Given the name of the SasaMethodHPMode, get the mode. More...
 
static std::string sasa_metric_name_from_mode (SasaMethodHPMode const mode)
 Given the SasaMethodHPMode, get the name. More...
 
static std::string list_sasa_method_hp_modes ()
 Construct a comma-separeted string listing all of the sasa metric modes. More...
 
static bool skip_atom (core::conformation::Residue const &rsd, core::Size const atom_index, SasaMethodHPMode const hp_mode)
 Given a residue, an atom index, and a SasaMethodHPMode, determine whether the atom is one to skip (returns true) or count (returns false). More...
 
static bool is_polar_atom (core::conformation::Residue const &rsd, core::Size const atom_index)
 Classify an atom on a residue as "polar" for the purposes of SASA. More...
 
- Protected Attributes inherited from core::scoring::sasa::SasaMethod
Real probe_radius_
 
SasaRadii radii_set_
 
bool include_probe_radius_
 
bool use_big_polar_H_
 

Detailed Description

LeGrand SASA approximation method Used by SasaCalc but can be used by itself. Virt atms are skipped as radii=0.

LeGrand S, Merz KM. Rapid approximation to molecular surface area via the use of Boolean logic and look-up tables. J Comput Chem 1993;14:349-352.

Fortran Implementation: Jerry Tsai C++ Translation: Jeff Gray Cleanup/Bugfixes/OOP: Jared Adolf-Bryfogle

Constructor & Destructor Documentation

◆ LeGrandSasa()

core::scoring::sasa::LeGrandSasa::LeGrandSasa ( Real  probe_radius,
SasaRadii  radii_set 
)

References init().

◆ ~ LeGrandSasa()

core::scoring::sasa::LeGrandSasa::~ LeGrandSasa ( )
override

Member Function Documentation

◆ calc_atom_masks()

void core::scoring::sasa::LeGrandSasa::calc_atom_masks ( conformation::Residue const &  irsd,
conformation::Residue const &  jrsd,
Real const  probe_radius,
Real const  cutoff_distance,
utility::vector1< Real > const &  radii,
id::AtomID_Map< bool > const &  atom_subset,
id::AtomID_Map< utility::vector1< ObjexxFCL::ubyte > > &  atom_mask 
) const

◆ calculate()

Real core::scoring::sasa::LeGrandSasa::calculate ( const pose::Pose pose,
const id::AtomID_Map< bool > &  atom_subset,
id::AtomID_Map< Real > &  atom_sasa,
utility::vector1< Real > &  rsd_sasa 
)
overridevirtual

◆ get_2way_orientation()

void core::scoring::sasa::LeGrandSasa::get_2way_orientation ( Vector const &  a_xyz,
Vector const &  b_xyz,
int &  phi_a2b_index,
int &  theta_a2b_index,
int &  phi_b2a_index,
int &  theta_b2a_index,
Real  distance_ijxyz 
) const

Gets the orientation of a to b (i to j, see below). Does this by calculating two angles, aphi and theta. (j)

This function is the same as the function above but get the orientation of a to b simultaneously with the orientation of b to a. The same result could be achieved by making two separate get_2way_orientation() calls but this method does it more efficiently by avoiding an atan2 and acos call. Instead, once you compute the phi and theta for a on b, you can add/subtrate pi factors to get the phi and theta for b on a. Still not sure how this method returns the correct values, though. (ronj)

References num_phi_, and num_theta_.

◆ get_angles()

ObjexxFCL::FArray2D_int const & core::scoring::sasa::LeGrandSasa::get_angles ( ) const

Returns const access to the angles FArray, which contains the information in the SASA database file sampling/SASA-angles.dat. Adding this in so that the values in the SASA database files can be used in SASA-based scores. (ronj)

References angles_.

◆ get_masks()

ObjexxFCL::FArray2D_ubyte const & core::scoring::sasa::LeGrandSasa::get_masks ( ) const

Returns const access to the masks FArray, which contains the information in the SASA database file sampling/SASA-masks.dat. Adding this in so that the values in the SASA database files can be used in SASA-based scores. (ronj)

References masks_.

◆ get_name()

std::string core::scoring::sasa::LeGrandSasa::get_name ( ) const
overridevirtual

◆ get_orientation()

void core::scoring::sasa::LeGrandSasa::get_orientation ( Vector const &  a_xyz,
Vector const &  b_xyz,
int &  phi_index,
int &  theta_index,
Real  distance_ijxyz 
) const

Gets the orientation of a to b (i to j, see below). Does this by calculating two angles, aphi and theta. (j)

This function is used to get two indexes (phi and theta) which are used to get the index of a dot on the surface of the 'a' sphere. When calculating how much surface area sphere b covers on a, we can get the degree of overlap from the function above, but it's not necessarily the case that the vector that connects the center of atom 'a' and atom 'b' goes through one of the predetermined dot locations on the surface of 'a'. In fact, it's very unlikely that the vector goes through a predetermined dot. Instead, what is done is the actual point of intersection (the outermost point of a on the line from the center of 'a' to center of 'b') is converted to spherical polar coordinates. Then, the values are used to find the location of the closest predetermined point on the surface of 'a' using a lookup table. So what this function needs to do is convert the cartesian coordinate of the actual point of intersection into polar coordinates.

To get the spherical, polar coordinates of a cartesian point x,y,z, use these equations: r = sqrt( x^2 + y^2 + z^2 ) theta = arccos( z / r ) phi = arctan( y / x )

Then, once we have the true phi and theta, we need to translate this into an index (or offset) for the correct value in the database file. There are 64 phi angle bin and 64 theta bins in the database file sampling/SASA-angles.dat. We need to convert the phi and theta into indexes for this file by multiplying them by num_phi / 2*pi. Note: I think phi and theta have been reversed in the function below. The code below uses the following: phi = arccos( z ) theta = arctan( y / x )

After a couple of weeks trying to write tests for this function, I have been unsuccessful in figuring out why it's doing what it does. Despite using the wrong equations, it seems to work. Comparing the total residue SASA values calculated by calc_per_atom_sasa() below results in a correlation of 0.98 against what the program NACCESS finds for the same residues. This test was done on a small 110aa protein. I also looked at the per-atom total SASA and the correlation for all atoms (mini v. NACCESS) was approximately 0.94. I'm using exactly the same van der Waals radii for both programs so I feel like the correlations should be 1.0. Explanations for the differences can be 1) this method is doing something wrong in calculating the closest surface point, 2) this method is correct but the masks that are in the database are not aligned to the surface points correctly, 3) the differences are solely due to the different way that the two program calculate surface area. (ronj)

References num_phi_, and num_theta_.

Referenced by calc_atom_masks().

◆ get_overlap()

void core::scoring::sasa::LeGrandSasa::get_overlap ( Real const  radius_a,
Real const  radius_b,
Real const  distance_ijxyz,
int &  degree_of_overlap 
) const

getting overlap from a to b (or i to j, as the atoms are referred to in calc_per_atom_sasa below). this returns the degree of overlap between two atoms adapted from erics code in area.c GetD2 and returns value from 1 to 100. This calculation is based on the law of cosines. See LeGrand and Merz, Journal of Computational Chemistry 14(3):349-52 (1993). Note that equation (4) is wrong, the denominator should be 2*ri*riq instead of 2*ri*rq (j)

The function gets passed in the sasa radius of atom i (plus the probe radius), the sasa radius of atom j (plus the probe radius), the distance between the atom centers, and a reference to the degree of overlap (represented as an int). The degree of overlap that's returned can be thought of as how much of atom a is covered by atom b. A value of 100 means that atom a is completely covered up by atom b. A value of 1 means that not much of the surface of 'a' is covered up by 'b'. The law of cosines relates the cosine of one angle of a triangle to the lengths of its sides. More specifically, c^2 = a^2 + b^2 - 2*a*b*cos theta, where theta is the angle between sides a and b. For the function we want to compute the angle of the cone of intersection between spheres 'a' and 'b'. Let the radius of atom a be ri, and the radius of atom b be rq, and the distance between atom centers be riq. Let the angle between ri and riq be theta_iq. The cosine of theta_iq will be equivalent to ( ri^2 + riq^2 - rq^2 ) / 2 * ri * riq

References core::scoring::TR().

Referenced by calc_atom_masks().

◆ init()

void core::scoring::sasa::LeGrandSasa::init ( void  )
private

Initialize the class - allows alternate constructors, copy constructors, etc.

References angles_, maskbits_, masks_, num_bytes_, num_orientations_, num_overlaps_, num_phi_, num_theta_, read_angles(), and read_masks().

Referenced by LeGrandSasa().

◆ print_dot_bit_string()

void core::scoring::sasa::LeGrandSasa::print_dot_bit_string ( utility::vector1< ObjexxFCL::ubyte > &  values) const
private

helper method to try to confirm that the dots are being overlapped and bits are being set correctly (ronj).

helper method I was using to try to confirm that the dots are being overlapped and bits are being set correctly (ronj).

References num_bytes_, and core::scoring::TR().

Referenced by calculate().

◆ read_angles()

void core::scoring::sasa::LeGrandSasa::read_angles ( )
private

Read angles db file into private FArray.

References angles_, num_phi_, and num_theta_.

Referenced by init().

◆ read_masks()

void core::scoring::sasa::LeGrandSasa::read_masks ( )
private

Read masks db file into private FArray.

References masks_, num_bytes_, num_orientations_, and num_overlaps_.

Referenced by init().

Member Data Documentation

◆ angles_

ObjexxFCL::FArray2D<int> core::scoring::sasa::LeGrandSasa::angles_
private

◆ maskbits_

int core::scoring::sasa::LeGrandSasa::maskbits_
private

Referenced by calculate(), and init().

◆ masks_

ObjexxFCL::FArray2D<ObjexxFCL::ubyte> core::scoring::sasa::LeGrandSasa::masks_
private

◆ num_bytes_

int core::scoring::sasa::LeGrandSasa::num_bytes_
private

◆ num_orientations_

int core::scoring::sasa::LeGrandSasa::num_orientations_
private

Referenced by init(), and read_masks().

◆ num_overlaps_

int core::scoring::sasa::LeGrandSasa::num_overlaps_
private

Referenced by init(), and read_masks().

◆ num_phi_

int core::scoring::sasa::LeGrandSasa::num_phi_
private

◆ num_theta_

int core::scoring::sasa::LeGrandSasa::num_theta_
private

The documentation for this class was generated from the following files: