vg
tools for working with variation graphs
Classes | Public Member Functions | Private Member Functions | List of all members
vg::IntegratedSnarlFinder Class Reference

#include <integrated_snarl_finder.hpp>

Inheritance diagram for vg::IntegratedSnarlFinder:
vg::HandleGraphSnarlFinder vg::SnarlFinder

Classes

class  MergedAdjacencyGraph
 

Public Member Functions

 IntegratedSnarlFinder (const HandleGraph &graph)
 
virtual SnarlManager find_snarls_parallel ()
 
void traverse_decomposition (const function< void(handle_t)> &begin_chain, const function< void(handle_t)> &end_chain, const function< void(handle_t)> &begin_snarl, const function< void(handle_t)> &end_snarl) const
 
- Public Member Functions inherited from vg::HandleGraphSnarlFinder
 HandleGraphSnarlFinder (const HandleGraph *graph)
 
virtual ~HandleGraphSnarlFinder ()=default
 
virtual SnarlManager find_snarls ()
 
- Public Member Functions inherited from vg::SnarlFinder
virtual ~SnarlFinder ()=default
 

Private Member Functions

void traverse_computed_decomposition (MergedAdjacencyGraph &cactus, const MergedAdjacencyGraph &forest, vector< pair< size_t, vector< handle_t >>> &longest_paths, unordered_map< handle_t, handle_t > &towards_deepest_leaf, vector< pair< size_t, handle_t >> &longest_cycles, unordered_map< handle_t, handle_t > &next_along_cycle, const function< void(handle_t)> &begin_chain, const function< void(handle_t)> &end_chain, const function< void(handle_t)> &begin_snarl, const function< void(handle_t)> &end_snarl) const
 

Additional Inherited Members

- Protected Member Functions inherited from vg::HandleGraphSnarlFinder
virtual SnarlManager find_snarls_unindexed ()
 
- Protected Attributes inherited from vg::HandleGraphSnarlFinder
const HandleGraphgraph
 

Detailed Description

Class for finding all snarls using an integrated Cactus graph construction algorithm.

Does not produce any unary snarls. May leave edges in the root snarl, at the ends of top-level chains.

Does not (yet) use paths for rooting. Roots the decomposition at the simple cycle or bridge tree path with the most bases of fixed sequence.

Constructor & Destructor Documentation

◆ IntegratedSnarlFinder()

vg::IntegratedSnarlFinder::IntegratedSnarlFinder ( const HandleGraph graph)

Make a new IntegratedSnarlFinder to find snarls in the given graph.

Member Function Documentation

◆ find_snarls_parallel()

SnarlManager vg::IntegratedSnarlFinder::find_snarls_parallel ( )
virtual

Find all the snarls of weakly connected components in parallel.

Reimplemented from vg::SnarlFinder.

◆ traverse_computed_decomposition()

void vg::IntegratedSnarlFinder::traverse_computed_decomposition ( MergedAdjacencyGraph cactus,
const MergedAdjacencyGraph forest,
vector< pair< size_t, vector< handle_t >>> &  longest_paths,
unordered_map< handle_t, handle_t > &  towards_deepest_leaf,
vector< pair< size_t, handle_t >> &  longest_cycles,
unordered_map< handle_t, handle_t > &  next_along_cycle,
const function< void(handle_t)> &  begin_chain,
const function< void(handle_t)> &  end_chain,
const function< void(handle_t)> &  begin_snarl,
const function< void(handle_t)> &  end_snarl 
) const
private

Find all the snarls, given the Cactus graph, the bridge forest, the longest paths and cycles, and the towards-leaf/around-cycle information needed to follow them.

◆ traverse_decomposition()

void vg::IntegratedSnarlFinder::traverse_decomposition ( const function< void(handle_t)> &  begin_chain,
const function< void(handle_t)> &  end_chain,
const function< void(handle_t)> &  begin_snarl,
const function< void(handle_t)> &  end_snarl 
) const
virtual

Visit all snarls and chains, including trivial snarls and single-node empty chains.

Calls begin_chain and end_chain when entrering and exiting chains in the traversal. Within each chain, calls begin_snarl and end_snarl when entering and exiting each snarl, in order. The caller is intended to maintain its own stack to match up begin and end events.

Each begin/end call receives the handle reading into/out of the snarl or chain.

Both empty and cyclic chains have the in and out handles the same. They are distinguished by context; empty chains have no shild snarls, while cyclic chains do.

Roots the decomposition at a global snarl with no bounding nodes, for which begin_snarl is not called. So the first call will be begin_chain.

Start handles are inward facing and end handles are outward facing. Snarls must be oriented forward in their chains.

Implements vg::HandleGraphSnarlFinder.


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