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

#include <traversal_support.hpp>

Inheritance diagram for vg::CachedPackedTraversalSupportFinder:
vg::PackedTraversalSupportFinder vg::TraversalSupportFinder vg::NestedCachedPackedTraversalSupportFinder

Public Member Functions

 CachedPackedTraversalSupportFinder (const Packer &packer, SnarlManager &snarl_manager, size_t cache_size=500000)
 
virtual ~CachedPackedTraversalSupportFinder ()
 
virtual Support get_edge_support (id_t from, bool from_reverse, id_t to, bool to_reverse) const
 Support of an edge. More...
 
virtual Support get_min_node_support (id_t node) const
 Minimum support of a node. More...
 
virtual Support get_avg_node_support (id_t node) const
 Average support of a node. More...
 
virtual size_t get_avg_node_mapq (id_t node) const
 Average MAPQ of reads that map to a node. More...
 
- Public Member Functions inherited from vg::PackedTraversalSupportFinder
 PackedTraversalSupportFinder (const Packer &packer, SnarlManager &snarl_manager)
 
virtual ~PackedTraversalSupportFinder ()
 
virtual Support get_edge_support (const edge_t &edge) const
 Support of an edge. More...
 
- Public Member Functions inherited from vg::TraversalSupportFinder
 TraversalSupportFinder (const HandleGraph &graph, SnarlManager &snarl_manager)
 
virtual ~TraversalSupportFinder ()
 
virtual int64_t get_edge_length (const edge_t &edge, const unordered_map< id_t, size_t > &ref_offsets) const
 Effective length of an edge. More...
 
virtual tuple< Support, Support, int > get_child_support (const Snarl &snarl) const
 Use node or edge support as proxy for child support (as was done in original calling code) More...
 
virtual Support get_traversal_support (const SnarlTraversal &traversal) const
 
virtual vector< Supportget_traversal_genotype_support (const vector< SnarlTraversal > &traversals, const vector< int > &genotype, const set< int > &other_trav_subset, int ref_trav_idx=-1, int *max_trav_size=nullptr)
 
virtual vector< Supportget_traversal_set_support (const vector< SnarlTraversal > &traversals, const vector< int > &shared_travs, const vector< Support > &shared_support, const set< int > &tgt_travs, bool exclusive_only, const vector< int > &exclusive_count_travs, const vector< Support > &exclusive_count_support, int ref_trav_idx=-1, int *max_trav_size=nullptr) const
 
virtual vector< int > get_traversal_sizes (const vector< SnarlTraversal > &traversals) const
 Get the total length of all nodes in the traversal. More...
 
virtual vector< double > get_traversal_mapqs (const vector< SnarlTraversal > &traversals) const
 
virtual size_t get_average_traversal_support_switch_threshold () const
 Get the average traversal support thresholdek. More...
 
unordered_map< id_t, size_t > get_ref_offsets (const SnarlTraversal &ref_trav) const
 
virtual void set_support_switch_threshold (size_t trav_thresh, size_t node_thresh)
 set the threshold More...
 
virtual void set_min_bp_edge_override (bool bp_override)
 set the breakpoint stricter upper override More...
 
virtual void apply_min_bp_edge_override (const vector< SnarlTraversal > &traversals, const set< int > &tgt_travs, vector< Support > &supports, int ref_trav_idx) const
 apply the override to a set of traversals More...
 

Protected Attributes

vector< LRUCache< edge_t, Support > * > edge_support_cache
 One node cache per threade. More...
 
vector< LRUCache< nid_t, Support > * > min_node_support_cache
 
vector< LRUCache< nid_t, Support > * > avg_node_support_cache
 
vector< LRUCache< nid_t, size_t > * > avg_node_mapq_cache
 
- Protected Attributes inherited from vg::PackedTraversalSupportFinder
const Packerpacker
 Derive supports from this pack index. More...
 
- Protected Attributes inherited from vg::TraversalSupportFinder
size_t average_traversal_support_switch_threshold = 50
 
size_t average_node_support_switch_threshold = 50
 
bool min_bp_edge_override = false
 If on, always apply minimum edge support for breakpoint (ref->offref) edges. More...
 
const HandleGraphgraph
 
SnarlManagersnarl_manager
 

Additional Inherited Members

- Static Public Member Functions inherited from vg::TraversalSupportFinder
static double support_val (const Support &support)
 Relic from old code. More...
 

Detailed Description

Add a caching overlay to the PackedTravesalSupportFinder to avoid frequent base queries which can become expensive. Even caching the edges seems to have an impact

Constructor & Destructor Documentation

◆ CachedPackedTraversalSupportFinder()

vg::CachedPackedTraversalSupportFinder::CachedPackedTraversalSupportFinder ( const Packer packer,
SnarlManager snarl_manager,
size_t  cache_size = 500000 
)

◆ ~CachedPackedTraversalSupportFinder()

vg::CachedPackedTraversalSupportFinder::~CachedPackedTraversalSupportFinder ( )
virtual

Member Function Documentation

◆ get_avg_node_mapq()

size_t vg::CachedPackedTraversalSupportFinder::get_avg_node_mapq ( id_t  node) const
virtual

Average MAPQ of reads that map to a node.

Reimplemented from vg::PackedTraversalSupportFinder.

◆ get_avg_node_support()

Support vg::CachedPackedTraversalSupportFinder::get_avg_node_support ( id_t  node) const
virtual

Average support of a node.

Reimplemented from vg::PackedTraversalSupportFinder.

◆ get_edge_support()

Support vg::CachedPackedTraversalSupportFinder::get_edge_support ( id_t  from,
bool  from_reverse,
id_t  to,
bool  to_reverse 
) const
virtual

Support of an edge.

Reimplemented from vg::PackedTraversalSupportFinder.

◆ get_min_node_support()

Support vg::CachedPackedTraversalSupportFinder::get_min_node_support ( id_t  node) const
virtual

Minimum support of a node.

Reimplemented from vg::PackedTraversalSupportFinder.

Member Data Documentation

◆ avg_node_mapq_cache

vector<LRUCache<nid_t, size_t>*> vg::CachedPackedTraversalSupportFinder::avg_node_mapq_cache
mutableprotected

◆ avg_node_support_cache

vector<LRUCache<nid_t, Support>*> vg::CachedPackedTraversalSupportFinder::avg_node_support_cache
mutableprotected

◆ edge_support_cache

vector<LRUCache<edge_t, Support>*> vg::CachedPackedTraversalSupportFinder::edge_support_cache
mutableprotected

One node cache per threade.

◆ min_node_support_cache

vector<LRUCache<nid_t, Support>*> vg::CachedPackedTraversalSupportFinder::min_node_support_cache
mutableprotected

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