vg
tools for working with variation graphs
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
vg::NestedTraversalFinder Class Reference

#include <nested_traversal_finder.hpp>

Inheritance diagram for vg::NestedTraversalFinder:
vg::TraversalFinder

Public Member Functions

 NestedTraversalFinder (SupportAugmentedGraph &augmented, SnarlManager &snarl_manager)
 
virtual ~NestedTraversalFinder ()=default
 
virtual vector< SnarlTraversalfind_traversals (const Snarl &site)
 
- Public Member Functions inherited from vg::TraversalFinder
virtual ~TraversalFinder ()=default
 
virtual vector< Traversalfind_traversals (const handle_t &snarl_start, const handle_t &snarl_end)
 

Public Attributes

bool verbose = false
 Should we emit verbose debugging info? More...
 

Protected Member Functions

pair< Support, vector< Visit > > find_bubble (Node *node, Edge *edge, const Snarl *child, const Snarl &site)
 
Support min_support_in_path (const vector< Visit > &path)
 
set< pair< size_t, list< Visit > > > search_left (const Visit &root, const Snarl &site)
 
set< pair< size_t, list< Visit > > > search_right (const Visit &root, const Snarl &site)
 
size_t bp_length (const list< Visit > &path)
 

Protected Attributes

SupportAugmentedGraphaugmented
 The annotated, augmented graph we're finding traversals in. More...
 
SnarlManagersnarl_manager
 The SnarlManager managiung the snarls we use. More...
 

Detailed Description

This TraversalFinder emits at least one traversal representing every node, edge, or child Snarl. Only works on ultrabubbles, and so does not handle cycles.

Constructor & Destructor Documentation

◆ NestedTraversalFinder()

vg::NestedTraversalFinder::NestedTraversalFinder ( SupportAugmentedGraph augmented,
SnarlManager snarl_manager 
)

◆ ~NestedTraversalFinder()

virtual vg::NestedTraversalFinder::~NestedTraversalFinder ( )
virtualdefault

Member Function Documentation

◆ bp_length()

size_t vg::NestedTraversalFinder::bp_length ( const list< Visit > &  path)
protected

Get the length of a path through nodes and child sites, in base pairs. Ignores any bases inside child sites.

◆ find_bubble()

pair< Support, vector< Visit > > vg::NestedTraversalFinder::find_bubble ( Node node,
Edge edge,
const Snarl child,
const Snarl site 
)
protected

Given an edge or node or child snarl in the augmented graph, look out from the edge or node or child in both directions to find a shortest bubble connecting the start and end of the given site.

Exactly one of edge and node and child must be non-null.

Return the found traversal as a vector of Visits, including anchoring Visits to the site's start and end nodes. Also return the minimum support found on any edge or node in the bubble that is not contained within a child.

If there is no path with any support, returns a zero Support and a possibly empty Path.

◆ find_traversals()

vector< SnarlTraversal > vg::NestedTraversalFinder::find_traversals ( const Snarl site)
virtual

Find traversals to cover the nodes, edges, and children of the snarl. Always emits the primary path traversal first, if applicable.

Implements vg::TraversalFinder.

◆ min_support_in_path()

Support vg::NestedTraversalFinder::min_support_in_path ( const vector< Visit > &  path)
protected

Get the minimum support of all nodes and edges used in the given path that are not inside child snarls.

◆ search_left()

set< pair< size_t, list< Visit > > > vg::NestedTraversalFinder::search_left ( const Visit root,
const Snarl site 
)
protected

Do a breadth-first search left from the given node traversal, and return lengths (in visits) and paths starting at the given node and ending on the given indexed path. Refuses to visit nodes with no support.

Lengths are included so that shorter paths sort first.

◆ search_right()

set< pair< size_t, list< Visit > > > vg::NestedTraversalFinder::search_right ( const Visit root,
const Snarl site 
)
protected

Do a breadth-first search right from the given node traversal, and return lengths (in visits) and paths starting at the given node and ending on the given indexed path.

Lengths are included so that shorter paths sort first.

Member Data Documentation

◆ augmented

SupportAugmentedGraph& vg::NestedTraversalFinder::augmented
protected

The annotated, augmented graph we're finding traversals in.

◆ snarl_manager

SnarlManager& vg::NestedTraversalFinder::snarl_manager
protected

The SnarlManager managiung the snarls we use.

◆ verbose

bool vg::NestedTraversalFinder::verbose = false

Should we emit verbose debugging info?


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