A package to compute edit distance measurements and sequence alignments.
Project description
seq_alignment : A python tool for sequence alignment and edit distances
Module to determine distances between two strings (or two lists of strings). The primary use case of this package is to allow users to both compute distance measures using different distance algorithms. Additionally, we provide additional functionality to both visualize the alignment of the two strings. This allows users to determine how one string is transformed into another.
For reference on differences between global and local alignment, see Chapter 11 and 12 of Algorithms on Strings, Trees, and Sequences.
Installation
Project is available on pypi, installation via pip:
pip install seq_alignment
Algorithms Available
Global Alignment (Wagner Fischer)
To run the matching, you import global_similarity
class, initialize with the strings you want to compare (accepts strings or list of strings), and then run your algorithm.
The main options available are whether to compute back-trace, to not compute backtrace and return on edit distance (or string similarity) values set backtrace = False
when initalizing the class.
## Run algo getting ONLY edit distance
##
## This runs fast due to not having to store
## backtrace values
from seq_alignment import global_similarity
# Test values
str1=['v','i','n','e']
str2=['v','i','n']
# Initalize matching class function
sim_init = global_similarity(str1,str2,False)
# Run matching
sim_init.run()
# Get edit distance
print("EDIT DISTANCE")
print(sim_init.match_distance)
Local Alignment (Smith Waterman)
Same syntax to running global alignment, but now you import the local_similarity
class.
## Run algo getting ONLY edit distance
##
## This runs fast due to not having to store
## backtrace values
from seq_alignment import local_similarity
# Test values
str1=['v','i','n','e']
str2=['v','i','n']
# Initalize matching class function
sim_init = local_similarity(str1,str2,False)
# Run matching
sim_init.run()
# Get edit distance
print("EDIT DISTANCE")
print(sim_init.match_distance)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file seq_alignment-1.0.0.tar.gz
.
File metadata
- Download URL: seq_alignment-1.0.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c50fb85f01e3846180e830e4dcf37b412ab1e73a2e21e5633c239545aef61db |
|
MD5 | bfe06cda4128f1ac656b41c014c2d2f0 |
|
BLAKE2b-256 | 479d7c6b315ee8921bc2155fceea5dcd541e5c642cb2c5d6933f6ea24f755e60 |
File details
Details for the file seq_alignment-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: seq_alignment-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c0bfc487d17786d6326bf451c6b655302d26295408816ec9f594ad208f83fa9 |
|
MD5 | 6e2469990b66f62fc8c3329cf019cd0e |
|
BLAKE2b-256 | 6c65dd3431e563d9bb1eb3d62e20bd331ff6410b58d322b271e6f6d39bc5363c |