![]() |
Rosetta Core
2014.35
|
Handles sphere-sphere overlap calculations for the HPatchInteractionGraph. More...
#include <RotamerDots.hh>
Public Member Functions | |
RotamerDots () | |
RotamerDots (conformation::ResidueCOP rotamer, bool exclude_hydrogen_atoms=false, bool use_expanded_polar_atom_radii=false) | |
Custom constructor for a RotamerDots object. More... | |
virtual | ~RotamerDots () |
RotamerDots (RotamerDots const &rhs) | |
copy constructor More... | |
void | copy (RotamerDots const &rhs) |
Copy method for the RotamerDots class. Also used by the assignment operator. More... | |
RotamerDots const & | operator= (RotamerDots const &rhs) |
bool | operator!= (RotamerDots const &rhs) |
Used during debugging of the HPatchIG. Some extra information is printed if current state dots is NOT EQUAL to alternate state dots at a Node/BGNode. More... | |
void | zero () |
Zeros out all of the contained data except the rotamer pointer and the radii array. More... | |
bool | overlaps (RotamerDots const &other) const |
Returns true if this RotamerDots object has any sphere overlap with the passed in RotamerDots object. More... | |
core::conformation::ResidueCOP | rotamer () const |
bool | state_unassigned () const |
Is the state of this RotamerDots object unassigned? More... | |
core::Size | get_num_atoms () const |
Returns the number of atoms this RotamerDots object is keeping SASA for. More... | |
numeric::xyzVector< Real > | get_atom_coords_xyz (Size atom_index) const |
Return the xyz coordinates of an atom in this RotamerDots instance. More... | |
core::Real | get_atom_radius (Size atom_index) const |
Returns the SASA radius for the passed in atom type. The DB file should have been read in at construct time. More... | |
core::Real | radius_for_attype (Size const attype_index) |
Same as the above, but skips the conversion from atom index to atom type index. More... | |
core::Real | max_atom_radius () |
Returns the maximum atom radius. Used only by the SurfacePotential class. More... | |
utility::vector1< Real > * | get_radii () const |
Returns a pointer to the radii vector. Used only by the InvRotamerDots class. More... | |
void | increment_self_overlap () |
computes and stores self-induced dot coverage. uses a vector1 of vector1 of ubytes to store the calculated overlap information. More... | |
void | increment_this_and_cache (RotamerDots const &other, RotamerDotsCache &this_overlap_on_other, utility::vector1< utility::vector1< bool > > &atom_atom_overlaps_cache) |
Add rotamer coverage counts for dots on this object only, leaving rhs unaltered. More... | |
void | get_res_res_overlap (RotamerDots const &other_res, utility::vector1< utility::vector1< ObjexxFCL::ubyte > > &res1_covered_by_res2, utility::vector1< utility::vector1< ObjexxFCL::ubyte > > &res2_covered_by_res1, utility::vector1< utility::vector1< bool > > &atom_atom_overlaps_cache) const |
Calls get_atom_atom_coverage for all atom pairs between res1 and res2. This method gets called by RotamerDots::get_overlap_cache(). More... | |
bool | get_atom_atom_coverage (Vector const &at1_xyz, Real at1_base_radius, Vector const &at2_xyz, Real at2_base_radius, utility::vector1< ObjexxFCL::ubyte > &at1_sphere_covered, utility::vector1< ObjexxFCL::ubyte > &at2_sphere_covered, Real dist_sq) const |
returns false if the two spheres do not overlap at all. otherwise, saves the overlap masks to the input vectors. More... | |
void | increment_from_cached (RotamerDotsCache const &cached_dot_overlap) |
Increments the dot coverage count for this rotamer from a coverage cache. More... | |
void | decrement_from_cached (RotamerDotsCache const &cached_dot_overlap) |
decrements the dot coverage count for this by the coverage stored in the input RotamerDotsCache object More... | |
void | increment_both (RotamerDots &other) |
Add rotamer coverage counts for dots on both this and other. sets sasa_is_current_ to false on both this and rhs. More... | |
void | increment_both_and_cache (RotamerDots &other_rotamer, RotamerDotsCache &others_dots_covered_by_this, RotamerDotsCache &this_dots_covered_by_other, utility::vector1< utility::vector1< bool > > &atom_atom_overlaps_cache) |
core::Real | get_sasa () const |
Given the current dot coverage counts, returns the total SASA of this residue. More... | |
core::Real | get_atom_sasa (Size atom_index) const |
Given the current dot coverage counts, returns the total SASA for a particular atom index. Assumes that get_atom_sasa() will never be called when the object is in the unassigned state. More... | |
core::Size | get_num_uncovered (core::Size atom) const |
Returns the number of uncovered dots on the given atom, when using standard SASA radii. Note: no expanded polars version of this method. More... | |
core::Size | get_num_covered_total () const |
Note: no expanded polars version of this method. More... | |
void | print (std::ostream &os) const |
std::string | name3 () const |
core::Size | seqpos () const |
utility::vector1< DotSphere > const & | get_atom_counts () |
void | invert_to_boolmasks (utility::vector1< utility::vector1< ObjexxFCL::ubyte > > &inv_dots) const |
Inverts the current dot counts and saves them to the passed in vector. More... | |
void | invert_to_boolmasks (utility::vector1< utility::vector1< ObjexxFCL::ubyte > > &inv_dots, utility::vector1< Size > const &ats_to_update) const |
invert the current dot counts for a subset of the atoms in this rotamer. More... | |
Static Public Member Functions | |
static core::Vector | dot_coord (Size index) |
Static Public Attributes | |
static core::Size const | num_bytes_ = 21 |
static core::Real | probe_radius_ = 1.4 |
static core::Real | polar_expansion_radius_ = 1.0 |
static ObjexxFCL::FArray2D_int const * | lg_angles_ |
TEMP! More... | |
static ObjexxFCL::FArray2D_ubyte const * | lg_masks_ |
Private Member Functions | |
void | get_overlap_cache (RotamerDots const &other, RotamerDotsCache &others_dots_covered_by_this, RotamerDotsCache &this_dots_covered_by_other, utility::vector1< utility::vector1< bool > > &atom_atom_overlaps_cache) const |
computes the overlap each rotamer (this & other) induce on each other and stores that information in the RotamerDotsCache objects More... | |
Static Private Member Functions | |
static void | initialize_sasa_arrays () |
Initializes the pointers to the angles and masks FArrays used by sasa.cc and inits the dot sphere coordinates. More... | |
static void | initialize_dot_coords (utility::vector1< core::Vector > &dot_coords) |
Static Private Attributes | |
static bool | sasa_arrays_initialized_ = false |
static utility::vector1 < core::Vector > | dot_coords_ |
Handles sphere-sphere overlap calculations for the HPatchInteractionGraph.
RotamerDots hold DotSphere objects for the atoms of a given Residue (or really, of the current state on some interaction graph Node). Default use of the class will result in RotamerDots objects keeping DotSpheres for every atom of a residue. For the hpatch interaction graph, though, we only care about the SASA of the heavy atoms. No need to include the hydrogens when looking for hydrophobic patches. By not keeping track of the hydrogens, we save a huge amount of time on computing updates to the SASA score because hydrogen atoms generally make up half of a protein. So I'm adding a boolean flag to the non-default constructor which toggles whether we're tracking SASA of all atoms, or just the heavy atoms.
Two other big changes being made to this class are that 1) the class will now keep track of two kinds of SASA and 2) it will no longer keep score or score_is_current variables. The two kinds of SASA the class will keep track of are the standard SASA, and a SASA with polar atom radii extended. The expanded polar SASA will only be kept if a boolean flag is set at construct time. If not, it will just calculate standard SASA and that's it. The second change is that this class is now only keeping track of SASA. RotamerDots objects will not be responsible for calculating a score.
core::pack::interaction_graph::RotamerDots::RotamerDots | ( | ) |
core::pack::interaction_graph::RotamerDots::RotamerDots | ( | conformation::ResidueCOP | rotamer, |
bool | exclude_hydrogen_atoms = false , |
||
bool | use_expanded_polar_atom_radii = false |
||
) |
Custom constructor for a RotamerDots object.
References atom_counts_, atom_sasa_, core::pack::interaction_graph::RotamerDotsRadiusData::get_instance(), core::pack::interaction_graph::RotamerDotsRadiusData::get_NACCESS_SASA_radii(), core::pack::interaction_graph::RotamerDotsRadiusData::get_NACCESS_SASA_radii_with_expanded_polars(), initialize_sasa_arrays(), num_atoms_, polar_expansion_radius_, radii_, and sasa_arrays_initialized_.
|
virtual |
core::pack::interaction_graph::RotamerDots::RotamerDots | ( | RotamerDots const & | rhs | ) |
copy constructor
void core::pack::interaction_graph::RotamerDots::copy | ( | RotamerDots const & | rhs | ) |
Copy method for the RotamerDots class. Also used by the assignment operator.
References atom_counts_, atom_sasa_, num_atoms_, radii_, rotamer_, sasa_, and sasa_is_current_.
Referenced by operator=().
void core::pack::interaction_graph::RotamerDots::decrement_from_cached | ( | RotamerDotsCache const & | cache | ) |
decrements the dot coverage count for this by the coverage stored in the input RotamerDotsCache object
RotamerDots::decrement_from_cached
References atom_counts_, core::pack::interaction_graph::RotamerDotsCache::atom_counts_, num_atoms_, and sasa_is_current_.
|
static |
References dot_coords_, initialize_sasa_arrays(), and sasa_arrays_initialized_.
bool core::pack::interaction_graph::RotamerDots::get_atom_atom_coverage | ( | Vector const & | at1_xyz, |
Real | at1_base_radius, | ||
Vector const & | at2_xyz, | ||
Real | at2_base_radius, | ||
utility::vector1< ObjexxFCL::ubyte > & | at1_sphere_covered, | ||
utility::vector1< ObjexxFCL::ubyte > & | at2_sphere_covered, | ||
Real | dist_sq | ||
) | const |
returns false if the two spheres do not overlap at all. otherwise, saves the overlap masks to the input vectors.
RotamerDots::get_atom_atom_coverage()
References core::kinematics::distance(), numeric::xyzVector< class >::distance_squared(), core::scoring::sasa::get_legrand_2way_orientation(), core::scoring::sasa::get_legrand_atomic_overlap(), num_bytes_, and probe_radius_.
Referenced by get_res_res_overlap(), and increment_self_overlap().
numeric::xyzVector< Real > core::pack::interaction_graph::RotamerDots::get_atom_coords_xyz | ( | Size | atom_index | ) | const |
Return the xyz coordinates of an atom in this RotamerDots instance.
RotamerDots::get_atom_coords_xyz
References rotamer_.
Referenced by get_res_res_overlap(), increment_self_overlap(), and overlaps().
|
inline |
References atom_counts_.
Returns the SASA radius for the passed in atom type. The DB file should have been read in at construct time.
References radii_, and rotamer_.
Referenced by get_res_res_overlap(), get_sasa(), increment_self_overlap(), core::pack::interaction_graph::HPatchNode< V, E, G >::initialize_atom_atom_overlap_cache(), overlaps(), and print().
Given the current dot coverage counts, returns the total SASA for a particular atom index. Assumes that get_atom_sasa() will never be called when the object is in the unassigned state.
References atom_sasa_, get_sasa(), and sasa_is_current_.
Size core::pack::interaction_graph::RotamerDots::get_num_atoms | ( | ) | const |
Returns the number of atoms this RotamerDots object is keeping SASA for.
References num_atoms_.
Referenced by core::pack::interaction_graph::HPatchNode< V, E, G >::get_alt_state_num_atoms(), core::pack::interaction_graph::HPatchNode< V, E, G >::get_current_state_num_atoms(), get_overlap_cache(), get_res_res_overlap(), increment_both(), core::pack::interaction_graph::HPatchBackgroundEdge< V, E, G >::initialize_overlap_cache(), core::pack::interaction_graph::HPatchNode< V, E, G >::initialize_overlap_with_background(), overlaps(), core::pack::interaction_graph::InvRotamerDots::setup_from_rotamer_dots(), and core::pack::interaction_graph::HPatchEdge< V, E, G >::update_state_at_neighbor().
Size core::pack::interaction_graph::RotamerDots::get_num_covered_total | ( | ) | const |
Note: no expanded polars version of this method.
RotamerDots::get_num_covered
References atom_counts_.
Referenced by print().
Size core::pack::interaction_graph::RotamerDots::get_num_uncovered | ( | core::Size | atom | ) | const |
Returns the number of uncovered dots on the given atom, when using standard SASA radii. Note: no expanded polars version of this method.
RotamerDots::get_num_uncovered
References atom_counts_.
Referenced by get_sasa().
|
private |
computes the overlap each rotamer (this & other) induce on each other and stores that information in the RotamerDotsCache objects
RotamerDots::get_overlap_cache
other | - [in] - the other RotamerDots object other_dots_covered_by_this - [out] - the Cache for the dots on the surface of other that are covered by the atoms on this rotamer this_dots_covered_by_other - [out] - the Cache for the dots on the surface of this that are covered by the atoms on the other rotamer atom_atom_overlaps_cache - [out] - holds a boolean indicating whether two atoms have overlapping, solvent-exposed surface area |
References get_num_atoms(), get_res_res_overlap(), core::pack::interaction_graph::RotamerDotsCache::increment_count(), num_atoms_, num_bytes_, and core::pack::interaction_graph::RotamerDotsCache::zero().
Referenced by increment_both_and_cache(), and increment_this_and_cache().
utility::vector1< Real > * core::pack::interaction_graph::RotamerDots::get_radii | ( | ) | const |
Returns a pointer to the radii vector. Used only by the InvRotamerDots class.
References radii_.
Referenced by core::pack::interaction_graph::InvRotamerDots::setup_from_rotamer_dots().
void core::pack::interaction_graph::RotamerDots::get_res_res_overlap | ( | RotamerDots const & | other_res, |
utility::vector1< utility::vector1< ObjexxFCL::ubyte > > & | res1_covered_by_res2, | ||
utility::vector1< utility::vector1< ObjexxFCL::ubyte > > & | res2_covered_by_res1, | ||
utility::vector1< utility::vector1< bool > > & | atom_atom_overlaps_cache | ||
) | const |
Calls get_atom_atom_coverage for all atom pairs between res1 and res2. This method gets called by RotamerDots::get_overlap_cache().
RotamerDots::get_res_res_overlap()
References get_atom_atom_coverage(), get_atom_coords_xyz(), get_atom_radius(), get_num_atoms(), num_atoms_, and core::scoring::packstat::overlap().
Referenced by get_overlap_cache().
Real core::pack::interaction_graph::RotamerDots::get_sasa | ( | ) | const |
Given the current dot coverage counts, returns the total SASA of this residue.
The reason both sasa_ and sasa_is_current_ are "mutable" is so that they can be modified inside this const function.
References atom_counts_, atom_sasa_, get_atom_radius(), get_num_uncovered(), numeric::constants::d::pi, probe_radius_, sasa_, sasa_is_current_, and state_unassigned().
Referenced by get_atom_sasa(), core::pack::interaction_graph::operator<<(), and print().
void core::pack::interaction_graph::RotamerDots::increment_both | ( | RotamerDots & | other | ) |
Add rotamer coverage counts for dots on both this and other. sets sasa_is_current_ to false on both this and rhs.
References get_num_atoms(), increment_both_and_cache(), num_atoms_, and core::pack::interaction_graph::RotamerDotsCache::zero().
void core::pack::interaction_graph::RotamerDots::increment_both_and_cache | ( | RotamerDots & | other_rotamer, |
RotamerDotsCache & | others_dots_covered_by_this, | ||
RotamerDotsCache & | this_dots_covered_by_other, | ||
utility::vector1< utility::vector1< bool > > & | atom_atom_overlaps_cache | ||
) |
RotamerDots::increment_both_and_cache
If the class is keeping the expanded polar atom SASA also, then this function makes an extra call to get_overlap_cache() to get the extra overlap that happens when polar atom radii are expanded.
References get_overlap_cache(), and increment_from_cached().
Referenced by increment_both().
void core::pack::interaction_graph::RotamerDots::increment_from_cached | ( | RotamerDotsCache const & | cache | ) |
Increments the dot coverage count for this rotamer from a coverage cache.
RotamerDots::increment_from_cached
References atom_counts_, core::pack::interaction_graph::RotamerDotsCache::atom_counts_, num_atoms_, sasa_is_current_, and TR_RD.
Referenced by increment_both_and_cache(), and increment_this_and_cache().
void core::pack::interaction_graph::RotamerDots::increment_self_overlap | ( | ) |
computes and stores self-induced dot coverage. uses a vector1 of vector1 of ubytes to store the calculated overlap information.
RotamerDots::increment_self_overlap
to handle the possibility of keeping expanded_polar SASA, we have to run the nested loop over atoms a second time through using the expanded_polar version of get_atom_radius().
References atom_counts_, get_atom_atom_coverage(), get_atom_coords_xyz(), get_atom_radius(), num_atoms_, num_bytes_, and sasa_is_current_.
void core::pack::interaction_graph::RotamerDots::increment_this_and_cache | ( | RotamerDots const & | other, |
RotamerDotsCache & | this_overlap_on_other, | ||
utility::vector1< utility::vector1< bool > > & | atom_atom_overlaps_cache | ||
) |
Add rotamer coverage counts for dots on this object only, leaving rhs unaltered.
RotamerDots::increment_this_and_cache
References get_overlap_cache(), increment_from_cached(), and num_atoms_.
|
staticprivate |
The contents of "sphere.txt", now hard coded. The coordinates in the original file are all on the opposite size of the unit sphere from where they genuinely appear to be.
Referenced by initialize_sasa_arrays().
|
staticprivate |
Initializes the pointers to the angles and masks FArrays used by sasa.cc and inits the dot sphere coordinates.
RotamerDots::initialize_sasa_arrays
References dot_coords_, core::scoring::sasa::get_legrand_sasa_angles(), core::scoring::sasa::get_legrand_sasa_masks(), initialize_dot_coords(), lg_angles_, lg_masks_, and sasa_arrays_initialized_.
Referenced by dot_coord(), and RotamerDots().
void core::pack::interaction_graph::RotamerDots::invert_to_boolmasks | ( | utility::vector1< utility::vector1< ObjexxFCL::ubyte > > & | inv_dots | ) | const |
Inverts the current dot counts and saves them to the passed in vector.
RotamerDots::invert_to_boolmasks
References atom_counts_, and num_atoms_.
Referenced by core::pack::interaction_graph::InvRotamerDots::setup_from_rotamer_dots().
void core::pack::interaction_graph::RotamerDots::invert_to_boolmasks | ( | utility::vector1< utility::vector1< ObjexxFCL::ubyte > > & | inv_dots, |
utility::vector1< Size > const & | ats_to_update | ||
) | const |
invert the current dot counts for a subset of the atoms in this rotamer.
References atom_counts_.
core::Real core::pack::interaction_graph::RotamerDots::max_atom_radius | ( | ) |
Returns the maximum atom radius. Used only by the SurfacePotential class.
References utility::max(), and radii_.
std::string core::pack::interaction_graph::RotamerDots::name3 | ( | ) | const |
References rotamer_.
Referenced by core::pack::interaction_graph::operator<<().
bool core::pack::interaction_graph::RotamerDots::operator!= | ( | RotamerDots const & | rhs | ) |
Used during debugging of the HPatchIG. Some extra information is printed if current state dots is NOT EQUAL to alternate state dots at a Node/BGNode.
References atom_counts_, atom_sasa_, num_atoms_, radii_, rotamer_, sasa_, sasa_is_current_, and state_unassigned().
RotamerDots const & core::pack::interaction_graph::RotamerDots::operator= | ( | RotamerDots const & | rhs | ) |
References copy().
bool core::pack::interaction_graph::RotamerDots::overlaps | ( | RotamerDots const & | other | ) | const |
Returns true if this RotamerDots object has any sphere overlap with the passed in RotamerDots object.
References distance_squared(), numeric::xyzVector< class >::distance_squared(), get_atom_coords_xyz(), get_atom_radius(), get_num_atoms(), num_atoms_, and probe_radius_.
void core::pack::interaction_graph::RotamerDots::print | ( | std::ostream & | os | ) | const |
RotamerDots::write_dot_kinemage RotamerDots::print
References atom_counts_, get_atom_radius(), get_num_covered_total(), get_sasa(), core::chemical::element::I, num_atoms_, rotamer_, sasa_is_current_, and state_unassigned().
core::Real core::pack::interaction_graph::RotamerDots::radius_for_attype | ( | Size const | attype_index | ) |
Same as the above, but skips the conversion from atom index to atom type index.
RotamerDots::radius_for_attype
References radii_.
core::conformation::ResidueCOP core::pack::interaction_graph::RotamerDots::rotamer | ( | ) | const |
References rotamer_.
Referenced by core::pack::interaction_graph::HPatchNode< V, E, G >::alt_state_inv_dots(), core::pack::interaction_graph::HPatchBackgroundNode< V, E, G >::alt_state_inv_dots(), core::pack::interaction_graph::HPatchNode< V, E, G >::curr_state_inv_dots(), core::pack::interaction_graph::HPatchBackgroundNode< V, E, G >::curr_state_inv_dots(), and core::pack::interaction_graph::InvRotamerDots::setup_from_rotamer_dots().
core::Size core::pack::interaction_graph::RotamerDots::seqpos | ( | ) | const |
References rotamer_.
Referenced by core::pack::interaction_graph::operator<<().
bool core::pack::interaction_graph::RotamerDots::state_unassigned | ( | ) | const |
Is the state of this RotamerDots object unassigned?
References rotamer_.
Referenced by get_sasa(), operator!=(), core::pack::interaction_graph::operator<<(), and print().
void core::pack::interaction_graph::RotamerDots::zero | ( | ) |
Zeros out all of the contained data except the rotamer pointer and the radii array.
References atom_counts_, atom_sasa_, sasa_, and sasa_is_current_.
|
private |
Referenced by copy(), decrement_from_cached(), get_atom_counts(), get_num_covered_total(), get_num_uncovered(), get_sasa(), increment_from_cached(), increment_self_overlap(), invert_to_boolmasks(), operator!=(), print(), RotamerDots(), core::pack::interaction_graph::RotamerDotsCache::RotamerDotsCache(), and zero().
|
mutableprivate |
Referenced by copy(), get_atom_sasa(), get_sasa(), operator!=(), RotamerDots(), and zero().
|
staticprivate |
Referenced by dot_coord(), and initialize_sasa_arrays().
|
static |
TEMP!
Referenced by initialize_sasa_arrays().
|
static |
|
private |
|
static |
Referenced by get_atom_atom_coverage(), get_overlap_cache(), increment_self_overlap(), core::pack::interaction_graph::InvRotamerDots::overlap_exposed(), core::pack::interaction_graph::InvRotamerDots::print_dot_bit_string(), core::pack::interaction_graph::InvRotamerDots::setup_from_rotamer_dots(), and core::pack::interaction_graph::InvRotamerDots::write_circle_intersection_mask_to_kinemage().
|
static |
Referenced by RotamerDots().
|
static |
Referenced by core::pack::interaction_graph::SurfacePotential::compute_pose_hpatch_score(), get_atom_atom_coverage(), get_sasa(), core::pack::interaction_graph::InvRotamerDots::overlap_exposed(), overlaps(), core::pack::interaction_graph::InvRotamerDots::write_circle_intersection_mask_to_kinemage(), and core::pack::interaction_graph::InvRotamerDots::write_exposed_dots_to_kinemage().
|
private |
Referenced by copy(), get_atom_radius(), get_radii(), max_atom_radius(), operator!=(), radius_for_attype(), and RotamerDots().
|
private |
Referenced by copy(), get_atom_coords_xyz(), get_atom_radius(), name3(), operator!=(), print(), rotamer(), seqpos(), and state_unassigned().
|
mutableprivate |
Referenced by copy(), get_sasa(), operator!=(), and zero().
|
staticprivate |
Referenced by dot_coord(), initialize_sasa_arrays(), and RotamerDots().
|
mutableprivate |
Referenced by copy(), decrement_from_cached(), get_atom_sasa(), get_sasa(), increment_from_cached(), increment_self_overlap(), operator!=(), print(), and zero().