[][src]Crate handlegraph

A Rusty take on the libhandlegraph interface for variation graph access and manipulation.

Overview

This crate provides a number of traits that together encapsulate the handlegraph interface. While these traits do not form a direct mirror of the C++ interface, (almost) all of the features should exist and be usable.

In addition to the abstract traits, there are currently two concrete handlegraphs that implement them:

  • HashGraph is a HashMap-based graph that does nothing to reduce its memory footprint, but is fast.
  • PackedGraph uses packed integer vectors to greatly reduce memory usage.

The interface

The handlegraph interface is split into three categories, each consisting of a number of traits that encapsulate a subset of the functionality implied by their category.

  • handlegraph is for immutable access to the nodes and edges of a graph
  • mutablehandlegraph is for mutable access to nodes and edges
  • pathhandlegraph is for both immutable and mutable access to the paths embedded in a graph

Handles and NodeIds

The core types, used all over the various traits, are defined in handle:

  • NodeId is a newtype used as a node identifier
  • Handle represents a specific orientation of a node
  • Edge is a newtype for edges in a specific order

Misc.

  • conversion has some functions for converting from GFA to a handlegraph and back
  • packed is where the packed vector collection types used by PackedGraph are implemented

Modules

algorithms
consensus
conversion
disjoint

Rust implementation of the lock-free parallel disjoint set described in the paper "Wait-free Parallel Algorithms for the Union-Find Problem" by Richard J. Anderson and Heather Woll.

handle
handlegraph

Traits for immutable access to a HandleGraph, including its nodes/handles, edges, and the sequences of nodes.

hashgraph

A handlegraph implementation using HashMap to represent the graph topology and nodes, and each path as a Vec of nodes.

mutablehandlegraph

Traits for manipulating the nodes and edges of a graph.

packed
packedgraph

A handlegraph implementation using packed vector representations to minimize memory usage.

pathhandlegraph

Traits and utilities for accessing and manipulating paths embedded in a graph.

util

Macros

assign_fields_local
assign_for_fields
impl_one_based_index
impl_one_based_index_default
impl_space_usage
impl_space_usage_stack_newtype