uio-cels/OffsetBasedGraph

Name: OffsetBasedGraph

Owner: Centre for Computational Inference in Evolutionary Life Science

Description: Python package for handling genomic offset-based graphs

Created: 2016-09-20 13:37:54.0

Updated: 2017-05-24 12:17:35.0

Pushed: 2018-01-10 08:15:25.0

Homepage: null

Size: 135277

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status

Note: This is Offsetbasedgraph version 2.0, made to work with Graph Peak Caller. For the version compatible with the analysis done in the paper Coordinates and Intervals in Graph-based Reference Genomes, go to version 1.0.7.

Offsetbasedgraph

This is a python package for working with and representing genomic graphs without sequence in Python. Together with pyvg, Offsetbasedgraph can be used to represent graphs created by vg.

Installation

Offsetbasedgraph version 2.0 is compatible with Python 3 only. Install with pip:

 install offsetbasedgraph

… or by cloning:

clone https://github.com/uio-cels/OffsetBasedGraph.git
ffsetBasedGraph
 install -e .

Basic usage

Graphs can be created by sending a dict of Blocks (connected nodes) and dict of edges (one list of edges per key node) to the Graph object.

 offsetbasedgraph import Graph, Block
h = Graph({1: Block(10), 2: Block(5)}, {1: [2]})

An interval contain a start offset, end offset and a list of blocks it follows:

 offsetbasedgraph import Interval
rval = Interval(3, 6, [1, 2], graph)

Offsetbasedgraph can be used together with pyvg to represent huge graphs created by vg (requires vg json graph format):

 pyvg.conversion import json_file_to_obg_numpy_graph
et_based_graph = json_file_to_obg_numpy_graph("vggraph.json")

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.