A python package to efficiently store oriented DNA fragments succession relationships in a directed graph. For example, succession relationships can be overlaps between two reads.
Project description
Reverse Symmetric Graph: a Python3 API to store succession relationships between DNA oriented fragments in an oriented graph
revsymg
is a Python3 API to store succession relationships between oriented fragments (in forward or reverse orientation) that have been sequenced from nucleotide sequence(s) in an oriented graph.
For example, this API can be used for a genome assembly overlap-layout-consensus method.
You can find the complete documentation here
Quick installation
To install the revsymg
package from the PyPI repository, run the pip
command :
pip install revsymg
You can find more installation details in the docs/src/install.md file.
Quick usage example
from revsymg.graphs import RevSymGraph
from revsymg.lib import FORWARD_INT, REVERSE_INT
#
# Create an empty graph
#
graph = RevSymGraph()
vertices = graph.vertices()
edges = graph.edges()
#
# Add two vertices v and w that represents e.g. DNA fragments
#
frag_1_index = vertices.add() # = 0
frag_2_index = vertices.add() # = 1
#
# Add to the graph the overlap v reverse overlaps w forward
#
frag_1_r = (frag_1_index, REVERSE_INT)
frag_2_f = (frag_2_index, FORWARD_INT)
overlap_index = edges.add(frag_1_r, frag_2_f) # = 0
for u, v, edge_index in edges:
print(
f'Predecessor:\t{u}\n'
f'Successor:\t{v}\n'
f'Edge index:\t{edge_index}\n',
)
# The for-loop print this:
#
# Predecessor: (1, 1)
# Successor: (0, 0)
# Edge index: 0
#
# Predecessor: (0, 1)
# Successor: (1, 0)
# Edge index: 0
#
Changelog
You can refer to the docs/src/changelog.md file for details.
What next?
Find a list of ideas in the docs/src/todo.md file.
Contributing
- If you find any errors, missing documentation or test, or you want to discuss features you would like to have, please post an issue (with the corresponding predefined template) here.
- If you want to help me code, please post an issue or contact me. You can find coding convention in the docs/src/contributing.md file.
References
- The implemented structure is described as DGF in this preprint:
📰 Victor Epain, ‘Overlap Graph for Assembling and Scaffolding Algorithms: Paradigm Review and Implementation Proposals’, 2022, https://hal.inria.fr/hal-03815190
- Inspired by graph-tool
Licence
This work is licensed under a GNU-GPLv3 licence.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.