Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
core::pack::interaction_graph::SurfaceNode< V, E, G > Class Template Reference

Defines a FirstClass node which will keep track of changes in the surface energy. FirstClassNode is defined and implemented in AdditionalBackgroundNodesInteractionGraph. More...

#include <SurfaceInteractionGraph.hh>

Inheritance diagram for core::pack::interaction_graph::SurfaceNode< V, E, G >:
Inheritance graph
[legend]

Public Types

typedef FirstClassNode< V, E, Gparent
 
- Public Types inherited from core::pack::interaction_graph::FirstClassNode< V, E, G >
typedef std::list
< BackgroundToFirstClassEdge
< V, E, G > * > 
BackgroundEdgeList
 
typedef std::list
< BackgroundToFirstClassEdge
< V, E, G > * >::iterator 
BackgroundEdgeListIter
 
typedef std::vector
< BackgroundNode< V, E, G > * > 
BackgroundNodeVector
 
typedef std::vector
< BackgroundToFirstClassEdge
< V, E, G > * > 
BackgroundEdgeVector
 
typedef std::vector
< BackgroundToFirstClassEdge
< V, E, G > * >::iterator 
BackgroundEdgeVectorIter
 

Public Member Functions

 SurfaceNode (G *owner, int node_index, int num_states)
 SurfaceNode constructor. More...
 
 ~SurfaceNode () override
 destructor – no dynamically allocated data, does nothing More...
 
void assign_zero_state () override
 Assign the node to state 0 – the "unassigned" state. More...
 
bool state_unassigned () const override
 
void assign_state_surface (int state)
 Assigns the node to one of the states in its state space or to the unassigned state. More...
 
Real get_curr_state_surface_energy () const
 returns the surface energy for the node in its current state assignment More...
 
Real project_deltaE_for_substitution_surface (int alternate_state, core::PackerEnergy &prev_energy_for_node, float deltaE_thresh_for_avoiding_surface_calcs)
 Returns the (possibly approximate) change in energy induced by changing a node from its current state into some alternate state. More...
 
Real get_surface_deltaE_for_neighbors_state_substitution (SurfaceNode< V, E, G > *node_considering_substitution, int changing_nodes_curr_state, int changing_nodes_alt_state)
 returns the change in surface score for this node induced by a state substitution at a neighboring node. More...
 
Real commit_considered_substitution_surface ()
 Sets the current state to the alternate state this node was asked to consider. Copies appropriate score information. Notifies all of its neighbors that it is going through with the state substitution it had been considering. More...
 
void acknowledge_neighbors_substitution_surface ()
 bookkeeping to follow a neighbors state substitution. this method gets called when a SurfaceNode commits a sub and then broadcasts that change to all its neighboring fc nodes via the incident SurfaceEdges. basically we need to set current state equal to alt state here. (Hopefully alt state is still correct!!) Since there's no way for a SurfaceNode to know what other SurfaceNodes are connected to it except via SurfaceEdges, the calls seem a bit complicated. A SurfaceNode has to call acknowledge_state on each Edge. The Edges have to figure out which Node is changing/not changing and then they call an inform_non_changing node of change method. That method then makes the call to this method on the correct SurfaceNode. The inform_non_changing method can not be removed, because it's used during the substitution evaluations as well. More...
 
bool detect_neighborship_with_node (int node_id, bool first_class) const
 Determines if this vertex neighbors the calling node Called by all other nodes, and if true is returned an Edge of some sort is created between the nodes. More...
 
void print () const override
 useful for debugging - writes information about a node to the tracer More...
 
void prepare_for_simulated_annealing () override
 invokes V's prep_for_simA method Also populates a map defining which nodes are neighbors according to the tenA neighbor graph. This map will be checked whenever iterating over all edges defined by the energy graph to see if a Node really needs to be updated for the surface score. More...
 
virtual unsigned int getMemoryUsageInBytes () const
 Not implemented, but needs to be! More...
 
unsigned int count_static_memory () const override
 Returns the amount of static memory used by this Node object. More...
 
unsigned int count_dynamic_memory () const override
 Returns the amount of dynamic memory used by this Node object. More...
 
void set_rotamers (rotamer_set::RotamerSetCOP rotamers)
 
conformation::ResidueCOP get_rotamer (int state) const
 
int wt_seqpos_for_node () const
 
conformation::Residue wt_residue_for_node () const
 
Real get_surface_score_difference () const
 Returns the difference alt state score - current state score. More...
 
bool is_surface_exposed () const
 Returns the value of surface_exposed_ which gets set during the SIG initialize() method. More...
 
void surface_exposed (bool value)
 setter for the surface_exposed_ bool More...
 
bool is_below_buried_residue_no_hsasa_cutoff () const
 Returns the value of is_below_buried_residue_no_hsasa_cutoff_ which gets set during the SIG initialize() method. More...
 
void is_below_buried_residue_no_hsasa_cutoff (bool value)
 setter for the is_below_buried_residue_no_hsasa_cutoff_ bool More...
 
void reset_alt_state_total_hASA ()
 Sets the alt state total hASA to the current state total hASA. See comments in SIG and commit_considered_substitution_surface for more information about why this method exists. More...
 
void initialize_num_neighbors_counting_self () const
 Returns the number of neighbors within the interaction threshold, counting self. More...
 
int num_neighbors_counting_self () const
 Returns the value stored in the member variable. More...
 
void init_hASA_variables ()
 
Real calculate_amount_total_hydrophobic_ASA ()
 
Real average_residue_hASA () const
 Returns the amount of hydrophobic ASA this node/residue adds to a patch. More...
 
Real average_residue_hASA (chemical::AA residue_type, Size num_nbs) const
 Same function as above, but this one allows you to specify what type and num_nbs. This function is meant to be used only when initializing all of the Nodes/BGNodes because at that point we have to use the wild-type residue type, not the new rotamers residue type (which is what the above function will do). More...
 
Real hASA_energy (Real patch_area) const
 Calls a SurfacePotential class method to get the energy for a given patch area. Only nodes with number of nbs less than or equal to SURFACE_EXPOSED_CUTOFF will get a score. All other nodes will have a score of 0.0. More...
 
void verify_patch_areas_correct (int node_id, int previous_state, Real previous_state_hASA)
 Checks to make sure that the current state num se hp nbs is correct, by going through all residues in the Pose and brute-force recounting. More...
 
void set_observed_sufficient_boolean_true ()
 Sets the observed_sufficient_surface_E_to_predict_min_ to true. Only used by the unit tests. More...
 
std::vector< Realget_hASA_for_node_and_nbs ()
 Returns a vector of Reals containing the hASA of se hp nbs for this node in the first index, and then the hASA for all neighboring nodes and bgnodes. Note: Order is not guaranteed here. Only used by the unit tests. Should not exist in release mode. More...
 
std::vector< Realget_alt_state_hASA_for_node_and_nbs ()
 Returns a vector of Reals containing the hASA of se hp nbs for this node in the first index, and then the hASA for all neighboring nodes and bgnodes. Note: Order is not guaranteed here. Only used by the unit tests. Should not exist in release mode. More...
 
Real get_current_hASA ()
 Returns current hASA. Only used by the unit tests. Should not exist in release mode. More...
 
Real get_alt_hASA ()
 Returns current hASA. Only used by the unit tests. Should not exist in release mode. More...
 
- Public Member Functions inherited from core::pack::interaction_graph::FirstClassNode< V, E, G >
 ~FirstClassNode () override
 FirstClassNode destructor. More...
 
 FirstClassNode (G *owner, int node_id, int num_states)
 FirstClassNode constructor. More...
 
BackgroundEdgeListIter add_background_edge (BackgroundToFirstClassEdge< V, E, G > *edge)
 Adds a BackgroundToFirstClassEdge to the node's list of such edges and returns an iterator to that list position. More...
 
void drop_background_edge (BackgroundEdgeListIter edge)
 Removes an edge from the node's BackgroundToFirstClassEdge list. More...
 
unsigned int count_dynamic_memory () const override
 Returns an int representing the amount of memory in bytes used by this node. More...
 

Static Public Member Functions

static void print_surface_avoidance_stats ()
 reports on the level of success for surface score calculation procrastination More...
 
static void reset_surface_avoidance_stats ()
 resets static member variables of SurfaceNode that measure how worthwhile surface score calculation procrastination is. More...
 

Public Attributes

rotamer_set::RotamerSetCOP rotamer_set_
 
utility::vector1
< conformation::ResidueCOP
rotamers_vector_
 

Protected Member Functions

SurfaceEdge< V, E, G > * get_incident_surface_edge (int index) const
 
SurfaceBackgroundEdge< V, E, G > * get_edge_to_surface_bg_node (int index) const
 
SurfaceInteractionGraph< V, E,
G > * 
get_surface_owner () const
 
- Protected Member Functions inherited from core::pack::interaction_graph::FirstClassNode< V, E, G >
int get_num_edges_to_background_nodes () const
 
BackgroundToFirstClassEdge< V,
E, G > const * 
get_edge_to_bg_node (int index) const
 
BackgroundToFirstClassEdge< V,
E, G > * 
get_edge_to_bg_node (int index)
 
int get_index_of_adjacent_background_node (int index) const
 
BackgroundNode< V, E, G > const * get_adjacent_background_node (int index) const
 
BackgroundNode< V, E, G > * get_adjacent_background_node (int index)
 
bool get_bg_edge_vector_up_to_date_ () const
 
void update_bg_edge_vector ()
 Syncs the background edge vector with the background edge list. More...
 

Private Member Functions

Real project_surface_deltaE ()
 returns the change in surface score for this node and all of its neighbors produced by switching from its current state to an alternate state. More...
 
void track_surface_E_min ()
 Keeps track of the minimum surface score seen. Every 100 substitutions, updates the variable surface_score_min_last_100. More...
 
bool decide_procrastinate_surface_computations (Real const pd_deltaE, Real const threshold) const
 
 SurfaceNode ()
 
 SurfaceNode (SurfaceNode< V, E, G > const &)
 
SurfaceNode< V, E, G > & operator= (SurfaceNode< V, E, G > const &)
 

Private Attributes

bool calculated_surface_deltaE_
 
Real deltaE_for_substitution_
 
Real curr_state_total_hASA_
 
Real alt_state_total_hASA_
 
bool have_prepared_for_simA_
 
Real surface_score_min_last_100_
 
Real surface_score_min_recent_
 
int num_substitutions_since_surface_min_update_
 
bool observed_sufficient_surface_E_to_predict_min_
 
bool surface_exposed_
 
bool is_below_buried_residue_no_hsasa_cutoff_
 
std::map< std::pair< int, int >
, int > 
fc_neighbor_map
 
std::map< std::pair< int, int >
, int > 
bg_neighbor_map
 
int num_neighbors_counting_self_
 

Static Private Attributes

static Real surface_energy_weight_ = 1.0
 
static const int MAX_SURFACE_ENERGY = 100
 
static const int INTERACTION_RADIUS = 10
 
static const int SURFACE_EXPOSED_CUTOFF = 20
 
static const int BURIED_RESIDUE_NO_HSASA_CUTOFF = 24
 
static const int MAX_PATCH_SURFACE_AREA = 1100
 
static int num_state_substitutions_considered_
 
static int num_surface_comps_procrastinated_
 
static int num_surface_comps_later_made_
 

Detailed Description

template<typename V, typename E, typename G>
class core::pack::interaction_graph::SurfaceNode< V, E, G >

Defines a FirstClass node which will keep track of changes in the surface energy. FirstClassNode is defined and implemented in AdditionalBackgroundNodesInteractionGraph.

Remarks
No public default constructor makes this class uncopyable.

Member Typedef Documentation

template<typename V, typename E, typename G>
typedef FirstClassNode< V, E, G > core::pack::interaction_graph::SurfaceNode< V, E, G >::parent

Constructor & Destructor Documentation

template<typename V , typename E , typename G >
core::pack::interaction_graph::SurfaceNode< V, E, G >::SurfaceNode ( G owner,
int  node_index,
int  num_states 
)

SurfaceNode constructor.

Parameters
owner- [in] - the owning interaction graph node_id - [in] - the index for this node amongst its owners set num_states - [in] - the number of states for this node

References core::pack::interaction_graph::SurfaceNode< V, E, G >::get_surface_owner(), core::pack::interaction_graph::SurfaceNode< V, E, G >::surface_energy_weight_, and core::pack::interaction_graph::TR_NODE().

template<typename V , typename E , typename G >
core::pack::interaction_graph::SurfaceNode< V, E, G >::~SurfaceNode ( )
override

destructor – no dynamically allocated data, does nothing

template<typename V, typename E, typename G>
core::pack::interaction_graph::SurfaceNode< V, E, G >::SurfaceNode ( )
private
template<typename V, typename E, typename G>
core::pack::interaction_graph::SurfaceNode< V, E, G >::SurfaceNode ( SurfaceNode< V, E, G > const &  )
private

Member Function Documentation

template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::acknowledge_neighbors_substitution_surface ( )

bookkeeping to follow a neighbors state substitution. this method gets called when a SurfaceNode commits a sub and then broadcasts that change to all its neighboring fc nodes via the incident SurfaceEdges. basically we need to set current state equal to alt state here. (Hopefully alt state is still correct!!) Since there's no way for a SurfaceNode to know what other SurfaceNodes are connected to it except via SurfaceEdges, the calls seem a bit complicated. A SurfaceNode has to call acknowledge_state on each Edge. The Edges have to figure out which Node is changing/not changing and then they call an inform_non_changing node of change method. That method then makes the call to this method on the correct SurfaceNode. The inform_non_changing method can not be removed, because it's used during the substitution evaluations as well.

template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::assign_state_surface ( int  state)

Assigns the node to one of the states in its state space or to the unassigned state.

Piggy backs on the standard project_deltaE/commit_considered_substitution protocol. Slightly inefficient; however, this code is executed once per simulated annealing run. Not worth optimizing. (apl)

References core::pack::interaction_graph::TR_NODE().

template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::assign_zero_state ( )
override

Assign the node to state 0 – the "unassigned" state.

A node in state 0 produces no surface score. Its neighbors have to adjust their scores appropriately. This method iterates over all the edges emanating from this node and tells them to acknowledge that they've been zeroed out.

template<typename V , typename E , typename G >
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::average_residue_hASA ( ) const

Returns the amount of hydrophobic ASA this node/residue adds to a patch.

This method is oblivious to whether a given residue should contribute to the patch area. This function just does the lookup for the hASA (using the SurfacePotential class). Calls to this function should be surrounded by is-this- a-surface-exposed-hydrophobic checks.

References protocols::cluster::calibur::aa.

template<typename V , typename E , typename G >
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::average_residue_hASA ( chemical::AA  residue_type,
Size  num_nbs 
) const

Same function as above, but this one allows you to specify what type and num_nbs. This function is meant to be used only when initializing all of the Nodes/BGNodes because at that point we have to use the wild-type residue type, not the new rotamers residue type (which is what the above function will do).

template<typename V , typename E , typename G >
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::calculate_amount_total_hydrophobic_ASA ( )

Iterates over all the edges emanating from a residues context graph and determines how many surface-exposed total neighbors that residue has including itself. Uses the context graph in the Pose object because this function is only used for initialization. After being calculated once, incrementing and decrementing can be used instead of reiterating over all edges.

Bug source. This function is not just used once during initialization.

As of 8/1/08, changing this function to iterate over all residues in the pose to determine the number of se nbs instead of using the tenA neighbor graph. This change is so that different interaction thresholds can be used. For example, say I want to find all patches within 8A, not 10A. Can't use the 10A to initialize with or certain correctness checks fail in the Node methods.

Big change: Making this method be part of Node/BGNodes. It's just too difficult to keep this method as part of the SIG. And I can't immediately think of a good reason to keep it in the SIG. It's more a functionality which the nodes should handle.

02/20/09, Changing the method to return the total amount of hydrophobic accessibile surface area instead of the number of hydrophobic neighbors. But most of the code remains the same. We want to sum up the average residue hASA for all of the surface-exposed neighbors within 10A.

References protocols::cluster::calibur::aa, and core::pack::interaction_graph::TR_NODE().

template<typename V , typename E , typename G >
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::commit_considered_substitution_surface ( )

Sets the current state to the alternate state this node was asked to consider. Copies appropriate score information. Notifies all of its neighbors that it is going through with the state substitution it had been considering.

If the node had procrastinated the surface deltaE computation because it thought the sim-annealer unlikely to accept the substitition, then the node must now do the work it procrastinated.

There's a potential situation with considers() and commits() that needs to be checked for here. It's possible that a consider() call is made which causes a set of Nodes to update their alt state counts correspondingly. Since the consider() only gets processed by (or actually the call only goes out to) Nodes which are neighbor graph neighbors, only those Nodes will have their counts updated. Assume that the first consider() is really bad and no commit goes out. If we then consider() another sub, the alt state counts at the previous consider()'s set of nodes are incorrect. If get_deltaE is called by this consider() on some of those nodes, some of them will have their alt states reset. But when the commit goes out to ALL Nodes that are neighbors (NOT just the neighbor graph neighbors) it's possible that some of the Nodes will save the wrong alt state count. One way I think this can be avoided to is check at this node, if the alt state count is different from current, whether the node that originally changed is a neighbor graph neighbor of this node. If it is, that means the counts changed because of that node. If it's not, then this Node must have been one of the ones that fell out of sync. Oooooh, I just thought of another way. When the SIG consider() method is called, I could have a reset alt state counts method that will deal with Nodes that are out of sync. That's more elegant than yet another if statement here!

References core::pack::interaction_graph::TR_NODE().

template<typename V , typename E , typename G >
unsigned int core::pack::interaction_graph::SurfaceNode< V, E, G >::count_dynamic_memory ( ) const
override

Returns the amount of dynamic memory used by this Node object.

template<typename V , typename E , typename G >
unsigned int core::pack::interaction_graph::SurfaceNode< V, E, G >::count_static_memory ( ) const
override

Returns the amount of static memory used by this Node object.

template<typename V , typename E , typename G >
bool core::pack::interaction_graph::SurfaceNode< V, E, G >::decide_procrastinate_surface_computations ( Real const  pd_deltaE,
Real const  threshold 
) const
private

Makes the decision whether or not to procrastinate calculating the surface score. Basically, if the PD energy got better (dE < 0) then return false so we don't procrastinate the calculation (because the alternate state probably will be accepted?). If the best guess for the surface deltaE also comes back better (dE < 0), then return false. Finally, if the difference between the deltaE for the PD terms and the (guessed) surface deltaE is greater than the threshold, return true so we do procrastinate. So basically if the energy (especially the PD energy) gets worse, procrastinate. Otherwise, don't.

References core::pack::interaction_graph::TR_NODE().

template<typename V , typename E , typename G >
bool core::pack::interaction_graph::SurfaceNode< V, E, G >::detect_neighborship_with_node ( int  node_index,
bool  first_class 
) const

Determines if this vertex neighbors the calling node Called by all other nodes, and if true is returned an Edge of some sort is created between the nodes.

To determine whether the passed in fc node is neighbors with this one, we need to iterate through the list of neighbors in the tenA neighbor graph (a ContextGraph) that's stored in the Pose Energies object. Assumes that the Pose has already been scored by some ScoreFunction. The tenA neighbor graph is cool if we want to look at an interaction distance of 10A. But what if we want to only find patches of exposed hydrophobics within an 8A sphere. Then we can't use the tenA neighbor. Instead use an expensive distance measurement between the centroids of the wild-type residues to determine "are they neighbors".

The only problem with making this method generic for fc nodes or bg nodes is that when an index is passed in, it's not possible to really tell if it's a fc node index or bg node index. Rather than making two separate methods for detecting neighborship, add a second parameter to this function which specificies if the node being checked is fc or not. That way we can get the pose residue object correct.

This method basically makes the decision for whether to create a SurfaceEdge or SurfaceBackgroundEdge between two Nodes. It really is what defines how much of the surface we design for.

References core::kinematics::distance(), core::conformation::Residue::nbr_atom(), core::pose::Pose::residue(), and core::conformation::Residue::xyz().

Referenced by core::pack::interaction_graph::SurfaceBackgroundNode< V, E, G >::detect_neighborship().

template<typename V , typename E , typename G >
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::get_alt_hASA ( )

Returns current hASA. Only used by the unit tests. Should not exist in release mode.

template<typename V , typename E , typename G >
std::vector< Real > core::pack::interaction_graph::SurfaceNode< V, E, G >::get_alt_state_hASA_for_node_and_nbs ( )

Returns a vector of Reals containing the hASA of se hp nbs for this node in the first index, and then the hASA for all neighboring nodes and bgnodes. Note: Order is not guaranteed here. Only used by the unit tests. Should not exist in release mode.

template<typename V , typename E , typename G >
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::get_curr_state_surface_energy ( ) const

returns the surface energy for the node in its current state assignment

template<typename V , typename E , typename G >
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::get_current_hASA ( )

Returns current hASA. Only used by the unit tests. Should not exist in release mode.

template<typename V, typename E, typename G>
SurfaceBackgroundEdge< V, E, G >* core::pack::interaction_graph::SurfaceNode< V, E, G >::get_edge_to_surface_bg_node ( int  index) const
inlineprotected
template<typename V , typename E , typename G >
std::vector< Real > core::pack::interaction_graph::SurfaceNode< V, E, G >::get_hASA_for_node_and_nbs ( )

Returns a vector of Reals containing the hASA of se hp nbs for this node in the first index, and then the hASA for all neighboring nodes and bgnodes. Note: Order is not guaranteed here. Only used by the unit tests. Should not exist in release mode.

template<typename V, typename E, typename G>
SurfaceEdge< V, E, G >* core::pack::interaction_graph::SurfaceNode< V, E, G >::get_incident_surface_edge ( int  index) const
inlineprotected
template<typename V , typename E , typename G >
conformation::ResidueCOP core::pack::interaction_graph::SurfaceNode< V, E, G >::get_rotamer ( int  state) const
template<typename V , typename E , typename G >
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::get_surface_deltaE_for_neighbors_state_substitution ( SurfaceNode< V, E, G > *  node_considering_substitution,
int  changing_nodes_curr_state,
int  changing_nodes_alt_state 
)

returns the change in surface score for this node induced by a state substitution at a neighboring node.

So a neighboring first class node that is changing is invoking (via the SurfaceEdge that connects them) this method so that this node can update its counts and then return a change in surface score for this node. This method needs to check if the alt_state that the connected node is considering is going to change the counts here and then perform the lookup for the change in score.

is the rotamer id (state) the same for every node? no. need to either do the work in the edge class method or pass a reference to the node. oooooh, we can use the SIG to get the node changing, too!!! NO! Can't. The SIG get_surface_node( index ) method is protected. Lame. Since I need a way to check the rotamer vector for the changing node (to see what the changing states are) I have to make this method take a raw pointer to the node changing. The alternative would be to do all the state checking in the edge class method, but I feel like this sort of state checking should be done by a Node, not an Edge. Further, this frees the Edge class from having to keep any of the data that the Nodes contains (i.e. the counts of neighbors). The edges just pass along the message (from the changing node) to the other Node, not doing any kind of Node-specific behaviour.

the current state of this node may be unassigned (0). if so, we need to initialize the hASA properly. as of 7/22, the current amount of hydrophobic surface area should be init'd after prep for simA runs. alt state also. if ( parent::get_current_state() == 0 ) curr_state_total_hASA_ = get_surface_owner()->calculate_amount_total_hydrophobic_ASA;

07/24/08 problem situation it's probable that a sub that was considered before wasn't committed, so the alt state count at this node needs to go back to what the current state count is. the problem that may crop up with the reset here is that on a previous consider call, a set of nodes will update their counts. if commit is not called, and a second consider is called, then this node will have its alt state count reset but what about all the other nodes in the previous set. how will their counts get reset to the current state count? perhaps a check in the commit method can be added. nope, a new method has been added to Nodes and BGNodes to handle this case. alt_state_total_hASA_ = curr_state_total_hASA_;

02/20/09 Changed all variable names above to reflect hASA instead of counts.

References core::pack::interaction_graph::SurfaceNode< V, E, G >::get_rotamer(), core::pack::interaction_graph::SurfaceNode< V, E, G >::is_below_buried_residue_no_hsasa_cutoff(), core::pack::interaction_graph::SurfaceNode< V, E, G >::num_neighbors_counting_self(), core::pack::interaction_graph::TR_NODE(), and core::pack::interaction_graph::SurfaceNode< V, E, G >::wt_residue_for_node().

template<typename V, typename E, typename G>
SurfaceInteractionGraph< V, E, G >* core::pack::interaction_graph::SurfaceNode< V, E, G >::get_surface_owner ( ) const
inlineprotected
template<typename V , typename E , typename G >
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::get_surface_score_difference ( ) const

Returns the difference alt state score - current state score.

This method requires that the variables current_state_ and alternate_state_ hold the correct values. An assert guard checks to make sure an out-of-bounds exception won't occur.

template<typename V , typename E , typename G >
unsigned int core::pack::interaction_graph::SurfaceNode< V, E, G >::getMemoryUsageInBytes ( ) const
virtual

Not implemented, but needs to be!

template<typename V , typename E , typename G >
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::hASA_energy ( Real  patch_area) const

Calls a SurfacePotential class method to get the energy for a given patch area. Only nodes with number of nbs less than or equal to SURFACE_EXPOSED_CUTOFF will get a score. All other nodes will have a score of 0.0.

template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::init_hASA_variables ( )
template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::initialize_num_neighbors_counting_self ( ) const

Returns the number of neighbors within the interaction threshold, counting self.

A member variable stores the value so that this method only has to run once and lookups can be performed thereafter. The reason we need to know the number of neighbors is that determining whether a residue is surface exposed depends on how many neighbors it has. For most applications, we have been using the approximation that residues with fewer than 16 neighbors in a 10A radius are surface-exposed. The original method of doing this was done with the tenA nb graph. Then I switched to using cB-cB distances and using the INTERACTION_RADIUS to define neighbors. I'm reverting back to using the tenA neighbor graph. The number of neighbors variable is only used to determine whether a residue is surface exposed or not. It's not like the detect neighborship between Node objects method that effectively defines how much of the surface gets looked at per substitution. Thus, using the tenA nb graph here is ok.

References core::pack::interaction_graph::TR_NODE().

template<typename V , typename E , typename G >
bool core::pack::interaction_graph::SurfaceNode< V, E, G >::is_below_buried_residue_no_hsasa_cutoff ( ) const
template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::is_below_buried_residue_no_hsasa_cutoff ( bool  value)

setter for the is_below_buried_residue_no_hsasa_cutoff_ bool

template<typename V , typename E , typename G >
bool core::pack::interaction_graph::SurfaceNode< V, E, G >::is_surface_exposed ( ) const

Returns the value of surface_exposed_ which gets set during the SIG initialize() method.

template<typename V , typename E , typename G >
int core::pack::interaction_graph::SurfaceNode< V, E, G >::num_neighbors_counting_self ( ) const
template<typename V, typename E, typename G>
SurfaceNode< V, E, G >& core::pack::interaction_graph::SurfaceNode< V, E, G >::operator= ( SurfaceNode< V, E, G > const &  )
private
template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::prepare_for_simulated_annealing ( )
override

invokes V's prep_for_simA method Also populates a map defining which nodes are neighbors according to the tenA neighbor graph. This map will be checked whenever iterating over all edges defined by the energy graph to see if a Node really needs to be updated for the surface score.

template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::print ( ) const
override

useful for debugging - writes information about a node to the tracer

References protocols::cluster::calibur::aa.

template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::print_surface_avoidance_stats ( )
static
template<typename V , typename E , typename G >
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::project_deltaE_for_substitution_surface ( int  alternate_state,
core::PackerEnergy prev_PDenergies_for_node,
float  deltaE_thresh_for_avoiding_surface_calcs 
)

Returns the (possibly approximate) change in energy induced by changing a node from its current state into some alternate state.

Iterates across the edges first to determine the sum of the pairwise decomposable (PD) energy. If the PD difference implies a collision, then the SurfaceNode pretends as if the state substitution causes the best improvement possible in surface score for it and its neighbors, returns the PD difference + pretend surface difference. It will procrastinate computing the actual surface score difference until the guiding SimAnnealer decides to commit the substitution. If the SimAnnealer rejects the substitution, then the work to compute the surface score is never done. If it is unclear that the SimAnnealer will reject the substitution based on the PD difference, then the vertex computes the change in surface score that it induces on its neighbors. The surface score calculation really isn't that intensive but it doesn't make sense to calculate it needlessly. (apl)

Bug source: Incident edges to a node are edges which have some energy on them based on the score function used (meaning they connect to nodes that interact with this node). This set of nodes is larger than the set of nodes that the tenA neighbor graph in the Pose considers neighbors for this node. Thus, when calculating the true number of se hp neighbors, some nodes are updated when they shouldn't be leading to incorrect counts. Possible solutions include 1) keeping some type of data structure (e.g. a map) which specifies which residues are neighbors (in the tenA neighbor graph sort of way) and whenever iterating over incident edges checking to make sure nodes are really neighbors before doing any updating of the counts; 2) forget about which nodes are truly neighbors (as determined by the tenA neighbor graph) and just use whatever the energy function thinks neighbors should be. I don't like this approach though, because I want to have the freedom to adjust what kind of radius I use for residue neighbors for future versions of the surface energy term. Not just assume that the energy function picks neighors correctly.

Where should the neighbor cache be kept? If I keep it on the Node, then the lookups would have to occur in the Node methods that change the counts. If I keep it on the Edges though, I can check for neighborship when iterating over edges and not ever even go into the Node methods. Keep it on the Nodes. That's where it makes sense to keep it.

Parameters
alternate_state- [in] - the alternate state that the node must consider prev_PDenergies_for_node - [out] - the sum of the PD energies (one-and two-body) for the node in its current state deltaE_thresh_for_avoiding_surface_calcs - [in] - the minimum deltaE for which the SimAnnealer will accept slopyness in the deltaE projections

References core::pack::interaction_graph::TR_NODE().

template<typename V , typename E , typename G >
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::project_surface_deltaE ( )
private

returns the change in surface score for this node and all of its neighbors produced by switching from its current state to an alternate state.

References core::pack::interaction_graph::TR_NODE().

template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::reset_alt_state_total_hASA ( )

Sets the alt state total hASA to the current state total hASA. See comments in SIG and commit_considered_substitution_surface for more information about why this method exists.

References core::pack::interaction_graph::TR_NODE().

template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::reset_surface_avoidance_stats ( )
static

resets static member variables of SurfaceNode that measure how worthwhile surface score calculation procrastination is.

Referenced by core::pack::interaction_graph::SurfaceInteractionGraph< V, E, G >::set_errorfull_deltaE_threshold().

template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::set_observed_sufficient_boolean_true ( )

Sets the observed_sufficient_surface_E_to_predict_min_ to true. Only used by the unit tests.

template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::set_rotamers ( rotamer_set::RotamerSetCOP  rotamers)

Need to save a reference to the rotamer_set so that we can determine what a particular state change will do to the score

References core::pack::interaction_graph::TR_NODE().

template<typename V, typename E, typename G>
bool core::pack::interaction_graph::SurfaceNode< V, E, G >::state_unassigned ( ) const
inlineoverride
template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::surface_exposed ( bool  value)

setter for the surface_exposed_ bool

template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::track_surface_E_min ( )
private

Keeps track of the minimum surface score seen. Every 100 substitutions, updates the variable surface_score_min_last_100.

template<typename V , typename E , typename G >
void core::pack::interaction_graph::SurfaceNode< V, E, G >::verify_patch_areas_correct ( int  node_id,
int  previous_state,
Real  previous_state_hASA 
)

Checks to make sure that the current state num se hp nbs is correct, by going through all residues in the Pose and brute-force recounting.

References core::kinematics::distance(), core::conformation::Residue::nbr_atom(), core::pose::Pose::residue(), core::pose::Pose::size(), core::pack::interaction_graph::TR_NODE(), and core::conformation::Residue::xyz().

template<typename V, typename E, typename G>
conformation::Residue core::pack::interaction_graph::SurfaceNode< V, E, G >::wt_residue_for_node ( ) const
inline
template<typename V, typename E, typename G>
int core::pack::interaction_graph::SurfaceNode< V, E, G >::wt_seqpos_for_node ( ) const
inline

Member Data Documentation

template<typename V, typename E, typename G>
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::alt_state_total_hASA_
private
template<typename V, typename E, typename G>
std::map< std::pair<int, int >, int > core::pack::interaction_graph::SurfaceNode< V, E, G >::bg_neighbor_map
private
template<typename V, typename E, typename G>
const int core::pack::interaction_graph::SurfaceNode< V, E, G >::BURIED_RESIDUE_NO_HSASA_CUTOFF = 24
staticprivate
template<typename V, typename E, typename G>
bool core::pack::interaction_graph::SurfaceNode< V, E, G >::calculated_surface_deltaE_
private
template<typename V, typename E, typename G>
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::curr_state_total_hASA_
private
template<typename V, typename E, typename G>
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::deltaE_for_substitution_
private
template<typename V, typename E, typename G>
std::map< std::pair<int, int >, int > core::pack::interaction_graph::SurfaceNode< V, E, G >::fc_neighbor_map
private
template<typename V, typename E, typename G>
bool core::pack::interaction_graph::SurfaceNode< V, E, G >::have_prepared_for_simA_
private
template<typename V, typename E, typename G>
const int core::pack::interaction_graph::SurfaceNode< V, E, G >::INTERACTION_RADIUS = 10
staticprivate
template<typename V, typename E, typename G>
bool core::pack::interaction_graph::SurfaceNode< V, E, G >::is_below_buried_residue_no_hsasa_cutoff_
private
template<typename V, typename E, typename G>
const int core::pack::interaction_graph::SurfaceNode< V, E, G >::MAX_PATCH_SURFACE_AREA = 1100
staticprivate
template<typename V, typename E, typename G>
const int core::pack::interaction_graph::SurfaceNode< V, E, G >::MAX_SURFACE_ENERGY = 100
staticprivate
template<typename V, typename E, typename G>
int core::pack::interaction_graph::SurfaceNode< V, E, G >::num_neighbors_counting_self_
mutableprivate
template<typename V, typename E, typename G>
int core::pack::interaction_graph::SurfaceNode< V, E, G >::num_state_substitutions_considered_
staticprivate
template<typename V, typename E, typename G>
int core::pack::interaction_graph::SurfaceNode< V, E, G >::num_substitutions_since_surface_min_update_
private
template<typename V, typename E, typename G>
int core::pack::interaction_graph::SurfaceNode< V, E, G >::num_surface_comps_later_made_
staticprivate
template<typename V, typename E, typename G>
int core::pack::interaction_graph::SurfaceNode< V, E, G >::num_surface_comps_procrastinated_
staticprivate
template<typename V, typename E, typename G>
bool core::pack::interaction_graph::SurfaceNode< V, E, G >::observed_sufficient_surface_E_to_predict_min_
private
template<typename V, typename E, typename G>
rotamer_set::RotamerSetCOP core::pack::interaction_graph::SurfaceNode< V, E, G >::rotamer_set_
template<typename V, typename E, typename G>
utility::vector1< conformation::ResidueCOP > core::pack::interaction_graph::SurfaceNode< V, E, G >::rotamers_vector_
template<typename V, typename E, typename G>
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::surface_energy_weight_ = 1.0
staticprivate
template<typename V, typename E, typename G>
bool core::pack::interaction_graph::SurfaceNode< V, E, G >::surface_exposed_
private
template<typename V, typename E, typename G>
const int core::pack::interaction_graph::SurfaceNode< V, E, G >::SURFACE_EXPOSED_CUTOFF = 20
staticprivate
template<typename V, typename E, typename G>
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::surface_score_min_last_100_
private
template<typename V, typename E, typename G>
Real core::pack::interaction_graph::SurfaceNode< V, E, G >::surface_score_min_recent_
private

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