#graph #bioinformatics #parser

handlegraph

Library for use in variation graphs

15 unstable releases (6 breaking)

0.7.0-alpha.9 Aug 2, 2021
0.7.0-alpha.7 May 13, 2021
0.7.0-alpha.3 Feb 2, 2021
0.6.0 Nov 24, 2020
0.2.0 Jul 1, 2020

#351 in Biology

50 downloads per month
Used in 2 crates

MIT license

655KB
14K SLoC

Handlegraphs in Rust

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.


lib.rs:

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

Dependencies

~9MB
~145K SLoC