vg
tools for working with variation graphs
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
vg::SnarlManagerDecomposition::TraversalSurvey::Surveyor Class Reference

Classes

struct  WalkEnds
 The places in a snarl or chain where a walk can end. More...
 

Public Member Functions

 Surveyor (const SnarlManager &manager, const HandleGraph &graph, const NodeDirectory &directory, const TraversalSurvey &survey)
 
TraversalSet survey_snarl (const Snarl *snarl) const
 
TraversalSet survey_chain (const Chain &chain) const
 

Private Member Functions

WalkEnds walk_snarl (const Snarl *snarl, const std::vector< handle_t > &starts) const
 
WalkEnds walk_chain (const Chain &chain, const std::vector< std::pair< size_t, bool >> &starts) const
 
bool enter_child (const handle_t &entering, std::vector< handle_t > &exits) const
 

Static Private Member Functions

static void add_walks_from_bounds (TraversalSet &traversals, const WalkEnds &from_start, const WalkEnds &from_end)
 

Private Attributes

const SnarlManager & manager
 The manager whose snarls and chains are surveyed. More...
 
const HandleGraph & graph
 The graph the snarls were found in. More...
 
const NodeDirectory & directory
 
const TraversalSurvey & survey
 

Detailed Description

A surveyor that finds the realizable traversals of one snarl or chain at a time, by walking the graph.

A walk crosses each child as the survey says the traversals of that child allow. So the surveyor must survey each child before its parent.

Constructor & Destructor Documentation

◆ Surveyor()

vg::SnarlManagerDecomposition::TraversalSurvey::Surveyor::Surveyor ( const SnarlManager &  manager,
const HandleGraph &  graph,
const NodeDirectory &  directory,
const TraversalSurvey &  survey 
)

Make a surveyor for one survey.

The surveyor keeps references to its arguments, which must outlive it.

Member Function Documentation

◆ add_walks_from_bounds()

void vg::SnarlManagerDecomposition::TraversalSurvey::Surveyor::add_walks_from_bounds ( TraversalSet &  traversals,
const WalkEnds &  from_start,
const WalkEnds &  from_end 
)
staticprivate

Add the traversals made by walks from the start and end bounds.

Also add each of those traversals taken backward that starts at a tip.

◆ enter_child()

bool vg::SnarlManagerDecomposition::TraversalSurvey::Surveyor::enter_child ( const handle_t &  entering,
std::vector< handle_t > &  exits 
) const
private

Find where a walk that enters a child chain or free node can leave it.

Add each exit to exits. A walk leaves the child through the right side of an exit. The one exit of a free node is the entering handle.

Returns
True if a walk entering the chain can end at a tip in it.
Precondition
The chain has been surveyed.
Exceptions
std::logic_errorIf the handle enters a chain between its bounds.

◆ survey_chain()

SnarlManagerDecomposition::TraversalSet vg::SnarlManagerDecomposition::TraversalSurvey::Surveyor::survey_chain ( const Chain &  chain) const

Find the realizable traversals of a chain.

Precondition
Each snarl in the chain has been surveyed.

◆ survey_snarl()

SnarlManagerDecomposition::TraversalSet vg::SnarlManagerDecomposition::TraversalSurvey::Surveyor::survey_snarl ( const Snarl *  snarl) const

Find the realizable traversals of a snarl.

Precondition
Each chain in the snarl has been surveyed.

◆ walk_chain()

SnarlManagerDecomposition::TraversalSurvey::Surveyor::WalkEnds vg::SnarlManagerDecomposition::TraversalSurvey::Surveyor::walk_chain ( const Chain &  chain,
const std::vector< std::pair< size_t, bool >> &  starts 
) const
private

Find where walks along a chain from some chain nodes can end.

Each start is the position of a chain node, and true to leave it going in reverse along the chain. Here the end bound has position chain.size() even in a looping chain. A walk that comes to a bound of a looping chain can leave there, and can also go on around the loop, since its boundary node is both bounds.

Precondition
Each snarl in the chain has been surveyed.

◆ walk_snarl()

SnarlManagerDecomposition::TraversalSurvey::Surveyor::WalkEnds vg::SnarlManagerDecomposition::TraversalSurvey::Surveyor::walk_snarl ( const Snarl *  snarl,
const std::vector< handle_t > &  starts 
) const
private

Find where walks through a snarl from some handles can end.

A walk leaves each start through its right side. Each start is on a node in the snarl, or on a bound oriented into the snarl.

Precondition
Each chain in the snarl has been surveyed.

Member Data Documentation

◆ directory

const NodeDirectory& vg::SnarlManagerDecomposition::TraversalSurvey::Surveyor::directory
private

Tells the surveyor which chain, if any, each node is a chain node of.

◆ graph

const HandleGraph& vg::SnarlManagerDecomposition::TraversalSurvey::Surveyor::graph
private

The graph the snarls were found in.

◆ manager

const SnarlManager& vg::SnarlManagerDecomposition::TraversalSurvey::Surveyor::manager
private

The manager whose snarls and chains are surveyed.

◆ survey

const TraversalSurvey& vg::SnarlManagerDecomposition::TraversalSurvey::Surveyor::survey
private

Tells the surveyor the traversals of each child already surveyed.


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