Rosetta  2020.46
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | Private Attributes | Static Private Attributes | List of all members
core::pack::interaction_graph::DotSphere Class Reference

Represents the sphere of dots on the vdW surface of an atom, for use in the LeGrand and Merz method of calculating SASA. More...

#include <RotamerDots.hh>

Public Member Functions

 DotSphere ()
 default constructor, initializes all dot counts to zero More...
 
 ~DotSphere ()
 
 DotSphere (DotSphere const &rhs)
 copy constructor More...
 
DotSphereoperator= (DotSphere const &rhs)
 
bool operator!= (DotSphere const &rhs)
 Comparison operator. Using this in debugging. When alternate state rotamer dots is not equal to current state rotamer dots, then I print some extra debugging information. But this could be useful for other purposes, too. Since RotamerDots objects contain DotSphere objects, to compare RD objects, this class needs its own comparison operator, too. More...
 
void zero ()
 
core::Size get_total_dots () const
 
void increment_count (utility::vector1< ObjexxFCL::ubyte > const &)
 increment the count for the dots using an input ubyte array. More...
 
void count_num_covered () const
 iterates across all dots and stores the number with a non-zero coverage count for later use More...
 
core::Size get_num_uncovered () const
 returns the total number of dots on this atom whose coverage count is 0 More...
 
core::Size get_num_covered () const
 returns the total number of dots on this atom with a non-zero coverage count More...
 
DotSphere const & operator-= (DotSphere const &rhs)
 decrements the coverage count for this sphere by the coverage count of the rhs sphere More...
 
DotSphere const & operator+= (DotSphere const &rhs)
 increments the coverage count for this sphere by the coverage count of the rhs sphere More...
 
void print (std::ostream &os) const
 Writes coverage counts to the output stream. if a dot is covered by 10 or more residues, prints 9 to the output stream instead. Useful for debugging. More...
 
bool get_dot_covered (core::Size dot_index) const
 Returns a boolean indicating whether the given dot is covered. Note, this function takes in a 1-based dot-index and converts that to 0-based for the C-style array used by this class. More...
 
void write_to_compact_array (utility::vector1< ObjexxFCL::ubyte > &compact) const
 note, this method results in loss of information; counts > 1 are truncated to 1. bitwise OR with 0000:0001 results in 0000:0001. More...
 
void invert_to_compact_array (utility::vector1< ObjexxFCL::ubyte > &inv_compact) const
 

Static Public Attributes

static core::Size const NUM_DOTS_TOTAL = 162
 

Private Attributes

unsigned char dots_coverage_count_ [NUM_COUNTS_TO_ALLOCATE]
 
core::Size num_covered_
 
bool num_covered_current_
 

Static Private Attributes

static core::Size const NUM_BYTES_IN_DOT_SPHERE_OVERLAP_ARRAYS = 21
 
static core::Size const NUM_COUNTS_TO_ALLOCATE = NUM_BYTES_IN_DOT_SPHERE_OVERLAP_ARRAYS * 8
 

Detailed Description

Represents the sphere of dots on the vdW surface of an atom, for use in the LeGrand and Merz method of calculating SASA.

For every atom in a protein, the vdW surface is patterned with dots. Each dot has to keep track of how many other residues are "covering" this dot. So, that's 1 character for each dot. Each character is the count of the number of residues overlapping with this dot. An assumption we're making here is that a single atom (or really, dot) will never be covered by more than 255 residues.

In this implementation of the LeGrand and Merz algorithm, we're going to be using 162 dots per atom. Turns out that you can distribute 162 dots evenly on the surface of a sphere.

This class is extremely simple. The RotamerDots class below does all the work of tying a particular residues atoms to DotSpheres. As a matter of fact, DotSphere doesn't even know what atom it's representing. It just has the one C-style array for the coverage count and that's it.

Constructor & Destructor Documentation

core::pack::interaction_graph::DotSphere::DotSphere ( )

default constructor, initializes all dot counts to zero

References zero().

core::pack::interaction_graph::DotSphere::~DotSphere ( )
default
core::pack::interaction_graph::DotSphere::DotSphere ( DotSphere const &  rhs)

copy constructor

memcpy is much faster than the FArray operator =

References dots_coverage_count_, NUM_COUNTS_TO_ALLOCATE, num_covered_, and num_covered_current_.

Member Function Documentation

void core::pack::interaction_graph::DotSphere::count_num_covered ( ) const

iterates across all dots and stores the number with a non-zero coverage count for later use

both num_covered_ and num_covered_current_ are declared mutable so that they may be modified in this const method

References dots_coverage_count_, num_covered_, num_covered_current_, and NUM_DOTS_TOTAL.

Referenced by get_num_covered(), and get_num_uncovered().

bool core::pack::interaction_graph::DotSphere::get_dot_covered ( core::Size  dot_index) const

Returns a boolean indicating whether the given dot is covered. Note, this function takes in a 1-based dot-index and converts that to 0-based for the C-style array used by this class.

References dots_coverage_count_, and NUM_DOTS_TOTAL.

Size core::pack::interaction_graph::DotSphere::get_num_covered ( ) const

returns the total number of dots on this atom with a non-zero coverage count

if the coverage count has not been modified since the last time the number of covered dots was counted, then the method uses the cached result

References count_num_covered(), num_covered_, and num_covered_current_.

Size core::pack::interaction_graph::DotSphere::get_num_uncovered ( ) const

returns the total number of dots on this atom whose coverage count is 0

if the coverage count has not been modified since the last time the number of covered dots was counted, then the method uses the cached result.

References count_num_covered(), num_covered_, num_covered_current_, and NUM_DOTS_TOTAL.

core::Size core::pack::interaction_graph::DotSphere::get_total_dots ( ) const
inline

References NUM_DOTS_TOTAL.

void core::pack::interaction_graph::DotSphere::increment_count ( utility::vector1< ObjexxFCL::ubyte > const &  overlap_mask)

increment the count for the dots using an input ubyte array.

Each bit in this ubyte array corresponds to a single dot on the surface of this sphere. Dot coverage counts are incremented for dots whose corresponding bits in the ubyte array are '1'. dots_coverage_count_ is C-style array of unsigned chars. So, index 0 returns the first char (or one byte), index 20*8+7, or 167, is the last char/byte.

Parameters
overlap_mask- a utility::vector1 of size 21 that holds ObjexxFCL ubytes. overlap_mask[ bb ] will return a single ubyte which will determine whether the dots for that region of the vector should be incremented. Because it's a vector1 and this method uses a 0-based array, we have to remember to convert the array index to 1-based before looking at what's in overlap_mask.

References dots_coverage_count_, NUM_BYTES_IN_DOT_SPHERE_OVERLAP_ARRAYS, and num_covered_current_.

void core::pack::interaction_graph::DotSphere::invert_to_compact_array ( utility::vector1< ObjexxFCL::ubyte > &  inv_compact) const
bool core::pack::interaction_graph::DotSphere::operator!= ( DotSphere const &  rhs)

Comparison operator. Using this in debugging. When alternate state rotamer dots is not equal to current state rotamer dots, then I print some extra debugging information. But this could be useful for other purposes, too. Since RotamerDots objects contain DotSphere objects, to compare RD objects, this class needs its own comparison operator, too.

References dots_coverage_count_, NUM_BYTES_IN_DOT_SPHERE_OVERLAP_ARRAYS, num_covered_, and num_covered_current_.

DotSphere const & core::pack::interaction_graph::DotSphere::operator+= ( DotSphere const &  rhs)

increments the coverage count for this sphere by the coverage count of the rhs sphere

References dots_coverage_count_, NUM_COUNTS_TO_ALLOCATE, and num_covered_current_.

DotSphere const & core::pack::interaction_graph::DotSphere::operator-= ( DotSphere const &  rhs)

decrements the coverage count for this sphere by the coverage count of the rhs sphere

References dots_coverage_count_, NUM_COUNTS_TO_ALLOCATE, and num_covered_current_.

DotSphere & core::pack::interaction_graph::DotSphere::operator= ( DotSphere const &  rhs)
void core::pack::interaction_graph::DotSphere::print ( std::ostream &  os) const

Writes coverage counts to the output stream. if a dot is covered by 10 or more residues, prints 9 to the output stream instead. Useful for debugging.

References dots_coverage_count_, and NUM_COUNTS_TO_ALLOCATE.

Referenced by core::pack::interaction_graph::operator<<().

void core::pack::interaction_graph::DotSphere::write_to_compact_array ( utility::vector1< ObjexxFCL::ubyte > &  compact) const

note, this method results in loss of information; counts > 1 are truncated to 1. bitwise OR with 0000:0001 results in 0000:0001.

References dots_coverage_count_, and NUM_BYTES_IN_DOT_SPHERE_OVERLAP_ARRAYS.

void core::pack::interaction_graph::DotSphere::zero ( )

sets the dot coverage counts to zero for all dots memset is fast – a lot of time is spent in this function so I'm using c-style arrays instead of the FArrays

References dots_coverage_count_, NUM_COUNTS_TO_ALLOCATE, num_covered_, and num_covered_current_.

Referenced by DotSphere().

Member Data Documentation

unsigned char core::pack::interaction_graph::DotSphere::dots_coverage_count_[NUM_COUNTS_TO_ALLOCATE]
private
core::Size const core::pack::interaction_graph::DotSphere::NUM_BYTES_IN_DOT_SPHERE_OVERLAP_ARRAYS = 21
staticprivate
core::Size const core::pack::interaction_graph::DotSphere::NUM_COUNTS_TO_ALLOCATE = NUM_BYTES_IN_DOT_SPHERE_OVERLAP_ARRAYS * 8
staticprivate
core::Size core::pack::interaction_graph::DotSphere::num_covered_
mutableprivate
bool core::pack::interaction_graph::DotSphere::num_covered_current_
mutableprivate
core::Size const core::pack::interaction_graph::DotSphere::NUM_DOTS_TOTAL = 162
static

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