Giter Site home page Giter Site logo

align's Introduction

align

Performs sequence alignment. The alignment can either be global or local in combination with either mutual or non-mutual.

Introduction

align is a Python module that provides a general (read: not restricted to bioinformatics) implementation of both global and local sequence alignment. The alignments can further be both mutual and non-mutual. Mutual alignment is sequence alignment where both sequences are candidates for gap insertion whilst non-mutual alignment only allows for gap insertion into the second sequence.

It is implemented in C for speed and wrapped with Cython to provide the ease of use of Python. The algorithms used are Needleman-Wunsch for global alignment and Smith-Waterman for local alignment.

align uses a symmetric numpy.ndarray as scoring matrix which needs to be of dtype numpy.int16.

It also supports iterative alignments (aligning a sequence with another sequence that already contains gaps). To use this the scoring matrix needs to be of the shape (257, 257) with the last row and column being used to score matchings of the fixed gaps and the symbols of the alphabet.

Installation

Install align with python setup.py install

Usage

>>> import numpy
>>> import align
>>> S = -numpy.ones((256, 256)) + 2 * numpy.identity(256)
>>> S = S.astype(numpy.int16)
>>> s1 = align.string_to_alignment('AATGT')
>>> s2 = align.string_to_alignment('ATGAC')
>>> (s, a1, a2) = align.align(s1, s2, -2, -2, S, local=True)
>>> print('%s\n%s\nScore: %d' % (align.alignment_to_string(a1), align.alignment_to_string(a2), s))
ATG
ATG
Score: 3

License

Distributed under the MIT license. See the LICENSE file.

align's People

Contributors

fredrikappelros avatar

Watchers

Thomas 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.