You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
libvgio is a library for (de)serializing vg files for use with the
vg toolkit (see Sequence variation aware genome
references and read mapping with the variation graph toolkit).
This tool is in the development stage, so it may contain bugs and the
instructions on how to use it are subject to change.
Compiling
libvgio is implemented in C++11 and is built using CMake.
libvgio's only dependencies are protobuf
(Google Protocol Buffers),
htslib, and pthreads, all of which can be easily
installed on any Unix style system.
Once protobufs and pthreads are installed, you can build and install libvgio
by running the installation script: ./install.sh [INSTALL_LOCATION].
This will install the dynamic library and headers in your home directory unless
you provide the script with the optional INSTALL_LOCATION.
On Mac, you may need to explain how to find OpenMP, and you may not be able to
use the script. You can install manually instead. For example, if you installed
OpenMP via Homebrew, it ought to be in ${HOMEBREW_PREFIX}/opt/libomp, so you
can run:
cd build
cmake -DCMAKE_INSTALL_PREFIX=${HOME} -DCMAKE_PREFIX_PATH="${HOMEBREW_PREFIX}/opt/libomp" ..
make
make install
Usage
libvgio exposes two header files vg/vg.pb.h and
vg/io/basic_stream.hpp.
vg/vg.pb.h is the header generated by the vg protobuf (see the
vg toolkit Wiki for details)
and vg/io/basic_stream.hpp exposes an input stream and an output stream.
The following C++ example reads a vg graph with the input stream and writes it
to the standard output with the output stream.
#include<iostream>
#include"vg/vg.pb.h"
#include"vg/io/basic_stream.hpp"using std::cout;
using std::endl;
using vg::Graph;
using vg::io::inputStream;
using vg::io::outputStream;
intmain(int argc, char* argv[])
{
if (argc != 2) {
cout << "Usage: " << argv[0] << " VG_FILE" << endl;
return -1;
}
Graph g = inputStream(argv[1]);
outputStream(g);
return0;
}
This can be compiled by linking against libvgio at compile time