vg
tools for working with variation graphs
|
#include <buildable_snarl_decomposition.hpp>
Public Types | |
using | decomposition_source_t = std::function< void(const std::function< void(const handle_t &)> &begin_chain, const std::function< void(const handle_t &)> &end_chain, const std::function< void(const handle_t &)> &begin_snarl, const std::function< void(const handle_t &)> &end_snarl)> |
Public Types inherited from handlegraph::SnarlDecomposition | |
enum | endpoint_t { START, END, TIP } |
Public Member Functions | |
virtual | ~BuildableSnarlDecomposition ()=default |
virtual void | build_snarl_decomposition (const decomposition_source_t &traverse_decomposition)=0 |
Public Member Functions inherited from handlegraph::SnarlDecomposition | |
virtual | ~SnarlDecomposition ()=default |
virtual net_handle_t | get_root () const =0 |
virtual bool | is_root (const net_handle_t &net) const =0 |
virtual bool | is_snarl (const net_handle_t &net) const =0 |
virtual bool | is_chain (const net_handle_t &net) const =0 |
virtual bool | is_node (const net_handle_t &net) const =0 |
virtual bool | is_sentinel (const net_handle_t &net) const =0 |
virtual net_handle_t | get_net (const handle_t &handle, const HandleGraph *graph) const =0 |
virtual handle_t | get_handle (const net_handle_t &net, const HandleGraph *graph) const =0 |
virtual net_handle_t | get_parent (const net_handle_t &child) const =0 |
virtual net_handle_t | get_bound (const net_handle_t &snarl, bool get_end, bool face_in) const =0 |
virtual net_handle_t | flip (const net_handle_t &net) const =0 |
virtual net_handle_t | canonical (const net_handle_t &net) const =0 |
virtual endpoint_t | starts_at (const net_handle_t &traversal) const =0 |
virtual endpoint_t | ends_at (const net_handle_t &traversal) const =0 |
template<typename Iteratee > | |
bool | for_each_child (const net_handle_t &parent, const Iteratee &iteratee) const |
template<typename Iteratee > | |
bool | for_each_traversal (const net_handle_t &item, const Iteratee &iteratee) const |
template<typename Iteratee > | |
bool | follow_net_edges (const net_handle_t &here, const HandleGraph *graph, bool go_left, const Iteratee &iteratee) const |
template<typename Iteratee > | |
bool | for_each_tippy_child (const net_handle_t &parent, const Iteratee &iteratee) const |
virtual net_handle_t | get_parent_traversal (const net_handle_t &traversal_start, const net_handle_t &traversal_end) const =0 |
template<typename Iteratee > | |
bool | for_each_traversal_start (const net_handle_t &traversal, const Iteratee &) const |
template<typename Iteratee > | |
bool | for_each_traversal_end (const net_handle_t &traversal, const Iteratee &) const |
net_handle_t | get_start_bound (const net_handle_t &parent) const |
net_handle_t | get_end_bound (const net_handle_t &parent) const |
bool | starts_at_start (const net_handle_t &net) const |
bool | starts_at_end (const net_handle_t &net) const |
bool | starts_at_tip (const net_handle_t &net) const |
bool | ends_at_start (const net_handle_t &net) const |
bool | ends_at_end (const net_handle_t &net) const |
bool | ends_at_tip (const net_handle_t &net) const |
Additional Inherited Members | |
Protected Member Functions inherited from handlegraph::SnarlDecomposition | |
virtual bool | for_each_child_impl (const net_handle_t &traversal, const std::function< bool(const net_handle_t &)> &iteratee) const =0 |
virtual bool | for_each_traversal_impl (const net_handle_t &item, const std::function< bool(const net_handle_t &)> &iteratee) const =0 |
virtual bool | follow_net_edges_impl (const net_handle_t &here, const HandleGraph *graph, bool go_left, const std::function< bool(const net_handle_t &)> &iteratee) const =0 |
virtual bool | for_each_tippy_child_impl (const net_handle_t &parent, const std::function< bool(const net_handle_t &)> &iteratee) const |
virtual bool | for_each_traversal_start_impl (const net_handle_t &traversal, const std::function< bool(const net_handle_t &)> &iteratee) const |
virtual bool | for_each_traversal_end_impl (const net_handle_t &traversal, const std::function< bool(const net_handle_t &)> &iteratee) const |
using handlegraph::BuildableSnarlDecomposition::decomposition_source_t = std::function<void(const std::function<void(const handle_t&)>& begin_chain, const std::function<void(const handle_t&)>& end_chain, const std::function<void(const handle_t&)>& begin_snarl, const std::function<void(const handle_t&)>& end_snarl)> |
Represents a source of snarl decomposition information.
A matching function will call begin_chain and end_chain, and begin_snarl and end_snarl, for each chain and snarl in the snarl decomposition, accroding to the nesting structure of the decomposition.
The decomposition is implicitly rooted at the root snarl, so the series of calls will begin with a chain, if the graph is nonempty.
Calls will be made for empty snarls, and for trivial chains of single nodes.
Trivial chains and circular chains are distinguished by circular chains having contents.
|
virtualdefault |
|
pure virtual |
Calls the given decomposition-traversing function, and gives it callbacks which it can call to enter and exit chains and snarls.
Will fill in this SnarlDecomposition with the snarls that are produced.
The SnarlDecomposition will need to know connectivity through snarls and chains, and whether tip-to-tip traversals are realizable, so it will be difficult to implement this method without having access at the class level to the backing HandleGraph. To facilitate computing connectivity, it may be wise to guarantee that connectivity queries will work for all snarls and chains that have already been closed, while this function is running.
There is no built-in parallel construction. The decomposition source can compute the stream of begin and end calls in parallel and then linearize it.