vg
tools for working with variation graphs
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
vg::TraversalSupportFinder Class Referenceabstract

#include <traversal_support.hpp>

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

Public Member Functions

 TraversalSupportFinder (const HandleGraph &graph, SnarlManager &snarl_manager)
 
virtual ~TraversalSupportFinder ()
 
virtual Support get_edge_support (const edge_t &edge) const =0
 Support of an edge. More...
 
virtual Support get_edge_support (id_t from, bool from_reverse, id_t to, bool to_reverse) const =0
 
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 Support get_min_node_support (id_t node) const =0
 Minimum support of a node. More...
 
virtual Support get_avg_node_support (id_t node) const =0
 Average support of a node. More...
 
virtual size_t get_avg_node_mapq (id_t node) const =0
 Average MAPQ of reads that map to a node. 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...
 

Static Public Member Functions

static double support_val (const Support &support)
 Relic from old code. More...
 

Protected Attributes

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
 

Detailed Description

Get the read support of snarl traversals or sets of snarl traversals

Constructor & Destructor Documentation

◆ TraversalSupportFinder()

vg::TraversalSupportFinder::TraversalSupportFinder ( const HandleGraph graph,
SnarlManager snarl_manager 
)

◆ ~TraversalSupportFinder()

vg::TraversalSupportFinder::~TraversalSupportFinder ( )
virtual

Member Function Documentation

◆ apply_min_bp_edge_override()

void vg::TraversalSupportFinder::apply_min_bp_edge_override ( const vector< SnarlTraversal > &  traversals,
const set< int > &  tgt_travs,
vector< Support > &  supports,
int  ref_trav_idx 
) const
virtual

apply the override to a set of traversals

◆ get_average_traversal_support_switch_threshold()

size_t vg::TraversalSupportFinder::get_average_traversal_support_switch_threshold ( ) const
virtual

Get the average traversal support thresholdek.

◆ get_avg_node_mapq()

virtual size_t vg::TraversalSupportFinder::get_avg_node_mapq ( id_t  node) const
pure virtual

Average MAPQ of reads that map to a node.

Implemented in vg::CachedPackedTraversalSupportFinder, and vg::PackedTraversalSupportFinder.

◆ get_avg_node_support()

virtual Support vg::TraversalSupportFinder::get_avg_node_support ( id_t  node) const
pure virtual

Average support of a node.

Implemented in vg::CachedPackedTraversalSupportFinder, and vg::PackedTraversalSupportFinder.

◆ get_child_support()

tuple< Support, Support, int > vg::TraversalSupportFinder::get_child_support ( const Snarl snarl) const
virtual

Use node or edge support as proxy for child support (as was done in original calling code)

Reimplemented in vg::NestedCachedPackedTraversalSupportFinder.

◆ get_edge_length()

int64_t vg::TraversalSupportFinder::get_edge_length ( const edge_t edge,
const unordered_map< id_t, size_t > &  ref_offsets 
) const
virtual

Effective length of an edge.

◆ get_edge_support() [1/2]

virtual Support vg::TraversalSupportFinder::get_edge_support ( const edge_t edge) const
pure virtual

Support of an edge.

Implemented in vg::PackedTraversalSupportFinder.

◆ get_edge_support() [2/2]

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

◆ get_min_node_support()

virtual Support vg::TraversalSupportFinder::get_min_node_support ( id_t  node) const
pure virtual

Minimum support of a node.

Implemented in vg::CachedPackedTraversalSupportFinder, and vg::PackedTraversalSupportFinder.

◆ get_ref_offsets()

unordered_map< id_t, size_t > vg::TraversalSupportFinder::get_ref_offsets ( const SnarlTraversal ref_trav) const

get a map of the beginning of a node (in forward orientation) on a traversal used for up-weighting large deletion edges in complex snarls with average support

◆ get_traversal_genotype_support()

vector< Support > vg::TraversalSupportFinder::get_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

wrapper for using get_traversal_set_support to get the support for some alleles in a genotype, where everything is split evently among them anything not in the genotype gets a support using "exclusive_count" where nodes taken by the genotype are counted as 0 stuff not in the genotype is limited to other_trav_subset (or all if empty)

◆ get_traversal_mapqs()

vector< double > vg::TraversalSupportFinder::get_traversal_mapqs ( const vector< SnarlTraversal > &  traversals) const
virtual

Get the average MAPQ in each traversal Only consider nodes Normalize by base coverage (ie avg coverage / node by node length)

◆ get_traversal_set_support()

vector< Support > vg::TraversalSupportFinder::get_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

traversals: get support for each traversal in this set shared_travs: if a node appears N times in shared_travs, then it will count as 1 / (N+1) support shared_support: optional supports for shared_travs. used to weight support split by traversal support. tgt_travs: if not empty, only compute support for these traversals (remaining slots in output vector left 0) eclusive_only: shared_travs are completely ignored exclusive_count_travs: these traversals get subtracted from supports in the target traversals exclusive_count_support: used with above, to determine amount of support to subtract ref_trav_idx: index of reference traversal if known max_trav_size: optional input of max trav size. useful when longest traversral is outside target set

◆ get_traversal_sizes()

vector< int > vg::TraversalSupportFinder::get_traversal_sizes ( const vector< SnarlTraversal > &  traversals) const
virtual

Get the total length of all nodes in the traversal.

◆ get_traversal_support()

Support vg::TraversalSupportFinder::get_traversal_support ( const SnarlTraversal traversal) const
virtual

Get the support of a traversal Child snarls are handled as in the old call code: their maximum support is used

◆ set_min_bp_edge_override()

void vg::TraversalSupportFinder::set_min_bp_edge_override ( bool  bp_override)
virtual

set the breakpoint stricter upper override

◆ set_support_switch_threshold()

void vg::TraversalSupportFinder::set_support_switch_threshold ( size_t  trav_thresh,
size_t  node_thresh 
)
virtual

set the threshold

◆ support_val()

static double vg::TraversalSupportFinder::support_val ( const Support support)
inlinestatic

Relic from old code.

Member Data Documentation

◆ average_node_support_switch_threshold

size_t vg::TraversalSupportFinder::average_node_support_switch_threshold = 50
protected

Use average instead of minimum support when determining a node's support its position supports.

◆ average_traversal_support_switch_threshold

size_t vg::TraversalSupportFinder::average_traversal_support_switch_threshold = 50
protected

◆ graph

const HandleGraph& vg::TraversalSupportFinder::graph
protected

◆ min_bp_edge_override

bool vg::TraversalSupportFinder::min_bp_edge_override = false
protected

If on, always apply minimum edge support for breakpoint (ref->offref) edges.

◆ snarl_manager

SnarlManager& vg::TraversalSupportFinder::snarl_manager
protected

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