Rosetta 3.4
|
Defines a FirstClass node which will keep track of changes in the SASA and hpatch score. FirstClassNode is defined and implemented in AdditionalBackgroundNodesInteractionGraph. More...
#include <HPatchInteractionGraph.hh>
Public Types | |
typedef FirstClassNode< V, E, G > | parent |
typedef V | grandparent |
Public Member Functions | |
HPatchNode (G *owner, int node_index, int num_states) | |
HPatchNode constructor. | |
virtual | ~HPatchNode () |
destructor -- no dynamically allocated data, does nothing | |
void | set_rotamers (rotamer_set::RotamerSetCOP rotamers) |
conformation::ResidueCOP | get_rotamer (int state) const |
Returns a constant OP to the rotamer/residue object for the given state. | |
conformation::ResidueCOP | curr_state_rotamer () const |
conformation::ResidueCOP | alt_state_rotamer () const |
virtual void | set_rotamer_dots_for_state (Size state, RotamerDots const &rd) |
stores the coordinates for a state. | |
bool | overlaps (HPatchNode< V, E, G > *neighbor) |
returns true if any sphere for any atom of any state on this vertex overlaps with any atom on any sphere on a neighboring vertex. | |
bool | detect_any_overlap_with_rotamer (RotamerDots const &rotamer) const |
determines if any atom for any rotamer of this vertex overlaps with any atom from some background residue. called by BGNodes for the detect_background_residue_and_first_class_residue_overlap phase of the prep for simA call in the HPatchIG. | |
virtual void | prepare_for_simulated_annealing () |
invokes V's prep_for_simA method. Also computes the "self-overlap" that each of its rotamers has. | |
void | initialize_overlap_with_background (RotamerDots const &bg_rotamer, std::vector< RotamerDotsCache > &overlap, std::vector< utility::vector1< utility::vector1< bool > > > &states_atom_atom_overlap_on_bg_res) |
This method computes and caches each set of overlaps this node's states have with a background residue. | |
virtual void | assign_zero_state () |
Assign the node to state 0 -- the "unassigned" state. | |
void | acknowledge_neighbors_substitution () |
bookkeeping to follow a neighbors state substitution. this method gets called when a HPatchNode commits a sub and then broadcasts that change to all its neighboring fc nodes via the incident HPatchEdges. 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 HPatchNode to know what other HPatchNodes are connected to it except via HPatchEdges, the calls seem a bit complicated. A HPatchNode 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 HPatchNode. The inform_non_changing method can not be removed, because it's used during the substitution evaluations as well. | |
core::PackerEnergy | calculate_PD_deltaE_for_substitution (int alternate_state, core::PackerEnergy &prev_PDenergies_for_node) |
Returns the change in energy induced by changing a node from its current state into some alternate state for the PD energy terms only. | |
core::PackerEnergy | get_pd_energy_delta () |
Returns the deltaE for just the PD terms. Separate method from the one above because this one can be called from within a commit_sub call that didn't go through consider_sub(). | |
Real | consider_alternate_state () |
Instructs the Node to update the alt state information held by it and its neighbors in response to switching from the current state to an alternate state. | |
Real | get_current_state_sasa () const |
returns the amount of sasa this node has in its current state assignment | |
Real | get_current_state_sasa (Size atom_index) const |
Returns the current state SASA for the passed in atom index. | |
Real | get_alternate_state_sasa (Size atom_index) const |
Returns the alternate state SASA for the passed in atom index. | |
utility::vector1 < utility::vector1< bool > > const & | get_atom_atom_self_overlaps_for_state (Size state) const |
Returns a const reference to the atom-x-atom-pair vector-of-vectors of bools that specifies which atoms are overlapping, in the given state. | |
Size | get_current_state_num_atoms () const |
Size | get_alt_state_num_atoms () const |
int | wt_seqpos_for_node () const |
conformation::Residue const & | wt_residue_for_node () const |
Real | update_state_for_neighbors_substitution (HPatchNode< V, E, G > *node_considering_substitution, RotamerDots &neighbors_alternate_state, RotamerDotsCache const &neighbors_curr_state_overlap_with_this, RotamerDotsCache &this_overlap_with_neighbors_alternate, RotamerDotsCache &neighbors_alternate_overlap_with_this, utility::vector1< utility::vector1< bool > > &alt_state_atom_atom_overlaps_cache) |
returns the change in sasa for this node induced by a state substitution at a neighboring node. The node increments the dot coverage count for the RotamerDots object representing the alternate state dots for that neighbor. | |
void | reset_alt_state_dots () |
Sets the alt state rotamer dots to the current state rotamer dots. See comments in SIG and commit_considered_substitution for more information about why this method exists. | |
void | commit_considered_substitution () |
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. | |
virtual unsigned int | getMemoryUsageInBytes () const |
Not implemented, but needs to be! | |
virtual unsigned int | count_static_memory () const |
Returns the amount of static memory used by this Node object. | |
virtual unsigned int | count_dynamic_memory () const |
Returns the amount of dynamic memory used by this Node object. | |
virtual void | print () const |
useful for debugging | |
RotamerDots const & | get_current_state_rotamer_dots () |
Returns current state. Only used by the unit tests. | |
RotamerDots const & | get_alt_state_rotamer_dots () |
Returns current state. Only used by the unit tests. | |
InvRotamerDots const & | curr_state_inv_dots () const |
InvRotamerDots const & | alt_state_inv_dots () const |
Size | max_hphobe_atoms_any_restype () const |
utility::vector1< Size > const & | curr_state_hphobes () const |
utility::vector1< Size > const & | alt_state_hphobes () const |
Size | n_curr_state_hphobes () const |
Size | n_alt_state_hphobes () const |
utility::vector1< Size > const & | curr_state_exp_hphobes () const |
utility::vector1< Size > const & | alt_state_exp_hphobes () const |
Size | n_curr_state_exp_hphobes () const |
Size | n_alt_state_exp_hphobes () const |
Protected Member Functions | |
HPatchEdge< V, E, G > * | get_incident_hpatch_edge (int index) const |
HPatchBackgroundEdge< V, E, G > * | get_edge_to_hpatch_bg_node (int index) const |
HPatchInteractionGraph< V, E, G > * | get_hpatch_owner () const |
Real | get_sasa_difference () const |
Returns alt_state_rotamer_dots_.get_sasa() - curr_state_dots.get_sasa() except when either the current state or the alternate state is the unassigned state; state 0. |
Defines a FirstClass node which will keep track of changes in the SASA and hpatch score. FirstClassNode is defined and implemented in AdditionalBackgroundNodesInteractionGraph.
typedef V core::pack::interaction_graph::HPatchNode< V, E, G >::grandparent |
typedef FirstClassNode< V, E, G > core::pack::interaction_graph::HPatchNode< V, E, G >::parent |
core::pack::interaction_graph::HPatchNode< V, E, G >::HPatchNode | ( | G * | owner, |
int | node_index, | ||
int | num_states | ||
) |
HPatchNode constructor.
core::pack::interaction_graph::HPatchNode< V, E, G >::~HPatchNode | ( | ) | [virtual] |
destructor -- no dynamically allocated data, does nothing
void core::pack::interaction_graph::HPatchNode< V, E, G >::acknowledge_neighbors_substitution | ( | ) |
bookkeeping to follow a neighbors state substitution. this method gets called when a HPatchNode commits a sub and then broadcasts that change to all its neighboring fc nodes via the incident HPatchEdges. 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 HPatchNode to know what other HPatchNodes are connected to it except via HPatchEdges, the calls seem a bit complicated. A HPatchNode 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 HPatchNode. The inform_non_changing method can not be removed, because it's used during the substitution evaluations as well.
utility::vector1< Size > const& core::pack::interaction_graph::HPatchNode< V, E, G >::alt_state_exp_hphobes | ( | ) | const [inline] |
utility::vector1< Size > const& core::pack::interaction_graph::HPatchNode< V, E, G >::alt_state_hphobes | ( | ) | const [inline] |
InvRotamerDots const& core::pack::interaction_graph::HPatchNode< V, E, G >::alt_state_inv_dots | ( | ) | const [inline] |
conformation::ResidueCOP core::pack::interaction_graph::HPatchNode< V, E, G >::alt_state_rotamer | ( | ) | const [inline] |
void core::pack::interaction_graph::HPatchNode< V, E, G >::assign_zero_state | ( | ) | [virtual] |
Assign the node to state 0 -- the "unassigned" state.
References core::pack::interaction_graph::TR_NODE().
core::PackerEnergy core::pack::interaction_graph::HPatchNode< V, E, G >::calculate_PD_deltaE_for_substitution | ( | int | alternate_state, |
core::PackerEnergy & | prev_PDenergies_for_node | ||
) |
Returns the change in energy induced by changing a node from its current state into some alternate state for the PD energy terms only.
HPatchNode::calculate_PD_deltaE_for_substitution
void core::pack::interaction_graph::HPatchNode< V, E, G >::commit_considered_substitution | ( | ) |
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.
HPatchNode::commit_considered_substitution
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!
I'm not sure the above is really a problem in the case of this IG. It seems like even if a non-committed consider() call occurs that alters the alt state counts/dots at some set of nodes, when a following sub does get commit'd(), then the nodes that will get the commit message should have all been updated. Some nodes will still have alt_state counts that are weird, but when a consider() call comes back around to them, it should reset the alt_state before doing anything.
References core::pack::interaction_graph::TR_NODE().
Real core::pack::interaction_graph::HPatchNode< V, E, G >::consider_alternate_state | ( | ) |
Instructs the Node to update the alt state information held by it and its neighbors in response to switching from the current state to an alternate state.
HPatchNode< V, E, G >::consider_alternate_state()
References core::pack::interaction_graph::TR_NODE().
unsigned int core::pack::interaction_graph::HPatchNode< V, E, G >::count_dynamic_memory | ( | ) | const [virtual] |
Returns the amount of dynamic memory used by this Node object.
HPatchNode::count_dynamic_memory
Reimplemented from core::pack::interaction_graph::FirstClassNode< V, E, G >.
unsigned int core::pack::interaction_graph::HPatchNode< V, E, G >::count_static_memory | ( | ) | const [virtual] |
Returns the amount of static memory used by this Node object.
utility::vector1< Size > const& core::pack::interaction_graph::HPatchNode< V, E, G >::curr_state_exp_hphobes | ( | ) | const [inline] |
utility::vector1< Size > const& core::pack::interaction_graph::HPatchNode< V, E, G >::curr_state_hphobes | ( | ) | const [inline] |
InvRotamerDots const& core::pack::interaction_graph::HPatchNode< V, E, G >::curr_state_inv_dots | ( | ) | const [inline] |
conformation::ResidueCOP core::pack::interaction_graph::HPatchNode< V, E, G >::curr_state_rotamer | ( | ) | const [inline] |
bool core::pack::interaction_graph::HPatchNode< V, E, G >::detect_any_overlap_with_rotamer | ( | RotamerDots const & | bg_dots | ) | const |
determines if any atom for any rotamer of this vertex overlaps with any atom from some background residue. called by BGNodes for the detect_background_residue_and_first_class_residue_overlap phase of the prep for simA call in the HPatchIG.
HPatchNode::detect_any_overlap_with_rotamer
Referenced by core::pack::interaction_graph::HPatchBackgroundNode< V, E, G >::detect_overlap().
Size core::pack::interaction_graph::HPatchNode< V, E, G >::get_alt_state_num_atoms | ( | ) | const [inline] |
RotamerDots const & core::pack::interaction_graph::HPatchNode< V, E, G >::get_alt_state_rotamer_dots | ( | ) |
Returns current state. Only used by the unit tests.
Real core::pack::interaction_graph::HPatchNode< V, E, G >::get_alternate_state_sasa | ( | Size | atom_index | ) | const |
Returns the alternate state SASA for the passed in atom index.
utility::vector1< utility::vector1< bool > > const & core::pack::interaction_graph::HPatchNode< V, E, G >::get_atom_atom_self_overlaps_for_state | ( | Size | state | ) | const |
Returns a const reference to the atom-x-atom-pair vector-of-vectors of bools that specifies which atoms are overlapping, in the given state.
HPatchNode< V, E, G >::get_atom_atom_self_overlaps_for_state
Size core::pack::interaction_graph::HPatchNode< V, E, G >::get_current_state_num_atoms | ( | ) | const [inline] |
RotamerDots const & core::pack::interaction_graph::HPatchNode< V, E, G >::get_current_state_rotamer_dots | ( | ) |
Returns current state. Only used by the unit tests.
Real core::pack::interaction_graph::HPatchNode< V, E, G >::get_current_state_sasa | ( | Size | atom_index | ) | const |
Returns the current state SASA for the passed in atom index.
Real core::pack::interaction_graph::HPatchNode< V, E, G >::get_current_state_sasa | ( | ) | const |
returns the amount of sasa this node has in its current state assignment
HPatchNode::get_current_state_sasa()
HPatchBackgroundEdge< V, E, G >* core::pack::interaction_graph::HPatchNode< V, E, G >::get_edge_to_hpatch_bg_node | ( | int | index | ) | const [inline, protected] |
HPatchInteractionGraph< V, E, G >* core::pack::interaction_graph::HPatchNode< V, E, G >::get_hpatch_owner | ( | ) | const [inline, protected] |
HPatchEdge< V, E, G >* core::pack::interaction_graph::HPatchNode< V, E, G >::get_incident_hpatch_edge | ( | int | index | ) | const [inline, protected] |
core::PackerEnergy core::pack::interaction_graph::HPatchNode< V, E, G >::get_pd_energy_delta | ( | ) |
Returns the deltaE for just the PD terms. Separate method from the one above because this one can be called from within a commit_sub call that didn't go through consider_sub().
conformation::ResidueCOP core::pack::interaction_graph::HPatchNode< V, E, G >::get_rotamer | ( | int | state | ) | const |
Returns a constant OP to the rotamer/residue object for the given state.
Need to save a reference to the rotamer_set so that we can determine what a particular state change will do to the score
Real core::pack::interaction_graph::HPatchNode< V, E, G >::get_sasa_difference | ( | ) | const [protected] |
Returns alt_state_rotamer_dots_.get_sasa() - curr_state_dots.get_sasa() except when either the current state or the alternate state is the unassigned state; state 0.
HPatchNode::get_sasa_difference
unsigned int core::pack::interaction_graph::HPatchNode< V, E, G >::getMemoryUsageInBytes | ( | ) | const [virtual] |
Not implemented, but needs to be!
void core::pack::interaction_graph::HPatchNode< V, E, G >::initialize_overlap_with_background | ( | RotamerDots const & | bg_rotamer_dots, |
std::vector< RotamerDotsCache > & | node_states_coverage_of_bg_res_, | ||
std::vector< utility::vector1< utility::vector1< bool > > > & | states_atom_atom_overlap_on_bg_res | ||
) |
This method computes and caches each set of overlaps this node's states have with a background residue.
HPatchNode< V, E, G >::initialize_overlap_with_background
bg_rotamer | - [in] - the RotamerDots object for the background residue node_states_coverage_of_bg_res_ -[out] - the array of RotamerDotsCache objects that the HPatchBackgroundEdge stores for the overlap of each state in this residue on the background residue. states_atom_atom_overlap_on_bg_res -[out] - an array that holds the atom-atom overlap each state on this Node has on the background residue |
References core::pack::interaction_graph::RotamerDots::get_num_atoms().
Size core::pack::interaction_graph::HPatchNode< V, E, G >::max_hphobe_atoms_any_restype | ( | ) | const [inline] |
Size core::pack::interaction_graph::HPatchNode< V, E, G >::n_alt_state_exp_hphobes | ( | ) | const [inline] |
Size core::pack::interaction_graph::HPatchNode< V, E, G >::n_alt_state_hphobes | ( | ) | const [inline] |
Size core::pack::interaction_graph::HPatchNode< V, E, G >::n_curr_state_exp_hphobes | ( | ) | const [inline] |
Size core::pack::interaction_graph::HPatchNode< V, E, G >::n_curr_state_hphobes | ( | ) | const [inline] |
bool core::pack::interaction_graph::HPatchNode< V, E, G >::overlaps | ( | HPatchNode< V, E, G > * | neighbor | ) |
returns true if any sphere for any atom of any state on this vertex overlaps with any atom on any sphere on a neighboring vertex.
void core::pack::interaction_graph::HPatchNode< V, E, G >::prepare_for_simulated_annealing | ( | ) | [virtual] |
invokes V's prep_for_simA method. Also computes the "self-overlap" that each of its rotamers has.
HPatchNode::prepare_for_simulated_annealing
References core::pack::interaction_graph::TR_NODE().
void core::pack::interaction_graph::HPatchNode< V, E, G >::print | ( | ) | const [virtual] |
useful for debugging
HPatchNode::write_dot_kinemage HPatchNode::print
useful for debugging - writes information about a node to the tracer
References core::pack::interaction_graph::TR_NODE().
void core::pack::interaction_graph::HPatchNode< V, E, G >::reset_alt_state_dots | ( | ) |
Sets the alt state rotamer dots to the current state rotamer dots. See comments in SIG and commit_considered_substitution for more information about why this method exists.
HPatchNode::reset_alt_state_dots
References core::pack::interaction_graph::TR_NODE().
void core::pack::interaction_graph::HPatchNode< V, E, G >::set_rotamer_dots_for_state | ( | Size | state, |
RotamerDots const & | rd | ||
) | [virtual] |
stores the coordinates for a state.
HPatchNode::set_rotamer_dots_for_state
self_and_bg_dots_for_states_ is a vector1 of RotamerDots objects. the size of the vector is set during Node construction to parent::get_num_states().
void core::pack::interaction_graph::HPatchNode< 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::chemical::ResidueType::atom_type(), core::chemical::AtomType::element(), core::chemical::ResidueType::nheavyatoms(), and core::pack::interaction_graph::TR_NODE().
Real core::pack::interaction_graph::HPatchNode< V, E, G >::update_state_for_neighbors_substitution | ( | HPatchNode< V, E, G > * | node_considering_substitution, |
RotamerDots & | neighbors_alternate_state, | ||
RotamerDotsCache const & | neighbors_curr_state_overlap_with_this, | ||
RotamerDotsCache & | this_overlap_with_neighbors_alternate, | ||
RotamerDotsCache & | neighbors_alternate_overlap_with_this, | ||
utility::vector1< utility::vector1< bool > > & | atom_atom_overlaps_cache | ||
) |
returns the change in sasa for this node induced by a state substitution at a neighboring node. The node increments the dot coverage count for the RotamerDots object representing the alternate state dots for that neighbor.
HPatchNode< V, E, G >::update_state_for_neighbors_substitution
alt_state_rotamer_dots_ = current_state_rotamer_dots_; //copy dot coverage counts alt_state_rotamer_dots_.decrement( neighbors_curr_state_overlap_with_this ); alt_state_rotamer_dots_.increment_both( neighbors_alternate_state ); return ( alt_state_rotamer_dots_.get_score() - current_state_rotamer_dots_.get_score() );
Extensive caching techniques save time. Each HPatchEdge stores the dot coverage for each pair of HPatchNodes in their current state. These are stored in the RotamerDotsCache objects. Let's name the vertices: this vertex is vertex B. Vertex B is projecting its hpatch deltaE while vertex A is considering a substitution from one state to another. The edge connecting A and B provides node B with the set of masks for the overlap by the atoms of A's alternate state on all atoms of vertex B.
neighbors_alternate_state | - [in/out] - the RotamerDots object representing the alternate state vertex A (the neighbor) is considering. neighbors_curr_state_overlap_with_this - [in] - the RotamerDotsCache object held by the HPatchEdge connecting A and B that represents the coverage of A's current state of B's atoms. this_overlap_with_neighbors_alternate - [out] - the dot cache to store the results of computing the overlap of B's current state on A's alt state neighbors_alternate_overlap_with_this - [out] - the dot cache to store the results of computing the overlap of A's alt state on B's current state mask_this_covered_by_other - [in/out] - starting set of overlaps mask_other_covered_by_this - [in/out] - starting set of overlaps num_atoms_same - [in] - the number of atoms shared between A's current and alternate states. |
What do we do when the current state is unassigned. Then that results in the alt_state starting from being unassigned and we get problems because the RotamerDots object doesn't have any memory assigned to it if it's in the unassigned state.
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_;
References core::pack::interaction_graph::TR_NODE().
conformation::Residue const& core::pack::interaction_graph::HPatchNode< V, E, G >::wt_residue_for_node | ( | ) | const [inline] |
int core::pack::interaction_graph::HPatchNode< V, E, G >::wt_seqpos_for_node | ( | ) | const [inline] |