Multiple Sequence Alignment via Dynamic Programming
Project description
Dil / Language: 🇹🇷 Türkçe · 🇬🇧 English
zehramsa — Çoklu Dizi Hizalama Kütüphanesi
zehramsa, Needleman-Wunsch dinamik programlama algoritmasına dayalı progresif hizalama yaklaşımını kullanarak birden fazla DNA dizisini hizalayan, saf Python ile yazılmış bir kütüphanedir. Harici bağımlılık gerektirmez; pip ile kurulabilir.
Teknolojiler
- Python 3.9+
- Needleman-Wunsch — global pairwise hizalama (dinamik programlama)
- Progresif MSA — NW tabanlı adım adım çoklu dizi birleştirme
- pyproject.toml — pip kurulum desteği
Özellikler
- İkili dizi hizalama (Needleman-Wunsch DP)
- 2+ dizi için progresif NW tabanlı MSA
- Özelleştirilebilir puanlama (match / mismatch / gap)
- Sum-of-Pairs hizalama skoru hesaplama
- Hizalama kimlik yüzdesi hesaplama
- Tip ve girdi doğrulama ile açık hata mesajları
Kurulum
pip install zehramsa
Kullanım
Çoklu dizi hizalama
from zehramsa import align, SimpleScoring
result = align(["GATTACA", "GCATGCU", "GAGTACA"])
print(result)
result = align(["ACGT", "ACCT", "AGGT"], scoring=SimpleScoring(match=2.0, mismatch=-1.0, gap=-2.0))
print(result.score)
dp_align ile hizalama
from zehramsa import dp_align
result = dp_align(["GAT", "GCT", "GTT"])
print(result)
result = dp_align(["ACGT", "AGT", "ACT"], scoring=SimpleScoring(match=2.0, mismatch=-1.0, gap=-2.0))
print(result.score)
Needleman-Wunsch ikili hizalama
from zehramsa import needleman_wunsch
pw = needleman_wunsch("GATTACA", "GCATGCU")
print(pw)
Algoritmalar
| Fonksiyon | Yöntem | Karmaşıklık |
|---|---|---|
align() / dp_align() |
Progresif NW | O(k·n²) |
needleman_wunsch() |
Pairwise DP | O(n²) |
align()vedp_align()aynı algoritmayı çalıştırır;align()ek olarakverboseparametresi sunar.
Süreç
Proje, dinamik programlama ile çoklu dizi hizalamasının sıfırdan uygulanmasına odaklanır. Önce Needleman-Wunsch algoritması ayrı bir modül olarak kuruldu; ardından 2+ dizi için progresif hizalama stratejisi entegre edildi. Her yeni dizi, referans diziye (ilk dizi) NW ile hizalanarak mevcut hizalamaya eklenir. Sum-of-Pairs skoru tüm kolon çiftleri üzerinden hesaplanır.
zehramsa — Multiple Sequence Alignment Library
zehramsa is a pure Python library that aligns multiple DNA sequences using a progressive alignment approach based on the Needleman-Wunsch dynamic programming algorithm. No external dependencies required; installable via pip.
Technologies
- Python 3.9+
- Needleman-Wunsch — global pairwise alignment (dynamic programming)
- Progressive MSA — NW-based step-by-step multi-sequence merging
- pyproject.toml — pip installation support
Features
- Pairwise sequence alignment (Needleman-Wunsch DP)
- Progressive NW-based MSA for 2+ sequences
- Customizable scoring (match / mismatch / gap)
- Sum-of-Pairs alignment score calculation
- Alignment identity percentage calculation
- Type and input validation with clear error messages
Installation
pip install zehramsa
Usage
Multiple sequence alignment
from zehramsa import align, SimpleScoring
result = align(["GATTACA", "GCATGCU", "GAGTACA"])
print(result)
result = align(["ACGT", "ACCT", "AGGT"], scoring=SimpleScoring(match=2.0, mismatch=-1.0, gap=-2.0))
print(result.score)
Align with dp_align
from zehramsa import dp_align
result = dp_align(["GAT", "GCT", "GTT"])
print(result)
result = dp_align(["ACGT", "AGT", "ACT"], scoring=SimpleScoring(match=2.0, mismatch=-1.0, gap=-2.0))
print(result.score)
Pairwise alignment with Needleman-Wunsch
from zehramsa import needleman_wunsch
pw = needleman_wunsch("GATTACA", "GCATGCU")
print(pw)
Algorithms
| Function | Method | Complexity |
|---|---|---|
align() / dp_align() |
Progressive NW | O(k·n²) |
needleman_wunsch() |
Pairwise DP | O(n²) |
align()anddp_align()run the same algorithm;align()additionally offers averboseparameter.
The Process
The project focuses on implementing multiple sequence alignment from scratch using dynamic programming. Needleman-Wunsch was built as a standalone module first; progressive alignment strategy was then integrated for 2+ sequences. Each new sequence is aligned to the reference sequence (first sequence) via NW and merged into the existing alignment. Sum-of-Pairs score is computed over all column pairs.
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zehramsa-1.0.3.tar.gz.
File metadata
- Download URL: zehramsa-1.0.3.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f54c42ba1c7acc700f3a69af727f754d013d0d70b265cc8bbc6927a6d80fb362
|
|
| MD5 |
ae9e1745d490c3bdf6ee90288df5ba32
|
|
| BLAKE2b-256 |
0e10b2b0f5c5305833ece76cc176d55fe131776463692a56dc8b77febdec1431
|
File details
Details for the file zehramsa-1.0.3-py3-none-any.whl.
File metadata
- Download URL: zehramsa-1.0.3-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92dd8d9b936ab56e106113b96af374eb015a1f413aefd25ba431db94fc3ee143
|
|
| MD5 |
72049d562abecedb35968369380b1408
|
|
| BLAKE2b-256 |
d81eed3fbf3dbfaf375b9ca0b17bf930d539b107bfc6417a919fb05cfae03340
|