Skip to content

glennhickey/vg2sg

Repository files navigation

vg2sg

Prototype code for converting VG to Side Graph SQL

(c) 2015 Glenn Hickey. See LICENSE for details.

See also:

Algorithm

Iteratatively add VG paths to side graph. Consecutive VG nodes will be merged greedily when possible. Only paths will be converted in this way by default. Use the -s option to generate paths covering all edges in VG input not already in a path to ensure all nodes and edges get converted.

Constraints

  1. Edits in paths are not supported. Any non-trivial (snp/indel) edits will result in an error.

Important

This is organized as a stand-alone exectuable (ie reads VG protbuf directly) mostly so I can start developing on my mac (where VG won't build). Chances are, some logic from VG will be needed eventually. At that point will have to look at either integrating into VG or linking against it (and its millions of deps)...

Instructions

Cloning: Don't forget to clone submodules:

 git clone https://github.com/glennhickey/vg2sg.git --recursive

Note Start by verifying that the unit tests all pass:

  make test

To run the converter:

  vg2sg input.vg output.fa output.sql

input.vg Input variant graph to convert

output.fa Output fasta file of all Side Graph sequences

output.sql Output text file listing INSERT commands for Sequences, Joins and Paths (for each input sequence) in the graph.

Options

-h, --help
-p, --primaryPath  Primary path name
-s, --span         Create a path set that spans all edges to make sure entire graph gets converted.
-i, --ignorePaths  Ignore paths in input VG.  Use spanning paths only for conversion.