|
vg
tools for working with variation graphs
|
#include <traversal_finder.hpp>
Public Member Functions | |
| FlowTraversalFinder (const HandleGraph &graph, size_t K, function< double(handle_t)> node_weight_callback, function< double(edge_t)> edge_weight_callback, size_t max_traversal_length=numeric_limits< size_t >::max()) | |
| virtual vector< SnarlTraversal > | find_traversals (const Snarl &site) |
| vector< Traversal > | find_traversals (const handle_t &snarl_start, const handle_t &snarl_end) override |
| virtual pair< vector< SnarlTraversal >, vector< double > > | find_weighted_traversals (const Snarl &site, bool greedy_avg=false, const HandleGraph *overlay=nullptr) |
| virtual pair< vector< Traversal >, vector< double > > | find_weighted_traversals (const handle_t &snarl_start, const handle_t &snarl_end, bool greedy_avg=false, const HandleGraph *overlay=nullptr) |
| void | setK (size_t k) |
| Set K. More... | |
Public Member Functions inherited from vg::TraversalFinder | |
| virtual | ~TraversalFinder ()=default |
Public Member Functions inherited from vg::SiteTraversalFinder | |
| virtual | ~SiteTraversalFinder ()=default |
Protected Attributes | |
| const HandleGraph & | graph |
| size_t | K |
| The K-best traversals are returned. More... | |
| function< double(handle_t)> | node_weight_callback |
| Callbacks to get supports. More... | |
| function< double(edge_t)> | edge_weight_callback |
| size_t | max_traversal_length |
| Call off the search as soon as a traversal of this length (bp) is encountered. More... | |
Finds traversals with the most flow. Node and edge weights are specified using the callbacks and can be used, ex, to yield read supports.
If one traversal is requested, then the path with the highest flow (whose node or edge with the minimum weight is maximum) is returned. If K traversals are specified, then the K highest flow traversals are returned. This is designed to be a replacement for RepresentativeTraversalFinder. It should do a better job of enumerating off-reference traversals, and will of course guarantee to return all the optimal traversals (in the context of max flow). Unlike RepresentativeTraversalFinder, it does not currently support nested snarls, so all traversals returned are explicit.
It is possible that it will blow up on massive snarls, espeically for large Ks.
| vg::FlowTraversalFinder::FlowTraversalFinder | ( | const HandleGraph & | graph, |
| size_t | K, | ||
| function< double(handle_t)> | node_weight_callback, | ||
| function< double(edge_t)> | edge_weight_callback, | ||
| size_t | max_traversal_length = numeric_limits<size_t>::max() |
||
| ) |
Make a finder that searches a graph for the widest traversals.
| graph | The graph to search. The finder keeps a reference to it, so it must outlive the finder. |
| K | The most traversals to find for each site. |
| node_weight_callback | A function giving the flow through a node. |
| edge_weight_callback | A function giving the flow through an edge. |
| max_traversal_length | A length in bases. When a search finds a traversal longer than this, not counting the site's bounds, it stops and returns the traversals found so far, including that one. |
|
overridevirtual |
Find the K widest traversals through the site between two bound handles.
Implements vg::SiteTraversalFinder.
|
virtual |
Find the K widest (most flow) traversals through a site.
Implements vg::TraversalFinder.
|
virtual |
Find the K widest traversals through the site between two bound handles, with their flows.
| snarl_start | The start bound of the site, oriented into the site. |
| snarl_end | The end bound of the site, oriented out of the site. |
| greedy_avg | True to search heuristically by the running average flow, which may miss the widest traversals, rather than by the smallest flow along each traversal. |
| overlay | A graph to search instead of the finder's graph, or null. If given, the bound handles must be in the overlay, and the traversals are returned as handles in it. |
|
virtual |
Find the K widest traversals through a site, with their flows.
| greedy_avg | True to search heuristically by the running average flow, which may miss the widest traversals, rather than by the smallest flow along each traversal. |
| overlay | A graph to search instead of the finder's graph, or null. |
| void vg::FlowTraversalFinder::setK | ( | size_t | k | ) |
Set K.
|
protected |
|
protected |
The graph to search, unless a search is given an overlay graph to use instead.
|
protected |
The K-best traversals are returned.
|
protected |
Call off the search as soon as a traversal of this length (bp) is encountered.
|
protected |
Callbacks to get supports.
1.9.1