The Graphical Fragment Assembly (GFA) is a proposed format which allow to describe the product of sequence assembly. This gem implements the proposed specifications for the GFA format described under as close as possible.

The library allows to create a RGFA object from a file in the GFA format or from scratch, to enumerate the graph elements (segments, links, containments, paths and header lines), to traverse the graph (by traversing all links outgoing from or incoming to a segment), to search for elements (e.g. which links connect two segments) and to manipulate the graph (e.g. to eliminate a link or a segment or to duplicate a segment distributing the read counts evenly on the copies).


The latest release of the gem can be installed from the rubygems repository using: gem install rgfa

Alternatively this git repository can be cloned or the source code installed from a release archive, and then the gem created and installed using: rake install


To use the library in your Ruby scripts, just require it as follows: require "rgfa"

Additional functionality, which requires custom tags and additional conventions, is included in a separate part of the code named RGFATools and can be accessed with: require "rgfatools"


A cheatsheet is available as pdf under

The full API documentation is available as pdf under or in HTML format (

The main class of the library is RGFA, which is a good starting point when reading the documentation.


Gonnella G, Kurtz S. (2016) RGFA: powerful and convenient handling of assembly graphs. PeerJ 4:e2681