Coder Social home page Coder Social logo

pygssw's Introduction

Pygssw

A simple Python wrapper around gssw, enabling sequence to graph alignment from Python. Only tested with Python 3.

Install

Pygssw can installed with pip:

pip3 install pygssw

Usage

from pygssw import align
nodes = [1, 2, 3] 
edges = [(1, 2), (2, 3)]
node_sequences = ["AAA", "CCC", "TTT"]  # Same order as nodes list
read = "AAACTCTTT"

alignment, score = align(nodes, node_sequences, edges, read)
print(alignment, score)

Note: It seems that GSSW only supports dense sorted nodes, and no edges going from a higher node id to a lower. Pygssw attempts to converting all node IDs before calling GSSW. After aligning, it converts the node IDs back.

Installing from source

This guide assumes linux.

  • Clone this repository
  • Install requirements:
apt install swig
apt install python3-dev
  • Install:
cd pygssw   # Folder pygssw inside the repo
swig -python gssw.i
gcc -fpic  -c -O3 -msse4 gssw.c gssw_wrap.c -I/usr/include/python3.6m
ld -shared gssw.o gssw_wrap.o -o _gssw.so
cd ..
pip3 install -e .

NOTE: Change /usr/include/python3.6m to python-dev executable (requires intallation of python-dev, i.e. apt-get install python3-dev)

pygssw's People

Contributors

ivargr avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.