vg
tools for working with variation graphs
|
#include <traversal_finder.hpp>
Public Member Functions | |
FlowTraversalFinder (const HandleGraph &graph, SnarlManager &snarl_manager, 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) |
virtual pair< vector< SnarlTraversal >, vector< double > > | find_weighted_traversals (const Snarl &site, 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 |
virtual vector< Traversal > | find_traversals (const handle_t &snarl_start, const handle_t &snarl_end) |
Protected Attributes | |
const HandleGraph & | graph |
SnarlManager & | snarl_manager |
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, |
SnarlManager & | snarl_manager, | ||
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 |
Return the K widest (most flow) traversals through the site The reference traversal will be returned first (regardless of its flow). After, the traversals are listed in decreasing order
Implements vg::TraversalFinder.
|
virtual |
Return the K widest traversals, along with their flows
void vg::FlowTraversalFinder::setK | ( | size_t | k | ) |
Set K.
|
protected |
|
protected |
|
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.
|
protected |