|
vg
tools for working with variation graphs
|
Public Member Functions | |
| NodeDirectory (const SnarlManager &manager, const HandleGraph &graph) | |
| std::optional< ChainPosition > | chain_position (nid_t id) const |
| const Snarl * | containing_snarl (nid_t id) const |
| const std::vector< nid_t > & | free_nodes (const Snarl *snarl) const |
Private Attributes | |
| const SnarlManager & | manager |
| The manager whose snarl tree the nodes sit in. More... | |
| std::unordered_map< nid_t, const Snarl * > | free_node_snarls |
| std::unordered_map< const Snarl *, std::vector< nid_t > > | free_nodes_by_snarl |
A directory of where each node of a graph sits in the snarl tree.
The directory finds chain nodes through the manager's index of the snarls each node side leads into, and lists the free nodes itself.
| vg::SnarlManagerDecomposition::NodeDirectory::NodeDirectory | ( | const SnarlManager & | manager, |
| const HandleGraph & | graph | ||
| ) |
Find the free nodes of a graph in a manager's snarl tree.
The directory keeps a reference to the manager, so it must outlive the directory.
| optional< SnarlManagerDecomposition::ChainPosition > vg::SnarlManagerDecomposition::NodeDirectory::chain_position | ( | nid_t | id | ) | const |
Get the place of a node in its chain, or nullopt for a free node, in constant time.
Get the snarl that directly contains a node, or null for the root.
| const vector< nid_t > & vg::SnarlManagerDecomposition::NodeDirectory::free_nodes | ( | const Snarl * | snarl | ) | const |
Get the free nodes in a snarl, or in the root if given null, in ID order.
|
private |
The snarl that directly contains each free node, or null for the root.
|
private |
The free nodes in each snarl that has any, and in the root under null. Each list is in ID order.
|
private |
The manager whose snarl tree the nodes sit in.
1.9.1