vg
tools for working with variation graphs
Namespaces | Classes | Functions
handlegraph::algorithms Namespace Reference

Namespaces

 internal
 

Classes

class  SubHandleGraph
 

Functions

void append_handle_graph (const HandleGraph *from, MutableHandleGraph *into)
 
void append_path_handle_graph (const PathHandleGraph *from, MutablePathMutableHandleGraph *into, bool only_connect_path_tips)
 
unordered_set< nid_tapply_orientations (MutableHandleGraph *graph, const vector< handle_t > &orientations)
 
bool are_equivalent (const HandleGraph *graph_1, const HandleGraph *graph_2, bool verbose)
 
bool are_equivalent_with_paths (const PathHandleGraph *graph_1, const PathHandleGraph *graph_2, bool verbose)
 
handle_t concat_nodes (MutablePathDeletableHandleGraph &graph, const std::vector< handle_t > &nodes)
 
handle_t combine_handles (MutablePathDeletableHandleGraph &graph, const std::vector< handle_t > &handles)
 
bool nodes_are_perfect_path_neighbors (const PathHandleGraph &graph, handle_t left_handle, handle_t right_handle)
 
vector< deque< handle_t > > simple_components (const PathHandleGraph &graph, int min_size=1)
 
void unchop (MutablePathDeletableHandleGraph &graph)
 
void chop (MutablePathDeletableHandleGraph &graph, size_t max_node_length, const std::function< void(nid_t, size_t, size_t, handle_t)> &record_change)
 
void chop (MutablePathDeletableHandleGraph &graph, size_t max_node_length)
 
void copy_handle_graph (const HandleGraph *from, MutableHandleGraph *into)
 
void copy_path_handle_graph (const PathHandleGraph *from, MutablePathMutableHandleGraph *into)
 
void copy_path (const PathHandleGraph *from, const path_handle_t &from_path, MutablePathHandleGraph *into)
 
void copy_path (const PathHandleGraph *from, const path_handle_t &from_path, MutablePathHandleGraph *into, const path_handle_t &into_path)
 
tuple< vector< handle_t >, unordered_map< handle_t, size_t >, bool > count_walks_through_nodes (const HandleGraph *graph)
 
size_t count_walks (const HandleGraph *graph)
 
unordered_map< nid_t, nid_tdagify (const HandleGraph *graph, MutableHandleGraph *into, size_t min_preserved_path_length)
 
std::unordered_map< nid_t, nid_tdagify_from (const HandleGraph *graph, std::vector< handle_t > start_handles, DeletableHandleGraph *into, size_t min_preserved_path_length)
 
bool dijkstra (const HandleGraph *g, handle_t start, function< bool(const handle_t &, size_t)> reached_callback, bool traverse_leftward, bool prune, bool cycle_to_start)
 
bool dijkstra (const HandleGraph *g, const unordered_set< handle_t > &starts, function< bool(const handle_t &, size_t)> reached_callback, bool traverse_leftward, bool prune, bool cycle_to_start)
 
void for_each_handle_in_shortest_path (const HandleGraph *g, handle_t start, handle_t end, std::function< bool(const handle_t &, size_t)> iteratee)
 
vector< handle_teades_algorithm (const HandleGraph *graph)
 
void extend (const HandleGraph *source, MutableHandleGraph *into)
 
unordered_map< handle_t, size_t > find_shortest_paths (const HandleGraph *g, handle_t start, bool traverse_leftward)
 
vector< handle_thead_nodes (const HandleGraph *g)
 
vector< handle_ttail_nodes (const HandleGraph *g)
 
vector< handle_tfind_tips (const HandleGraph *g)
 
bool is_acyclic (const HandleGraph *graph)
 
bool is_directed_acyclic (const HandleGraph *graph)
 
bool is_single_stranded (const HandleGraph *graph)
 
vector< handle_tsingle_stranded_orientation (const HandleGraph *graph)
 
unordered_set< nid_tmake_single_stranded (MutableHandleGraph *graph)
 
void reverse_complement_graph (const HandleGraph *source, MutableHandleGraph *into)
 
unordered_map< handle_t, handle_tsplit_strands (const HandleGraph *source, MutableHandleGraph *into)
 
vector< unordered_set< nid_t > > strongly_connected_components (const HandleGraph *handle_graph)
 
vector< handle_ttopological_order (const HandleGraph *g)
 
vector< handle_tlazy_topological_order_internal (const HandleGraph *g, bool lazier)
 
vector< handle_tlazy_topological_order (const HandleGraph *g)
 
vector< handle_tlazier_topological_order (const HandleGraph *g)
 
vector< unordered_set< nid_t > > weakly_connected_components (const HandleGraph *graph)
 
vector< pair< unordered_set< nid_t >, vector< handle_t > > > weakly_connected_components_with_tips (const HandleGraph *graph)
 
bool is_weakly_connected (const HandleGraph *graph)
 

Function Documentation

◆ append_handle_graph()

void handlegraph::algorithms::append_handle_graph ( const HandleGraph from,
MutableHandleGraph into 
)

◆ append_path_handle_graph()

void handlegraph::algorithms::append_path_handle_graph ( const PathHandleGraph from,
MutablePathMutableHandleGraph into,
bool  only_connect_path_tips 
)

◆ apply_orientations()

unordered_set<nid_t> handlegraph::algorithms::apply_orientations ( MutableHandleGraph graph,
const vector< handle_t > &  orientations 
)

◆ are_equivalent()

bool handlegraph::algorithms::are_equivalent ( const HandleGraph graph_1,
const HandleGraph graph_2,
bool  verbose 
)

◆ are_equivalent_with_paths()

bool handlegraph::algorithms::are_equivalent_with_paths ( const PathHandleGraph graph_1,
const PathHandleGraph graph_2,
bool  verbose 
)

◆ chop() [1/2]

void handlegraph::algorithms::chop ( MutablePathDeletableHandleGraph graph,
size_t  max_node_length 
)

◆ chop() [2/2]

void handlegraph::algorithms::chop ( MutablePathDeletableHandleGraph graph,
size_t  max_node_length,
const std::function< void(nid_t, size_t, size_t, handle_t)> &  record_change 
)

◆ combine_handles()

handle_t handlegraph::algorithms::combine_handles ( MutablePathDeletableHandleGraph graph,
const std::vector< handle_t > &  handles 
)

◆ concat_nodes()

handle_t handlegraph::algorithms::concat_nodes ( MutablePathDeletableHandleGraph graph,
const std::vector< handle_t > &  nodes 
)

Concatenates the nodes into a new node with the same external linkage as the provided component. All handles must be in left to right order and a consistent orientation. All paths present must run all the way through the run of nodes from start to end or end to start.

Returns the handle to the newly created node in the new graph.

After calling this on a vg::VG, paths will be invalid until Paths::compact_ranks() is called.

◆ copy_handle_graph()

void handlegraph::algorithms::copy_handle_graph ( const HandleGraph from,
MutableHandleGraph into 
)

◆ copy_path() [1/2]

void handlegraph::algorithms::copy_path ( const PathHandleGraph from,
const path_handle_t from_path,
MutablePathHandleGraph into 
)

◆ copy_path() [2/2]

void handlegraph::algorithms::copy_path ( const PathHandleGraph from,
const path_handle_t from_path,
MutablePathHandleGraph into,
const path_handle_t into_path 
)

◆ copy_path_handle_graph()

void handlegraph::algorithms::copy_path_handle_graph ( const PathHandleGraph from,
MutablePathMutableHandleGraph into 
)

◆ count_walks()

size_t handlegraph::algorithms::count_walks ( const HandleGraph graph)

◆ count_walks_through_nodes()

tuple<vector<handle_t>, unordered_map<handle_t, size_t>, bool> handlegraph::algorithms::count_walks_through_nodes ( const HandleGraph graph)

◆ dagify()

unordered_map<nid_t, nid_t> handlegraph::algorithms::dagify ( const HandleGraph graph,
MutableHandleGraph into,
size_t  min_preserved_path_length 
)

◆ dagify_from()

std::unordered_map<nid_t, nid_t> handlegraph::algorithms::dagify_from ( const HandleGraph graph,
std::vector< handle_t start_handles,
DeletableHandleGraph into,
size_t  min_preserved_path_length 
)

◆ dijkstra() [1/2]

bool handlegraph::algorithms::dijkstra ( const HandleGraph g,
const unordered_set< handle_t > &  starts,
function< bool(const handle_t &, size_t)>  reached_callback,
bool  traverse_leftward,
bool  prune,
bool  cycle_to_start 
)

◆ dijkstra() [2/2]

bool handlegraph::algorithms::dijkstra ( const HandleGraph g,
handle_t  start,
function< bool(const handle_t &, size_t)>  reached_callback,
bool  traverse_leftward,
bool  prune,
bool  cycle_to_start 
)

◆ eades_algorithm()

vector<handle_t> handlegraph::algorithms::eades_algorithm ( const HandleGraph graph)

◆ extend()

void handlegraph::algorithms::extend ( const HandleGraph source,
MutableHandleGraph into 
)

◆ find_shortest_paths()

unordered_map<handle_t, size_t> handlegraph::algorithms::find_shortest_paths ( const HandleGraph g,
handle_t  start,
bool  traverse_leftward 
)

◆ find_tips()

vector<handle_t> handlegraph::algorithms::find_tips ( const HandleGraph g)

◆ for_each_handle_in_shortest_path()

void handlegraph::algorithms::for_each_handle_in_shortest_path ( const HandleGraph g,
handle_t  start,
handle_t  end,
std::function< bool(const handle_t &, size_t)>  iteratee 
)

◆ head_nodes()

vector<handle_t> handlegraph::algorithms::head_nodes ( const HandleGraph g)

◆ is_acyclic()

bool handlegraph::algorithms::is_acyclic ( const HandleGraph graph)

◆ is_directed_acyclic()

bool handlegraph::algorithms::is_directed_acyclic ( const HandleGraph graph)

◆ is_single_stranded()

bool handlegraph::algorithms::is_single_stranded ( const HandleGraph graph)

◆ is_weakly_connected()

bool handlegraph::algorithms::is_weakly_connected ( const HandleGraph graph)

◆ lazier_topological_order()

vector<handle_t> handlegraph::algorithms::lazier_topological_order ( const HandleGraph g)

◆ lazy_topological_order()

vector<handle_t> handlegraph::algorithms::lazy_topological_order ( const HandleGraph g)

◆ lazy_topological_order_internal()

vector<handle_t> handlegraph::algorithms::lazy_topological_order_internal ( const HandleGraph g,
bool  lazier 
)

◆ make_single_stranded()

unordered_set<nid_t> handlegraph::algorithms::make_single_stranded ( MutableHandleGraph graph)

◆ nodes_are_perfect_path_neighbors()

bool handlegraph::algorithms::nodes_are_perfect_path_neighbors ( const PathHandleGraph graph,
handle_t  left_handle,
handle_t  right_handle 
)

Return true if nodes share all paths and the mappings they share in these paths are adjacent, in the specified relative order and orientation.

◆ reverse_complement_graph()

void handlegraph::algorithms::reverse_complement_graph ( const HandleGraph source,
MutableHandleGraph into 
)

◆ simple_components()

vector<deque<handle_t> > handlegraph::algorithms::simple_components ( const PathHandleGraph graph,
int  min_size = 1 
)

◆ single_stranded_orientation()

vector<handle_t> handlegraph::algorithms::single_stranded_orientation ( const HandleGraph graph)

◆ split_strands()

unordered_map<handle_t, handle_t> handlegraph::algorithms::split_strands ( const HandleGraph source,
MutableHandleGraph into 
)

◆ strongly_connected_components()

vector<unordered_set<nid_t> > handlegraph::algorithms::strongly_connected_components ( const HandleGraph handle_graph)

◆ tail_nodes()

vector<handle_t> handlegraph::algorithms::tail_nodes ( const HandleGraph g)

◆ topological_order()

vector<handle_t> handlegraph::algorithms::topological_order ( const HandleGraph g)

◆ unchop()

void handlegraph::algorithms::unchop ( MutablePathDeletableHandleGraph graph)

◆ weakly_connected_components()

vector<unordered_set<nid_t> > handlegraph::algorithms::weakly_connected_components ( const HandleGraph graph)

◆ weakly_connected_components_with_tips()

vector<pair<unordered_set<nid_t>, vector<handle_t> > > handlegraph::algorithms::weakly_connected_components_with_tips ( const HandleGraph graph)