Rosetta
|
The BuriedUnsatPenaltyGraph consists of nodes representing resiudues (or rotamers in packing mode) and edges representing hydrogen-bonding interactions. Each node stores a list of hydrogen bond donor and acceptor atoms that we're seeking to satisfy; each edge stores the donors and acceptors that are connected by hydrogen bonds when two residues (or rotamers) interact. More...
#include <BuriedUnsatPenaltyGraph.hh>
Public Types | |
typedef utility::graph::Graph | parent |
Public Member Functions | |
BuriedUnsatPenaltyGraph ()=delete | |
Default constructor – explicitly deleted. More... | |
BuriedUnsatPenaltyGraph (BuriedUnsatPenaltyGraphOptionsCOP options, core::scoring::hbonds::HBondOptionsCOP hbond_options) | |
Options constructor. More... | |
BuriedUnsatPenaltyGraph (platform::Size const num_nodes, BuriedUnsatPenaltyGraphOptionsCOP options, core::scoring::hbonds::HBondOptionsCOP hbond_options) | |
Nodecount constructor with options. More... | |
BuriedUnsatPenaltyGraph (BuriedUnsatPenaltyGraph const &src) | |
Copy constructor. More... | |
~BuriedUnsatPenaltyGraph () override | |
Destructor. More... | |
void | delete_edge (utility::graph::Edge *edge) override |
Needed override from base class. More... | |
void | delete_node (utility::graph::Node *node) override |
Needed override from base class. More... | |
void | set_always_rotamer_one (bool const setting) |
Set whether this is a graph that just stores one rotamer per position. More... | |
void | provide_pymol_commands_to_show_groups (std::ostream &out, core::pose::Pose const &pose) const |
Provide Pymol commands to colour the pose grey, non-buried donor and acceptor groups cyan, and buried acceptor and donor groups orange. Useful for debugging degree of burial. More... | |
void | initialize_graph_for_scoring (core::pose::Pose const &pose) |
Initialize a BuriedUnsatPenaltyGraph from a pose, for scoring. More... | |
void | initialize_graph_for_packing (core::pose::Pose const &pose, core::pack::rotamer_set::RotamerSets const &rotamersets, bool const only_scoring=false, bool const prevent_pruning=false) |
Initialize a BuriedUnsatPenaltyGraph from a pose and a residue set, for packing. More... | |
void | compute_unsats_all_nodes () |
Given this BuriedUnsatPenaltyGraph with some number of nodes, iterate through each node and update the internally-stored counts for unsats and oversats based on the edges connected to that node. More... | |
void | compute_unsats_changed_nodes (utility::vector1< core::Size > const &changed_node_indices, utility::vector1< core::Size > const &changed_node_partners) |
Given two lists (one of changed nodes, one of their partners), update the internally-stored counts for unsats and oversats for those nodes only. More... | |
void | compute_unsats_for_node (core::Size const node_index) |
Given this BuriedUnsatPenaltyGraph with some number of nodes and the index of a node, update the internally-stored counts for unsats and oversats based on the edges connected to that node. More... | |
void | copy_node_and_connected_edges (core::Size const node_index_in_this_graph, BuriedUnsatPenaltyGraph const &other_graph, core::Size const node_index_in_other_graph) |
Given an index of a node in this graph, an owning pointer to another graph, and a node index in the other graph, copy the node from the other graph to the node in this graph, flush the edges that were connected to the node in this graph, and copy those edges from the other graph that can be connected to nodes in this graph. More... | |
core::Size | get_node_index (core::Size const seqpos, core::Size const rotamer_index) const |
Given the sequence position and rotamer index of a residue, get the corresponding node index. More... | |
bool | has_node_corresponding_to_residue (core::conformation::ResidueCOP residue) const |
Given a const owning pointer to a residue, determine whether a corresponding node exists. More... | |
core::Size | get_node_index (core::conformation::ResidueCOP residue) const |
Given a const owning pointer to a residue, get the corresponding node index. More... | |
core::conformation::ResidueCOP | nodeindex_to_residue_memory_address (core::Size const nodeindex) const |
Get the memory address of the residue corresponding to a particular node. More... | |
Static Public Member Functions | |
static void | configure_hbond_options (core::scoring::hbonds::HBondOptions &hbondoptions) |
Set up options for hbond detection. More... | |
Protected Member Functions | |
utility::graph::Node * | create_new_node (platform::Size node_index) override |
Factory method for node creation, defined by derived graph classes, called by the base class. More... | |
utility::graph::Edge * | create_new_edge (platform::Size index1, platform::Size index2) override |
Factory method for edge creation, defined by derived graph classes, called by the base class. More... | |
utility::graph::Edge * | create_new_edge (utility::graph::Edge const *example_edge) override |
This is also needed for edge creation, when copying graphs. More... | |
Private Member Functions | |
BuriedUnsatPenaltyEdge * | add_edge (core::Size const seqpos1, core::Size const rotamer_index1, core::Size const seqpos2, core::Size const rotamer_index2) |
Add an edge, representing an interresidue hydrogen bonded interaction (consisting of one or more interresidue hydrogen bonds), to the graph. More... | |
BuriedUnsatPenaltyEdge * | add_edge (core::Size const node_index1, core::Size const node_index2, BuriedUnsatPenaltyEdge const &other_edge) |
Add an edge, representing an interresidue hydrogen bonded interaction (consisting of one or more interresidue hydrogen bonds), to the graph. More... | |
bool | get_edge_exists (core::Size const seqpos1, core::Size const rotamer_index1, core::Size const seqpos2, core::Size const rotamer_index2) const |
Determine whether an edge exists in the graph, by seqpos and rotamer index. More... | |
BuriedUnsatPenaltyEdge * | find_edge (core::Size const seqpos1, core::Size const rotamer_index1, core::Size const seqpos2, core::Size const rotamer_index2) |
Retrieve an edge by seqpos and rotamer index. More... | |
BuriedUnsatPenaltyEdge const * | find_edge (core::Size const seqpos1, core::Size const rotamer_index1, core::Size const seqpos2, core::Size const rotamer_index2) const |
Retrieve an edge by seqpos and rotamer index. More... | |
void | initialize_node (core::Size const node_index, core::Size const residue_position, core::Size const rotamer_index, core::conformation::ResidueCOP residue, core::pose::Pose const &pose, core::scoring::hbonds::HBondDatabase const &hb_data, bool const is_symmetric) |
Initialize a node to represent a given residue position and rotamer index, and store in it all of the relevant hydrogen bond donors and acceptors. More... | |
Private Attributes | |
bool | always_rotamer_one_ |
In some cases, the graph should only store one rotamer per position. More... | |
std::map< std::pair< core::Size, core::Size >, core::Size > | residuepos_rotamerindex_to_nodeindex_ |
A map of (residue position, rotamer index)-->(node index). More... | |
std::map< core::conformation::ResidueCOP, core::Size > | residue_memory_address_to_nodeindex_ |
A map of (Residue memory address)-->(node index). More... | |
std::map< core::Size, core::conformation::ResidueCOP > | nodeindex_to_residue_memory_address_ |
A map of (node index)-->(Residue memory address). More... | |
BuriedUnsatPenaltyGraphOptionsCOP | options_ |
A const owning pointer to an options container, containing settings for the BuriedUnsatPenaltyGraph. More... | |
core::scoring::hbonds::HBondOptionsCOP | hbond_options_ |
A const owning pointer to an options container for hydrogen bonds. More... | |
boost::unordered_object_pool< BuriedUnsatPenaltyEdge > * | bunsat_edge_pool_ |
Storage for the edges of this graph. More... | |
Friends | |
class | ::BuriedUnsatPenaltyGraphTests |
class | ::BuriedUnsatPenaltyGraphSymmetricTests |
class | ::BuriedUnsatPenaltyTests |
class | ::BuriedUnsatPenaltySymmetricTests |
The BuriedUnsatPenaltyGraph consists of nodes representing resiudues (or rotamers in packing mode) and edges representing hydrogen-bonding interactions. Each node stores a list of hydrogen bond donor and acceptor atoms that we're seeking to satisfy; each edge stores the donors and acceptors that are connected by hydrogen bonds when two residues (or rotamers) interact.
typedef utility::graph::Graph core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraph::parent |
|
delete |
Default constructor – explicitly deleted.
core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraph::BuriedUnsatPenaltyGraph | ( | BuriedUnsatPenaltyGraphOptionsCOP | options, |
core::scoring::hbonds::HBondOptionsCOP | hbond_options | ||
) |
Options constructor.
Note: this stores the owning pointer to the options; it doesn't clone them. The hbond options are cloned and modified, though.
References configure_hbond_options(), hbond_options_, and core::pack::guidance_scoreterms::buried_unsat_penalty::TR().
core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraph::BuriedUnsatPenaltyGraph | ( | platform::Size const | num_nodes, |
BuriedUnsatPenaltyGraphOptionsCOP | options, | ||
core::scoring::hbonds::HBondOptionsCOP | hbond_options | ||
) |
Nodecount constructor with options.
Note: this stores the owning pointer to the options; it doesn't clone them. The hbond options are cloned and modified, though.
References configure_hbond_options(), hbond_options_, and core::pack::guidance_scoreterms::buried_unsat_penalty::TR().
core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraph::BuriedUnsatPenaltyGraph | ( | BuriedUnsatPenaltyGraph const & | src | ) |
Copy constructor.
|
override |
Destructor.
References bunsat_edge_pool_.
|
private |
Add an edge, representing an interresidue hydrogen bonded interaction (consisting of one or more interresidue hydrogen bonds), to the graph.
Returns a pointer to the newly-created edge. This version copies an edge from another graph.
References core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyEdge::copy_from().
|
private |
Add an edge, representing an interresidue hydrogen bonded interaction (consisting of one or more interresidue hydrogen bonds), to the graph.
Returns a pointer to the newly-created edge.
References get_node_index().
Referenced by copy_node_and_connected_edges(), and initialize_graph_for_packing().
void core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraph::compute_unsats_all_nodes | ( | ) |
Given this BuriedUnsatPenaltyGraph with some number of nodes, iterate through each node and update the internally-stored counts for unsats and oversats based on the edges connected to that node.
Calls compute_unsats_for_node().
Calls compute_unsats_for_node();
References compute_unsats_for_node().
void core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraph::compute_unsats_changed_nodes | ( | utility::vector1< core::Size > const & | changed_node_indices, |
utility::vector1< core::Size > const & | changed_node_partners | ||
) |
Given two lists (one of changed nodes, one of their partners), update the internally-stored counts for unsats and oversats for those nodes only.
calls compute_unsats_for_node().
References compute_unsats_for_node().
void core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraph::compute_unsats_for_node | ( | core::Size const | node_index | ) |
Given this BuriedUnsatPenaltyGraph with some number of nodes and the index of a node, update the internally-stored counts for unsats and oversats based on the edges connected to that node.
References core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraphHbond::acceptor_group(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraphHbond::acceptor_symmetry_copy_index(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyNode::clear_hbond_counts(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyNode::donor_acceptor_group(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraphHbond::donor_group(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraphHbond::donor_symmetry_copy_index(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraphHbond::first_node_is_the_acceptor(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyEdge::hbond(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyNode::increment_accepted_hbond_count_for_group(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyNode::increment_donated_hbond_count_for_group(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraphHbondDonorAcceptorGroup::is_counted(), and core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyEdge::n_hbonds().
Referenced by compute_unsats_all_nodes(), and compute_unsats_changed_nodes().
|
static |
Set up options for hbond detection.
References core::scoring::hbonds::HBondOptions::bb_donor_acceptor_check(), core::scoring::hbonds::HBondOptions::exclude_DNA_DNA(), core::scoring::hbonds::HBondOptions::exclude_intra_res_protein(), core::scoring::hbonds::HBondOptions::exclude_intra_res_RNA(), core::scoring::hbonds::HBondOptions::exclude_self_hbonds(), core::scoring::hbonds::HBondOptions::smooth_hb_env_dep(), core::scoring::hbonds::HBondOptions::use_hb_env_dep(), and core::scoring::hbonds::HBondOptions::use_hb_env_dep_DNA().
Referenced by BuriedUnsatPenaltyGraph().
void core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraph::copy_node_and_connected_edges | ( | core::Size const | node_index_in_this_graph, |
BuriedUnsatPenaltyGraph const & | other_graph, | ||
core::Size const | node_index_in_other_graph | ||
) |
Given an index of a node in this graph, an owning pointer to another graph, and a node index in the other graph, copy the node from the other graph to the node in this graph, flush the edges that were connected to the node in this graph, and copy those edges from the other graph that can be connected to nodes in this graph.
Note that the logic for determining whether an edge from the other graph can be related to this graph is based on ResidueCOPs.
References add_edge(), always_rotamer_one_, core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyNode::copy_from(), nodeindex_to_residue_memory_address(), nodeindex_to_residue_memory_address_, residue_memory_address_to_nodeindex_, core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyNode::residue_position(), residuepos_rotamerindex_to_nodeindex_, and core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyNode::rotamer_index().
|
overrideprotected |
Factory method for edge creation, defined by derived graph classes, called by the base class.
factory method for edge creation, defined by derived graph classes, called by the base class
References bunsat_edge_pool_.
|
overrideprotected |
This is also needed for edge creation, when copying graphs.
References bunsat_edge_pool_.
|
overrideprotected |
Factory method for node creation, defined by derived graph classes, called by the base class.
factory method for node creation, defined by derived graph classes, called by the base class
|
override |
Needed override from base class.
References bunsat_edge_pool_.
|
override |
Needed override from base class.
|
private |
Retrieve an edge by seqpos and rotamer index.
Nonconst version.
References get_node_index().
Referenced by initialize_graph_for_packing().
|
private |
|
private |
Determine whether an edge exists in the graph, by seqpos and rotamer index.
References get_node_index().
Referenced by initialize_graph_for_packing().
|
inline |
Given a const owning pointer to a residue, get the corresponding node index.
Will throw an error if the owning pointer corresponds to no node in this object.
References residue_memory_address_to_nodeindex_.
|
inline |
Given the sequence position and rotamer index of a residue, get the corresponding node index.
References always_rotamer_one_, and residuepos_rotamerindex_to_nodeindex_.
Referenced by add_edge(), core::pack::guidance_scoreterms::buried_unsat_penalty::BuriedUnsatPenalty::calculate_penalty_once_almost_from_scratch_using_reference_graph(), find_edge(), get_edge_exists(), initialize_graph_for_packing(), and provide_pymol_commands_to_show_groups().
|
inline |
Given a const owning pointer to a residue, determine whether a corresponding node exists.
References residue_memory_address_to_nodeindex_.
Referenced by provide_pymol_commands_to_show_groups().
void core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraph::initialize_graph_for_packing | ( | core::pose::Pose const & | pose, |
core::pack::rotamer_set::RotamerSets const & | rotamersets, | ||
bool const | only_scoring = false , |
||
bool const | prevent_pruning = false |
||
) |
Initialize a BuriedUnsatPenaltyGraph from a pose and a residue set, for packing.
If prevent_pruning is true, then we DISABLE pruning of groups that are not packable and not able to hydrogen bond to packable residues.
References core::scoring::hbonds::HBond::acc_atm(), core::scoring::hbonds::HBond::acc_res(), add_edge(), core::chemical::ICoorAtomID::atomno(), core::pose::Pose::conformation(), core::pose::Pose::conformation_ptr(), core::scoring::hbonds::HBond::don_hatm(), core::scoring::hbonds::HBond::don_res(), core::scoring::hbonds::HBond::energy(), find_edge(), core::scoring::hbonds::HBondDatabase::get_database(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyNode::get_donor_acceptor_group_from_heavyatom_index(), get_edge_exists(), get_node_index(), core::pack::rotamer_set::RotamerSets::has_rotamer_set_for_residue(), core::scoring::hbonds::HBondSet::hbond(), hbond_options_, core::conformation::Residue::icoor(), initialize_node(), core::conformation::symmetry::is_symmetric(), core::pose::symmetry::is_symmetric(), protocols::mean_field::max(), protocols::mean_field::min(), core::conformation::Residue::nbr_atom_xyz(), core::conformation::Residue::nbr_radius(), core::scoring::hbonds::HBondSet::nhbonds(), core::pack::rotamer_set::RotamerSet::num_rotamers(), options_, core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyNode::prune_donor_acceptor_groups_lacking_hbonds_to_packable(), core::pose::Pose::residue(), core::conformation::Conformation::residue_cop(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyNode::residue_position(), core::pack::rotamer_set::RotamerSet::rotamer(), core::pack::rotamer_set::RotamerSets::rotamer_set_for_residue(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyEdge::set_edge_data(), core::chemical::AtomICoor::stub_atom1(), core::pose::Pose::total_residue(), and core::pack::guidance_scoreterms::buried_unsat_penalty::TR().
Referenced by initialize_graph_for_scoring().
void core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraph::initialize_graph_for_scoring | ( | core::pose::Pose const & | pose | ) |
Initialize a BuriedUnsatPenaltyGraph from a pose, for scoring.
References initialize_graph_for_packing().
|
private |
Initialize a node to represent a given residue position and rotamer index, and store in it all of the relevant hydrogen bond donors and acceptors.
[in] | node_index | The index of the node to initialize. |
[in] | residue_position | The index of the residue that this node represents in the pose. |
[in] | rotamer_index | The index of the rotamer for this residue that this node represents. |
[in] | residue | The residue object itself, for extracting hbond donor/acceptor information. |
[in] | pose | The pose, for context. |
[in] | hb_data | The hydrogen bonding database object. |
[in] | is_symmetric | Is this a symmetric pose? (We figure this out once and only once, to avoid repeated dynamic_casts.) |
References always_rotamer_one_, core::pose::Pose::conformation_ptr(), hbond_options_, core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyNode::initialize_node(), core::conformation::symmetry::is_symmetric(), nodeindex_to_residue_memory_address_, options_, residue_memory_address_to_nodeindex_, residuepos_rotamerindex_to_nodeindex_, and core::pose::Pose::total_residue().
Referenced by initialize_graph_for_packing().
|
inline |
Get the memory address of the residue corresponding to a particular node.
References nodeindex_to_residue_memory_address_.
Referenced by copy_node_and_connected_edges().
void core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraph::provide_pymol_commands_to_show_groups | ( | std::ostream & | out, |
core::pose::Pose const & | pose | ||
) | const |
Provide Pymol commands to colour the pose grey, non-buried donor and acceptor groups cyan, and buried acceptor and donor groups orange. Useful for debugging degree of burial.
To use, pass in a pose. If this graph contains residues corresponding to those in the pose, commands for colouring them will be written out.
References core::pose::Pose::conformation(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyNode::donor_acceptor_group(), get_node_index(), has_node_corresponding_to_residue(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraphHbondDonorAcceptorGroup::heavyatom_index(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraphHbondDonorAcceptorGroup::is_counted(), core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyNode::num_donor_acceptor_groups(), core::conformation::membrane::out, core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraphHbondDonorAcceptorGroup::proton_indices(), core::conformation::Conformation::residue_cop(), and core::pose::Pose::total_residue().
void core::pack::guidance_scoreterms::buried_unsat_penalty::graph::BuriedUnsatPenaltyGraph::set_always_rotamer_one | ( | bool const | setting | ) |
Set whether this is a graph that just stores one rotamer per position.
References always_rotamer_one_.
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
In some cases, the graph should only store one rotamer per position.
Referenced by copy_node_and_connected_edges(), get_node_index(), initialize_node(), and set_always_rotamer_one().
|
private |
Storage for the edges of this graph.
The Graph base class is weird and nasty. If your derived edge class differs from the base edge class, the Graph base clas fails to manage the edges correctly on destruction, and this creates a memory leak. The workaround is to manage edges yourself in the derived Graph class, which is silly.
Referenced by create_new_edge(), delete_edge(), and ~BuriedUnsatPenaltyGraph().
|
private |
A const owning pointer to an options container for hydrogen bonds.
Referenced by BuriedUnsatPenaltyGraph(), initialize_graph_for_packing(), and initialize_node().
|
private |
A map of (node index)-->(Residue memory address).
Referenced by copy_node_and_connected_edges(), initialize_node(), and nodeindex_to_residue_memory_address().
|
private |
A const owning pointer to an options container, containing settings for the BuriedUnsatPenaltyGraph.
Referenced by initialize_graph_for_packing(), and initialize_node().
|
private |
A map of (Residue memory address)-->(node index).
Referenced by copy_node_and_connected_edges(), get_node_index(), has_node_corresponding_to_residue(), and initialize_node().
|
private |
A map of (residue position, rotamer index)-->(node index).
Referenced by copy_node_and_connected_edges(), get_node_index(), and initialize_node().