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

#include <small_snarl_simplifier.hpp>

Inheritance diagram for vg::SmallSnarlSimplifier:
vg::Progressive

Public Member Functions

 SmallSnarlSimplifier (VG &graph)
 Make a simplifier that simplifies the given graph in place. More...
 
pair< size_t, size_t > simplify_once (size_t iteration=0)
 
void simplify ()
 
- Public Member Functions inherited from vg::Progressive
void preload_progress (const string &message)
 
void create_progress (const string &message, long count)
 
void create_progress (long count)
 
void update_progress (long i)
 
void increment_progress ()
 
void destroy_progress (void)
 

Public Attributes

size_t min_size = 10
 
size_t max_iterations = 10
 How many iterations of simplification should we allow in a simplify() call? More...
 
bool drop_hairpin_paths = false
 
FeatureSetfeatures = nullptr
 
- Public Attributes inherited from vg::Progressive
bool show_progress = false
 

Protected Attributes

VGgraph
 Holds a reference to the graph we're simplifying. More...
 
SnarlManager site_manager
 This keeps track of the sites to simplify. More...
 
TrivialTraversalFinder traversal_finder
 This is used to find traversals of those sites. More...
 

Detailed Description

A class that can be used to simplify a graph, by repeatedly popping leaf bubbles under a certain size. Keeps graph paths and an optional set of BED- like features up to date. TODO: doesn't handle path start and end positions within nodes.

Constructor & Destructor Documentation

◆ SmallSnarlSimplifier()

vg::SmallSnarlSimplifier::SmallSnarlSimplifier ( VG graph)

Make a simplifier that simplifies the given graph in place.

Member Function Documentation

◆ simplify()

void vg::SmallSnarlSimplifier::simplify ( )

Simplify the graph until material stops being deleted or the maximum iteration count is reached.

◆ simplify_once()

pair< size_t, size_t > vg::SmallSnarlSimplifier::simplify_once ( size_t  iteration = 0)

Simplify the graph by one step. Returns the number of nodes deleted and the number of edges deleted. Can be passed an iteration for its progress messages.

Member Data Documentation

◆ drop_hairpin_paths

bool vg::SmallSnarlSimplifier::drop_hairpin_paths = false

Should we simplify bubbles where paths come in and leave through the enterance node (and delete those paths) (true)? Or should we leave those bubbles unsimplified?

◆ features

FeatureSet* vg::SmallSnarlSimplifier::features = nullptr

If the user points this to a FeatureSet, that FeatureSet will get its features updated with changes to the graph as simplification proceeds. The user should load the features in and pull them out. TODO: Replace this with an on_path_edit event on this object that can be listened on.

◆ graph

VG& vg::SmallSnarlSimplifier::graph
protected

Holds a reference to the graph we're simplifying.

◆ max_iterations

size_t vg::SmallSnarlSimplifier::max_iterations = 10

How many iterations of simplification should we allow in a simplify() call?

◆ min_size

size_t vg::SmallSnarlSimplifier::min_size = 10

What's the miniumum size of a bubble to keep, in involved bases? Everything smaller will get squished away.

◆ site_manager

SnarlManager vg::SmallSnarlSimplifier::site_manager
protected

This keeps track of the sites to simplify.

◆ traversal_finder

TrivialTraversalFinder vg::SmallSnarlSimplifier::traversal_finder
protected

This is used to find traversals of those sites.


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